예제 #1
0
        /////////////////////////////////////////////////////////////////////////////////

        public static void AssignAttribute(object target, object value, string attributeName, IGraph graph)
        {
            if (target is IGraphElement)
            {
                IGraphElement elem = (IGraphElement)target;

                AttributeType attrType;
                value = ContainerHelper.IfAttributeOfElementIsContainerThenCloneContainer(
                    elem, attributeName, value, out attrType);

                BaseGraph.ChangingAttributeAssign(graph, elem, attrType, value);

                elem.SetAttribute(attributeName, value);

                BaseGraph.ChangedAttribute(graph, elem, attrType);
            }
            else if (target is IObject)
            {
                IObject elem = (IObject)target;

                AttributeType attrType = elem.Type.GetAttributeType(attributeName);

                BaseGraph.ChangingAttributeAssign(graph, elem, attrType, value);

                elem.SetAttribute(attributeName, value);
            }
            else //if(target is ITransientObject)
            {
                ITransientObject elem = (ITransientObject)target;

                elem.SetAttribute(attributeName, value);
            }
        }
예제 #2
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);

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

            elem.SetAttribute(AttributeName, value);

            BaseGraph.ChangedAttribute(procEnv.Graph, elem, attrType);
        }