示例#1
0
        public TreeNodeValue(XmlNode node, ObjectXmlReader reader)
        {
            _xmlNode = node;
            string name = XmlUtil.GetNameAttribute(_xmlNode);
            Type   type = XmlUtil.GetLibTypeAttribute(_xmlNode);
            object d    = reader.ReadValue(_xmlNode, null, type);

            _data = new TypedNamedValue(name, new TypedValue(type, d));
            init();
        }
 public void AddValue(string name, TypedValue value)
 {
     if (_data == null)
     {
         _data = new Dictionary <string, TypedNamedValue>();
     }
     if (_data.ContainsKey(name))
     {
         _data[name] = new TypedNamedValue(name, value);
     }
     else
     {
         _data.Add(name, new TypedNamedValue(name, value));
     }
 }
 public void OnValueNameChanged(Guid categoryId, string oldName, string valueName)
 {
     if (this.NextLevelLoaded)
     {
         if (this.TreeNodeId == categoryId)
         {
             foreach (TreeNode tn in Nodes)
             {
                 TreeNodeValue tnv = tn as TreeNodeValue;
                 if (tnv != null)
                 {
                     if (string.CompareOrdinal(valueName, tnv.DataName) == 0)
                     {
                         if (_data != null)
                         {
                             if (_data.ContainsKey(oldName))
                             {
                                 TypedNamedValue v = _data[oldName];
                                 _data.Remove(oldName);
                                 _data.Add(valueName, v);
                             }
                         }
                         tnv.OnDataNameChanged();
                         break;
                     }
                 }
             }
         }
         else
         {
             foreach (TreeNode tn in Nodes)
             {
                 TreeNodeX tnx = tn as TreeNodeX;
                 if (tnx != null)
                 {
                     tnx.OnValueNameChanged(categoryId, oldName, valueName);
                 }
             }
         }
     }
 }
 public PropertyDescriptorValue(bool readOnly, TypedNamedValue owner, Attribute[] attrs)
     : base("Value", attrs)
 {
     _readOnly = readOnly;
     _owner    = owner;
 }
示例#5
0
 public TreeNodeValue(TypedNamedValue value)
 {
     _data = value;
     init();
 }
示例#6
0
 public TreeNodeValue(string name, TypedValue value)
 {
     _data = new TypedNamedValue(name, value);
     init();
 }