Example #1
0
 public override void LoadMap(XmlNode node, Assembly typeProvider)
 {
     base.LoadMap(node, typeProvider);
     //load I/S
     foreach (XmlNode nd in node.ChildNodes)
     {
         if (nd.Name == RAIS.XML_I)                 //I
         {
             foreach (XmlNode nd1 in nd.ChildNodes)
             {
                 RAIS_R r = new RAIS_R((RAIS_A)this);
                 r.LoadMap(nd1, typeProvider);
                 AddI(r);
             }
         }
         else if (nd.Name == XML_S)                 //S
         {
             foreach (XmlNode nd1 in nd.ChildNodes)
             {
                 RAIS_A t = new RAIS_A((RAIS_A)this);
                 t.LoadMap(nd1, typeProvider);
                 AddS(t);
             }
         }
     }
 }
Example #2
0
        public RAIS_A AddA(Type type, string name)
        {
            RAIS_A t = new RAIS_A(name, type, this);

            AddA(t);
            return(t);
        }
Example #3
0
 protected void AddA(RAIS_A a)
 {
     if (_a == null)
     {
         _a = new List <RAIS_A>();
     }
     _a.Add(a);
 }
Example #4
0
 protected void AddS(RAIS_A t)
 {
     if (_s == null)
     {
         _s = new List <RAIS_A>();
     }
     _s.Add(t);
 }
Example #5
0
        /// <summary>
        /// populate the object map by loading XML.
        /// </summary>
        /// <param name="node"></param>
        public virtual void LoadMap(XmlNode node, Assembly typeProvider)
        {
            this.Name = GetAttribute(node, RAIS.XMLATT_NAME);
            string s = GetAttribute(node, RAIS.TYPE);

            this.Type = typeProvider.GetType(s, true);
            //load R/A/I/S
            foreach (XmlNode nd in node.ChildNodes)
            {
                if (nd.Name == XML_R)                 //R
                {
                    RAIS_R r = new RAIS_R((RAIS)this);
                    r.LoadMap(nd, typeProvider);
                    AddR(r);
                }
                else if (nd.Name == XML_A)                 //A
                {
                    RAIS_A t = new RAIS_A((RAIS)this);
                    t.LoadMap(nd, typeProvider);
                    AddA(t);
                }
            }
        }
Example #6
0
 public RAIS_A(RAIS_A baseType)
     : base(baseType)
 {
 }
Example #7
0
 public RAIS_A(string name, Type type, RAIS_A baseType)
     : base(name, type, baseType)
 {
 }
Example #8
0
 /// <summary>
 /// create a member of I/S
 /// </summary>
 /// <param name="name"></param>
 /// <param name="type"></param>
 /// <param name="baseType"></param>
 public RAIS_R(string name, object instance, RAIS_A baseType)
     : base(name, instance.GetType(), baseType)
 {
     _object = instance;
 }
Example #9
0
 /// <summary>
 /// for loading map. name and type will be read from XML
 /// </summary>
 /// <param name="baseType"></param>
 protected RAIS(RAIS_A baseType)
 {
     _name     = null;
     _type     = null;
     _baseType = baseType;
 }
Example #10
0
 /// <summary>
 /// to create a member of I/S
 /// </summary>
 /// <param name="name"></param>
 /// <param name="type"></param>
 /// <param name="baseType"></param>
 protected RAIS(string name, Type type, RAIS_A baseType)
 {
     _name     = name;
     _baseType = baseType;
     _type     = type;
 }