Ejemplo n.º 1
0
        public static ManagedFormAttribute CreateFromList(SerializedList attrLst)
        {
            String Name = attrLst.Items[3].ToString();
            String Syn  = null;

            if (attrLst.Items[4].Items[1].ToString() == "0")
            {
                Syn = Name;
            }
            else
            {
                Syn = attrLst.Items[4].Items[2].Items[1].ToString();
            }

            bool isBasic = attrLst.Items[10].ToString() == "1";

            var pattern = (SerializedList)attrLst.Items[5];

            ManagedFormAttributeType type = new ManagedFormAttributeType();

            type.TypeDescription = V8TypeDescription.ReadFromList(pattern);

            ManagedFormAttribute attr;

            int childCount = Int32.Parse(attrLst.Items[13].ToString());

            if (childCount > 0)
            {
                int baseIndex = 14;

                ManagedFormAttribute[] children = new ManagedFormAttribute[childCount];

                for (int i = 0; i < childCount; i++)
                {
                    SerializedList innerAttr = (SerializedList)attrLst.Items[baseIndex + i];

                    children[i] = CreateChildFromList(innerAttr);
                }

                attr = new ManagedFormAttribute(Name, Syn, type, children);
            }
            else
            {
                attr = new ManagedFormAttribute(Name, Syn, type);
            }

            attr.IsBasic = isBasic;

            return(attr);
        }
Ejemplo n.º 2
0
        private ManagedFormAttribute(String name, String synonym, ManagedFormAttributeType type, ManagedFormAttribute[] children)
        {
            m_Type = type;
            Name   = name;
            Title  = synonym;

            if (children != null)
            {
                m_ChildItems = new MDObjectsCollection <ManagedFormAttribute>();

                foreach (var child in children)
                {
                    m_ChildItems.Add(child);
                }
            }
        }
Ejemplo n.º 3
0
        private static ManagedFormAttribute CreateChildFromList(SerializedList childAttr)
        {
            String Name = childAttr.Items[3].ToString();
            String Syn  = null;

            if (childAttr.Items[4].Items.Count < 3 || childAttr.Items[4].Items[2].ToString() == "0")
            {
                Syn = Name;
            }
            else
            {
                Syn = childAttr.Items[4].Items[2].Items[1].ToString();
            }

            var pattern = (SerializedList)childAttr.Items[5];

            ManagedFormAttributeType type = new ManagedFormAttributeType();

            type.TypeDescription = V8TypeDescription.ReadFromList(pattern);

            return(new ManagedFormAttribute(Name, Syn, type));
        }
Ejemplo n.º 4
0
 private ManagedFormAttribute(String name, String synonym, ManagedFormAttributeType type) : this(name, synonym, type, null)
 {
 }