Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public virtual DataControl CreateControl(ObjectTypeMember member)
 {
     return new DataControl_string(member);
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 5
0
 public override DataControl CreateControl(ObjectTypeMember member)
 {
     return new DataControl_Enum(m_EnumsMap,member);
 }
Ejemplo n.º 6
0
 public override DataControl CreateControl(ObjectTypeMember member)
 {
     return new DataControl_BitFlags(m_FlagsMap,m_ValuesMap, member);
 }
Ejemplo n.º 7
0
 public void CreateControls(ObjectTypeMember member)
 {
     m_Control = (DataControl_ObjectType)CreateControl(member);
 }
Ejemplo n.º 8
0
 public override DataControl CreateControl(ObjectTypeMember member)
 {
     return new DataControl_ObjectType(this,member);
 }
Ejemplo n.º 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;
     }
 }