GetAlternateNode() public static method

public static GetAlternateNode ( Descriptor descriptor ) : Node
descriptor Descriptor
return Node
Ejemplo n.º 1
0
        public static Guid GetMapId(Node node, Descriptor descriptor)
        {
            Node altNode      = ConditionHelper.GetAlternateNode(descriptor);
            bool isNodeParent = ConditionHelper.IsParentNode(descriptor);

            Guid mapId = Guid.Empty;

            if (!isNodeParent)
            {
                mapId = altNode.NodeUid;
            }
            else
            {
                mapId = node.NodeUid;
            }
            return(mapId);
        }
Ejemplo n.º 2
0
        public bool Evaluate(Node initialSearchNode, Node node, Relationship relationship, Descriptor descriptor)
        {
            Guid searchId   = Guid.Empty;
            bool?evaluation = new bool?();

            if (relationship.RelationshipType.RelationshipTypeName == "MapContainerRelationship")
            {
                Node mapNode = ConditionHelper.GetMapNode(initialSearchNode);

                Node altNode      = ConditionHelper.GetAlternateNode(descriptor);
                bool isNodeParent = ConditionHelper.IsParentNode(descriptor);

                Guid mapId = Guid.Empty;
                if (!isNodeParent && altNode.NodeType.NodeTypeName != "DomainNode")
                {
                    mapId = altNode.NodeUid;
                }
                else
                {
                    mapId = node.NodeUid;
                }

                if (mapNode.NodeUid == mapId)
                {
                    evaluation = true;
                }
                else
                {
                    evaluation = false;
                }
            }
            else
            {
                evaluation = false;
            }



            return(evaluation.Value);
        }