Exemplo n.º 1
0
        public T GetDynamicValue <T>(string Name)
        {
            Name = Name.Replace('-', '_');
            DynamicPropertyDescriptor <T> Descriptor = (DynamicPropertyDescriptor <T>)DynamicProperties_.Find(Name, false);

            return((T)Descriptor.GetValue(this));
        }
Exemplo n.º 2
0
        public void SetDynamicValue <T>(string Name, T Value)
        {
            Name = Name.Replace('-', '_');
            DynamicPropertyDescriptor <T> Descriptor = (DynamicPropertyDescriptor <T>)DynamicProperties_.Find(Name, false);

            Descriptor.SetValue(this, Value);
        }
 public DynamicPropertyDescriptor(object Component, DynamicPropertyDescriptor <T> Parent, string Name, Attribute[] Attrs)
     : base(Name, Attrs)
 {
     foreach (DefaultValueAttribute Attr in Attrs.OfType <DefaultValueAttribute>())
     {
         Value_ = (T)Attr.Value;
     }
     Parent_       = Parent;
     IsInheriting_ = true;
     Component_    = Component;
 }
Exemplo n.º 4
0
        protected void AddDynamicProperty <T>(string Name, Attribute[] Attributes)
        {
            Name = Name.Replace('-', '_');

            // If we have a parent, find the corresponding PropertyDescriptor with the same
            // name from the parent.
            DynamicPropertyDescriptor <T> ParentDescriptor = null;

            if (Parent_ != null)
            {
                ParentDescriptor = (DynamicPropertyDescriptor <T>)Parent_.GetProperties().Find(Name, false);
            }

            DynamicProperties_.Add(new DynamicPropertyDescriptor <T>(Name, ParentDescriptor, Name, Attributes));
        }
 public DynamicPropertyConverter(DynamicPropertyDescriptor <T> Descriptor, TypeConverter Root)
 {
     Descriptor_ = Descriptor;
     Root_       = Root;
 }
 public CheckLeaf(string Name, CheckTree Parent, DynamicPropertyDescriptor <bool> Property)
     : base(Name, Parent)
 {
     Property_ = Property;
 }
 private void AddLeaf(string Name, DynamicPropertyDescriptor <bool> Property)
 {
     Children_[Name] = new CheckLeaf(Name, this, Property);
 }