Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Gibt die Richtung eines IContextLink-Objekts an.
Syntax
typedef enum ContextLinkDirection {
ContextLinkDirection_LinksWith = 0,
ContextLinkDirection_LinksFrom = 1,
ContextLinkDirection_LinksTo = 2
} ContextLinkDirection;
Konstanten
-
ContextLinkDirection_LinksWith
-
Der IContextNode ist eine direktionale Zeichnung, die vom IContextLink weg zeigt.
-
ContextLinkDirection_LinksFrom
-
Der IContextNode ist eine direktionale Zeichnung, die auf IContextLink zeigt.
-
ContextLinkDirection_LinksTo
-
Der Link enthält keine richtungsgerichteten Zeichnungen. Beispielsweise kann eine Freihandzeichnung ein Freihandwort unterstreichen. Aus der Unterstreichung wird keine Richtung abgeleitet.
Beispiele
Im folgenden Beispiel wird ein IContextNode-Objekt ( m_pSelectedNode) verwendet, und es speichert alle IContextNode-Objekte , mit denen eine Verknüpfung besteht, indem die übergeordnete Struktur nach oben geleitet und die Objekte in ein CArray -Objekt ( linkedToNodes) eingefügt werden.
CheckHResultist eine Funktion, die eine HRESULT und eine Zeichenfolge akzeptiert und eine Ausnahme auslöst, die mit der Zeichenfolge erstellt wurde, wenn nichtHRESULT SUCCESS ist.
// Find all first ancestor that contains links of type Enclose
CArray<IContextNode*,IContextNode*> linkedToNodes = CArray<IContextNode*,IContextNode*>();
IContextNode* pAncestor;
CheckHResult(m_pSelectedNode->GetParentNode(&pAncestor),
"IContextNode::GetParentNode failed");
while (pAncestor != NULL)
{
// Get the links
IContextLinks* pLinks;
CheckHResult(pAncestor->GetContextLinks(&pLinks),
"IContextNode::GetContextLinks failed");
ULONG nLinks;
CheckHResult(pLinks->GetCount(&nLinks), "IContextLinks::GetCount failed");
for (ULONG i = 0; i < nLinks; i++)
{
IContextLink* pLink;
CheckHResult(pLinks->GetContextLink(i, &pLink),
"IContextLinks::GetContextLink failed");
// Check link direction
ContextLinkDirection linkDirection;
CheckHResult(pLink->GetContextLinkDirection(&linkDirection),
"IContextLink:GetContextLinkDirection failed");
if (linkDirection == ContextLinkDirection_LinksTo)
{
// Get source node and add the array
IContextNode* pSourceNode;
CheckHResult(pLink->GetSourceNode(&pSourceNode),
"IContextLink::GetSourceNode failed");
linkedToNodes.Add(pSourceNode);
}
}
// Go up another level
IContextNode* pNewAncestor;
CheckHResult(pAncestor->GetParentNode(&pNewAncestor),
"IContextNode::GetParentNode failed");
pAncestor = pNewAncestor;
}
Anforderungen
| Anforderung | Wert |
|---|---|
| Unterstützte Mindestversion (Client) |
Windows XP Tablet PC Edition [nur Desktop-Apps] |
| Unterstützte Mindestversion (Server) |
Nicht unterstützt |
| Header |
|