Compartir a través de


Enumeración ContextLinkDirection

Especifica la dirección de un objeto IContextLink .

Sintaxis

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

Constantes

ContextLinkDirection_LinksWith

IContextNode es un dibujo direccional que apunta a IContextLink.

ContextLinkDirection_LinksFrom

IContextNode es un dibujo direccional que apunta a IContextLink.

ContextLinkDirection_LinksTo

No hay dibujos direccionales en el vínculo. Por ejemplo, un dibujo de lápiz puede subrayado una palabra de tinta. No hay ninguna dirección inferida del subrayado.

Ejemplos

En el ejemplo siguiente se toma un objeto IContextNode , m_pSelectedNodey se guardan todos los objetos IContextNode a los que se vincula al recorrer el árbol antecesor y agregar los objetos a un CArray objeto , linkedToNodes. CheckHResult es una función que toma y HRESULT una cadena, y produce una excepción creada con la cadena si no HRESULT es 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 Value
Cliente mínimo compatible
Windows XP Tablet PC Edition [solo aplicaciones de escritorio]
Servidor mínimo compatible
No se admite ninguno
Encabezado
IACom.h (también requiere IACom_i.c)

Vea también

IContextLink

IContextNode::AddContextLink