Quantcast
Channel: CSLA .NET
Viewing all articles
Browse latest Browse all 764

Problematically set property to be readonly in BusinessBase class

$
0
0

I have a property created like this in a BusinessBase class:

    private static PropertyInfo<string> ABCProperty = RegisterProperty(typeof(ObjectA), new PropertyInfo<string>("ABC"));

    public string ABC
    {
      get { return GetProperty(ABCProperty); }
      internal set { SetProperty(ABCProperty, value); } 
    }

The above makes the property to be read-only in a form (cannot be changed by a user).

Is it possible, based on some global setting's value that I'd like to define in my application, to make this property writable?  With other words, ABCProperty's value  could be changed by a user, if setting's variable is True, otherwise this property should remain read-only.  If it is not possible, what would be other alternative way to achieve this?

Thank you kindly,

Tanja.

 


Viewing all articles
Browse latest Browse all 764

Trending Articles