Example #1
0
 public PropertyItem()
 {
     this.Name       = (string)null;
     this.Value      = (object)null;
     this.Access     = PropertyItemAccess.PUBLIC;
     this.Permission = PropertyItemPermission.READWRITE;
 }
Example #2
0
 public PropertyItem(string name, object value)
 {
     this.Name       = name;
     this.Value      = value;
     this.Access     = PropertyItemAccess.PUBLIC;
     this.Permission = PropertyItemPermission.READWRITE;
 }
Example #3
0
 public PropertyItem(string name, object value, PropertyItemAccess access, PropertyItemPermission permission)
 {
     this.Name       = name;
     this.Value      = value;
     this.Access     = access;
     this.Permission = permission;
 }
 internal void VerifyAccess(FieldInfo fi, PropertyItemAccess a)
 {
     if (this.GetAccess(fi) != a)
     {
         throw new ApplicationException("Item " + fi.Name + " is not a " + (object)a + "property");
     }
 }
    public void SetPrivateProperty(string name, object value, PropertyItemAccess access, PropertyItemPermission permission)
    {
        FieldInfo field = this._Ref.GetType().GetField(name);

        if (field == (FieldInfo)null)
        {
            throw new PropertyNotExistException("The property \"" + name + "\" does not exist in " + this.GetType().Name);
        }
        this.VerifyAccess(field, access);
        this.VerifyPermission(field, permission);
        this.SetValue(field, (object)this._Ref, value);
    }
Example #6
0
 public void SetPrivateProperty(string name, object value, PropertyItemAccess access, PropertyItemPermission permission)
 {
     try
     {
         this.Lock.AcquireWriterLock(-1);
         if (this._deleted)
         {
             return;
         }
         this.InvokePreSetProperty(name, ref value);
         this.Data[name] = new PropertyItem(name, value, access, permission);
         this.Save();
     }
     finally
     {
         this.Lock.ReleaseWriterLock();
     }
 }
Example #7
0
 public void SetPrivateProperty(string name, object value, PropertyItemAccess access)
 {
     this.SetPrivateProperty(name, value, access, PropertyItemPermission.READWRITE);
 }