Enumeração ContextLinkDirection

Especifica a direção de um objeto IContextLink .

Sintaxe

typedef enum ContextLinkDirection { 
  ContextLinkDirection_LinksWith  = 0,
  ContextLinkDirection_LinksFrom  = 1,
  ContextLinkDirection_LinksTo    = 2
} ContextLinkDirection;

Constantes

ContextLinkDirection_LinksWith

O IContextNode é um desenho direcional que aponta para longe do IContextLink.

ContextLinkDirection_LinksFrom

O IContextNode é um desenho direcional que aponta para o IContextLink.

ContextLinkDirection_LinksTo

Não há desenhos direcionais no link. Por exemplo, um desenho à tinta pode sublinhar uma palavra à tinta. Não há nenhuma direção inferida do sublinhado.

Exemplos

O exemplo a seguir usa um objeto IContextNode , m_pSelectedNodee salva todos os objetos IContextNode aos quais ele se vincula, percorrendo a árvore ancestral e adicionando os objetos a um CArray objeto , linkedToNodes. CheckHResult é uma função que usa uma HRESULT cadeia de caracteres e e gera uma exceção criada com a cadeia de caracteres se o HRESULT não for SUCCESS.

// 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;
}

Requisitos

Requisito Valor
Cliente mínimo com suporte
Windows XP Tablet PC Edition [somente aplicativos da área de trabalho]
Servidor mínimo com suporte
Nenhum compatível
Cabeçalho
IACom.h (também requer IACom_i.c)

Confira também

IContextLink

IContextNode::AddContextLink