I've been subclassing BusinessBase and BusinessListBase so I can build my business object libraries from the subclasses per Rocky's recommendation. It should reduce the amount of maintenance to make use of new CSLA versions plus allow me to customize things to meet my own needs.
I've made the list of broken rules publically available so that I can bind them to the UI control. That way, it automagically contains all the things wrong with that object (or not).
I'm now trying to make the list of actual rules (whether broken or not) publically available so that users, QA testers, documentation writers, (and so on) can see them. By binding the property to a UI control I can provide an inexpensive way to help the application system be self-documenting.
I'm having a big of a problem with this last task. The classes/interfaces that appear to contain the information I need are defined as internal. (RulesList, RuleMethod and IRuleMethod)
If I understand things correctly, the only way to access this internal information is to put my subclasses into the same project as CSLA. I had originally intended for my subclasses to be in their own project to cut down on maintenance for new CSLA sub-releases. Anyone know of a better way to make this work?
One word... REFLECTION
With reflection you can even change the value of a private variable, so I don't think the internal modifier will be much of an issue.
guyroch:One word... REFLECTION
With reflection you can even change the value of a private variable, so I don't think the internal modifier will be much of an issue.
I hadn't understood that you could mess with internal or private variables via reflection.
Interesting :)
and Scary :{ !!
Seems like that might enable people to hack their way into data they shouldn't be allowed to see...
david.wendelken:and Scary :{ !!
Very scary... ummmm... this thread will self destruct in 5 seconds :-o
In Csla 2.1 Rocky added support for getting a list of rules that apply to a Type.
''' <summary> ''' Returns an array containing the text descriptions of all ''' validation rules associated with this object. ''' </summary> ''' <returns>String array.</returns> ''' <remarks></remarks> Public Function GetRuleDescriptions() As String() Dim result As New List(Of String) Dim rules As ValidationRulesManager = RulesToCheck For Each de As Generic.KeyValuePair(Of String, RulesList) In rules.RulesDictionary For Each rule As IRuleMethod In de.Value.GetList(False)result.Add(
CObj(rule).ToString) Next Next Return result.ToArray End FunctionJoe
JoeFallon1:In Csla 2.1 Rocky added support for getting a list of rules that apply to a Type.
''' <summary>
''' Returns an array containing the text descriptions of all
''' validation rules associated with this object.
''' </summary>
''' <returns>String array.</returns>
''' <remarks></remarks>
Public Function GetRuleDescriptions() As String()
I've been looking like crazy for that capability. Thanks!
Copyright (c) Marimer LLC