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 VerifyPermission(FieldInfo fi, PropertyItemPermission p)
 {
     if (this.GetPermission(fi) != p)
     {
         throw new ApplicationException("Item " + fi.Name + " is not a " + (object)p + " property");
     }
 }
Example #5
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();
     }
 }
    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);
    }