Beispiel #1
0
 public override void FromXml(System.Xml.XmlElement element)
 {
     base.FromXml(element);
     if (element.Attributes["OriginalTableNode"] != null)
     {
         NodeListSerializer.AddFixup(int.Parse(element.Attributes["OriginalTableNode"].Value),
                                     this.GetType().GetField("originalTableNode", BindingFlags.Instance | BindingFlags.NonPublic),
                                     this);
     }
 }
Beispiel #2
0
        public virtual void FromXml(XmlElement element)
        {
            this.Text = element.Attributes["Text"].Value;
            if (element.Attributes["Parent"] != null)
            {
                NodeListSerializer.AddFixup(int.Parse(element.Attributes["Parent"].Value),
                                            typeof(NDOTreeNode).GetField("tnparent", BindingFlags.NonPublic | BindingFlags.Instance),
                                            this);
            }
            XmlElement objectElement = (XmlElement)element.SelectSingleNode("Entity");
            Type       t             = Type.GetType(objectElement.Attributes["Type"].Value);

            this.myObject = Activator.CreateInstance(t);
            ((IXmlStorable)myObject).FromXml(objectElement);
            CalculateIndex();
        }
Beispiel #3
0
        public virtual void FromXml(XmlElement element)
        {
            this.codingStyle1 = (CodingStyle)Enum.Parse(typeof(CodingStyle), element.Attributes["CodingStyle1"].Value);
            this.codingStyle2 = (CodingStyle)Enum.Parse(typeof(CodingStyle), element.Attributes["CodingStyle2"].Value);
            this.fieldName1   = element.Attributes["FieldName1"].Value;
            this.fieldName2   = element.Attributes["FieldName2"].Value;
            this.isComposite1 = bool.Parse(element.Attributes["IsComposite1"].Value);
            this.isComposite2 = bool.Parse(element.Attributes["IsComposite2"].Value);
            Type thisType = this.GetType();

            if (element.Attributes["RelatedColumn1"] != null)
            {
                NodeListSerializer.AddFixup(int.Parse(element.Attributes["RelatedColumn1"].Value),
                                            thisType.GetField("relatedColumn1", BindingFlags.Instance | BindingFlags.NonPublic),
                                            this);
            }
            if (element.Attributes["RelatedColumn2"] != null)
            {
                NodeListSerializer.AddFixup(int.Parse(element.Attributes["RelatedColumn2"].Value),
                                            thisType.GetField("relatedColumn2", BindingFlags.Instance | BindingFlags.NonPublic),
                                            this);
            }
            if (element.Attributes["RelatedTable1"] != null)
            {
                NodeListSerializer.AddFixup(int.Parse(element.Attributes["RelatedTable1"].Value),
                                            thisType.GetField("relatedNode1", BindingFlags.Instance | BindingFlags.NonPublic),
                                            this);
            }
            if (element.Attributes["RelatedTable2"] != null)
            {
                NodeListSerializer.AddFixup(int.Parse(element.Attributes["RelatedTable2"].Value),
                                            thisType.GetField("relatedNode2", BindingFlags.Instance | BindingFlags.NonPublic),
                                            this);
            }

            this.relationCardinality1 = (RelationCardinality)Enum.Parse(typeof(RelationCardinality), element.Attributes["RelationCardinality1"].Value);
            this.relationCardinality2 = (RelationCardinality)Enum.Parse(typeof(RelationCardinality), element.Attributes["RelationCardinality2"].Value);
            this.relationName         = element.Attributes["RelationName"].Value;
        }