public override void Assign(object value, IGraphProcessingEnvironment procEnv)
        {
            IGraphElement elem        = (IGraphElement)GraphElementVar.GetVariableValue(procEnv);
            int           visitedFlag = VisitedFlagExpression != null ? (int)VisitedFlagExpression.Evaluate(procEnv) : 0;

            procEnv.Graph.SetVisited(elem, visitedFlag, (bool)value);
        }
        public override void Assign(object value, IGraphProcessingEnvironment procEnv)
        {
            object container = DestVar.GetVariableValue(procEnv);
            object key       = KeyExpression.Evaluate(procEnv);

            if (container is IList)
            {
                IList array = (IList)container;
                if (array.Count > (int)key)
                {
                    array[(int)key] = value;
                }
            }
            else if (container is IDeque)
            {
                IDeque deque = (IDeque)container;
                if (deque.Count > (int)key)
                {
                    deque[(int)key] = value;
                }
            }
            else
            {
                IDictionary map = (IDictionary)container;
                if (map.Contains(key))
                {
                    map[key] = value;
                }
            }
        }
示例#3
0
        public override void Assign(object value, IGraphProcessingEnvironment procEnv)
        {
            IGraphElement elem = (IGraphElement)DestVar.GetVariableValue(procEnv);
            AttributeType attrType;

            value = ContainerHelper.IfAttributeOfElementIsContainerThenCloneContainer(
                elem, AttributeName, value, out attrType);
            AttributeChangeType changeType = AttributeChangeType.Assign;

            if (elem is INode)
            {
                procEnv.Graph.ChangingNodeAttribute((INode)elem, attrType, changeType, value, null);
            }
            else
            {
                procEnv.Graph.ChangingEdgeAttribute((IEdge)elem, attrType, changeType, value, null);
            }
            elem.SetAttribute(AttributeName, value);
            if (elem is INode)
            {
                procEnv.Graph.ChangedNodeAttribute((INode)elem, attrType);
            }
            else
            {
                procEnv.Graph.ChangedEdgeAttribute((IEdge)elem, attrType);
            }
        }
        public override void Assign(object value, IGraphProcessingEnvironment procEnv)
        {
            IGraphElement elem = (IGraphElement)DestVar.GetVariableValue(procEnv);
            object container = elem.GetAttribute(AttributeName);
            object key = KeyExpression.Evaluate(procEnv);
            AttributeType attrType = elem.Type.GetAttributeType(AttributeName);

            BaseGraph.ChangingAttributeAssignElement(procEnv.Graph, elem, attrType, value, key);

            if(container is IList)
            {
                IList array = (IList)container;
                array[(int)key] = value;
            }
            else if(container is IDeque)
            {
                IDeque deque = (IDeque)container;
                deque[(int)key] = value;
            }
            else
            {
                IDictionary map = (IDictionary)container;
                map[key] = value;
            }

            BaseGraph.ChangedAttribute(procEnv.Graph, elem, attrType);
        }
        public override void Assign(object value, IGraphProcessingEnvironment procEnv)
        {
            IGraphElement elem = (IGraphElement)DestVar.GetVariableValue(procEnv);
            AttributeType attrType;
            value = ContainerHelper.IfAttributeOfElementIsContainerThenCloneContainer(
                elem, AttributeName, value, out attrType);

            BaseGraph.ChangingAttributeAssign(procEnv.Graph, elem, attrType, value);

            elem.SetAttribute(AttributeName, value);

            BaseGraph.ChangedAttribute(procEnv.Graph, elem, attrType);
        }
 public override void Assign(object value, IGraphProcessingEnvironment procEnv)
 {
     ContainerHelper.AssignAttributeIndexed(DestVar.GetVariableValue(procEnv), KeyExpression.Evaluate(procEnv),
                                            value, AttributeName, procEnv.Graph);
 }