public DataControl_ObjectType(ObjectType objectType,ObjectTypeMember member)
            : base(member)
        {
            ObjectType currParentType = objectType.m_ParentType;

            while (currParentType != null)
            {
                DataControl[] parentControls = CreateControlForDirectTypeMembers(currParentType);
                for (int i = 0; i < parentControls.Length;i++ )
                {
                    Controls.Add(parentControls[i]);
                    m_DataControls.Add(parentControls[i]);
                }
                currParentType = currParentType.m_ParentType;
            }

            DataControl[] objectControls = CreateControlForDirectTypeMembers(objectType);
            for (int i = 0; i < objectControls.Length; i++)
            {
                Controls.Add(objectControls[i]);
                m_DataControls.Add(objectControls[i]);
            }

            SetLabelText(objectType.m_Name);
        }
Beispiel #2
0
 public virtual DataControl CreateControl(ObjectTypeMember member)
 {
     return new DataControl_string(member);
 }
Beispiel #3
0
 void WriteMember(ObjectTypeMember member, XmlWriter xmlWriter)
 {
     xmlWriter.WriteStartElement("member");
     xmlWriter.WriteAttributeString("name", member.m_Name);
     xmlWriter.WriteAttributeString("type", member.m_Type.m_Name);
     Object value = m_MembersMap[member];
     member.Write(value, xmlWriter);
     xmlWriter.WriteEndElement();
 }
Beispiel #4
0
 public void ReadMember(ObjectTypeMember member, XmlNode rootNode)
 {
     XmlNode memberNode = XmlHelpers.GetXmlNodeForObjectMember(rootNode, member.m_Name);
     if(memberNode!= null)
     {
         XmlNode valueNode = XmlHelpers.GetXmlFirstChildNode(memberNode);
         Object value = m_MembersMap[member];
         member.Read(valueNode,ref value);
         m_MembersMap[member] = value;
     }
 }
Beispiel #5
0
 public override DataControl CreateControl(ObjectTypeMember member)
 {
     return new DataControl_Enum(m_EnumsMap,member);
 }
Beispiel #6
0
 public override DataControl CreateControl(ObjectTypeMember member)
 {
     return new DataControl_BitFlags(m_FlagsMap,m_ValuesMap, member);
 }
Beispiel #7
0
 public void CreateControls(ObjectTypeMember member)
 {
     m_Control = (DataControl_ObjectType)CreateControl(member);
 }
Beispiel #8
0
 public override DataControl CreateControl(ObjectTypeMember member)
 {
     return new DataControl_ObjectType(this,member);
 }
Beispiel #9
0
 void AddMember(XmlNode memberNode)
 {
     ObjectTypeMember newMember = new ObjectTypeMember();
     for (int i = 0; i < memberNode.ChildNodes.Count; i++)
     {
         XmlNode currNode = memberNode.ChildNodes[i];
         if (currNode.NodeType == XmlNodeType.Element)
         {
             if (currNode.Name.Equals("type", StringComparison.OrdinalIgnoreCase))
             {
                 newMember.m_TypeName = currNode.InnerText;
             }
             if (currNode.Name.Equals("name", StringComparison.OrdinalIgnoreCase))
             {
                 newMember.m_Name = currNode.InnerText;
             }
             if (currNode.Name.Equals("displayname", StringComparison.OrdinalIgnoreCase))
             {
                 newMember.m_DisplayName = currNode.InnerText;
             }
             if (currNode.Name.Equals("description", StringComparison.OrdinalIgnoreCase))
             {
                 newMember.m_Description = currNode.InnerText;
             }
             if (currNode.Name.Equals("coretype", StringComparison.OrdinalIgnoreCase))
             {
                 newMember.m_bIsCoreType = int.Parse(currNode.InnerText)==1;
             }
             if (currNode.Name.Equals("reference", StringComparison.OrdinalIgnoreCase))
             {
                 newMember.m_bIsReference = int.Parse(currNode.InnerText)==1;
             }
             if (currNode.Name.Equals("vector", StringComparison.OrdinalIgnoreCase))
             {
                 newMember.m_bIsVector = int.Parse(currNode.InnerText)==1;
             }
             if (currNode.Name.Equals("count", StringComparison.OrdinalIgnoreCase))
             {
                 newMember.m_iCount = int.Parse(currNode.InnerText);
             }
         }
     }
     if (newMember.m_iCount < 2)
     {
         m_Members.Add(newMember);
     }
     else
     {
         newMember.m_iCount = 10;
     }
 }