Exemple #1
0
        public void OnReadFromXmlNode(IXmlCodeReader serializer, XmlNode node)
        {
            _action.ActionMethod = this;
            _dataTransfers       = new Dictionary <IProperty, ParameterValue>();
            XmlNodeList nds = node.SelectNodes(XmlTags.XML_Item);

            if (nds != null)
            {
                foreach (XmlNode item in nds)
                {
                    XmlNode pNode = item.SelectSingleNode(XmlTags.XML_PROPERTY);
                    if (pNode != null)
                    {
                        IProperty p = (IProperty)serializer.ReadObject(pNode, this);
                        AddProperty(p);
                        ParameterValue pv    = _dataTransfers[p];
                        XmlNode        vNode = item.SelectSingleNode(XmlTags.XML_Data);
                        if (vNode != null)
                        {
                            serializer.ReadObjectFromXmlNode(vNode, pv, typeof(ParameterValue), this);
                        }
                    }
                }
            }
        }
        public void OnReadFromXmlNode(IXmlCodeReader serializer, XmlNode node)
        {
            _instanceType = serializer.ReadValue <Type>(node, null);
            if (_instanceType == null)
            {
                string msg = node.InnerXml;
                throw new VPLException("Loading type failed from xml [{0}]. If this project was developed in another Limnor Studio IDE then it could be that some support files or dependent assemblies are not copied from the original IDE", msg);
            }
            SetType(_instanceType, serializer.ProjectFolder);
            XmlNode dataNode = node.SelectSingleNode(XML_Data);

            if (dataNode != null)
            {
                PropertyDescriptorCollection ps = GetProperties();
                foreach (XmlNode nd in dataNode.ChildNodes)
                {
                    PropertyDescriptor p = ps[nd.Name];
                    if (p != null)
                    {
                        object obj = serializer.ReadObject(nd, this);                        //.ReadObjectFromXmlNode(nd, obj, p.PropertyType, this);
                        p.SetValue(this, obj);
                    }
                }
            }
        }
Exemple #3
0
        public void OnReadFromXmlNode(IXmlCodeReader serializer, XmlNode node)
        {
            XmlNode data = node.SelectSingleNode(XmlTags.XML_Data);

            if (data != null)
            {
                _value = serializer.ReadObject(data, this);
            }
        }
Exemple #4
0
        public void OnReadFromXmlNode(IXmlCodeReader reader, XmlNode node)
        {
            XmlNode nd = node.SelectSingleNode(XmlTags.XML_PROPERTY);

            if (nd != null)
            {
                _valuePointer = (IObjectPointer)reader.ReadObject(nd, null);
            }
        }
        public void OnReadFromXmlNode(IXmlCodeReader serializer, XmlNode node)
        {
            Name = XmlUtil.GetNameAttribute(node);
            XmlNode valNode = node.SelectSingleNode(XmlTags.XML_Object);

            if (valNode != null)
            {
                Value = (IJavascriptType)serializer.ReadObject(valNode, this);
            }
        }
Exemple #6
0
        public void OnReadFromXmlNode(IXmlCodeReader reader, XmlNode node)
        {
            XmlNode epNode = node.SelectSingleNode(XML_EventPointer);

            if (epNode == null)
            {
                throw new DesignerException("EventPointer node not found");
            }
            _memberId = XmlUtil.GetAttributeUInt(node, XMLATT_firerId);
            _event    = reader.ReadObject <CustomEventPointer>(epNode);
        }
Exemple #7
0
 public void OnPostRootDeserialize()
 {
     if (_xmlNode != null && _reader != null)
     {
         XmlNode actNode = _xmlNode.SelectSingleNode(XmlTags.XML_ACTION);
         if (actNode != null)
         {
             _action = _reader.ReadObject(actNode, this) as IAction;
         }
     }
 }
Exemple #8
0
 public override void OnReadFromXmlNode(IXmlCodeReader reader, XmlNode node)
 {
     base.OnReadFromXmlNode(reader, node);
     if (!DoNotSaveData)
     {
         XmlNode dataNode = node.SelectSingleNode(XmlTags.XML_Var);
         if (dataNode != null)
         {
             ClassPointer = (IClass)reader.ReadObject(dataNode, this);
         }
     }
 }
        protected override void OnRead(IXmlCodeReader reader, XmlNode node)
        {
            XmlNode nd = node.SelectSingleNode(XML_Value);

            if (nd != null)
            {
                if (ValueType == EnumValueType.ConstantValue)
                {
                    ConstantValue.OnReadFromXmlNode(reader, nd);
                }
                else if (ValueType == EnumValueType.MathExpression)
                {
                    MathExpression.OnReadFromXmlNode(reader, nd);
                }
                else if (ValueType == EnumValueType.Property)
                {
                    if (!XmlUtil.GetAttributeBoolDefFalse(nd, XmlTags.XMLATT_IsNull))
                    {
                        Property = reader.ReadObject(nd, this) as IObjectPointer;
                    }
                }
            }
        }
 public void OnReadFromXmlNode(IXmlCodeReader reader, XmlNode node)
 {
     _methodPointer = (IActionMethodPointer)reader.ReadObject(node, null);
     _id            = XmlUtil.GetAttributeUInt(node, XmlTags.XMLATT_NodeId);
 }