CSLA .NET 10.0.0
A home for your business logic
Loading...
Searching...
No Matches
Csla.Rules.BrokenRulesCollection Class Reference

A collection of currently broken rules. More...

Inheritance diagram for Csla.Rules.BrokenRulesCollection:
Csla.Core.ReadOnlyObservableBindingList< C > Csla.Core.ObservableBindingList< T > Csla.Core.MobileObservableCollection< T > Csla.Core.IObservableBindingList Csla.Core.INotifyBusy Csla.Core.INotifyChildChanged Csla.Serialization.Mobile.ISerializationNotification Csla.Serialization.Mobile.IMobileList Csla.Serialization.Mobile.IMobileObjectMetastate Csla.Core.INotifyUnhandledAsyncException Csla.Serialization.Mobile.IMobileObject

Public Member Functions

 BrokenRulesCollection ()
 Creates a read-write instance of the collection.
BrokenRuleGetFirstBrokenRule (Core.IPropertyInfo property)
 Returns the first BrokenRule object corresponding to the specified property.
BrokenRuleGetFirstBrokenRule (string property)
 Returns the first BrokenRule object corresponding to the specified property.
BrokenRuleGetFirstMessage (Core.IPropertyInfo property)
 Returns the first BrokenRule object corresponding to the specified property.
BrokenRuleGetFirstMessage (Core.IPropertyInfo property, RuleSeverity severity)
 Returns the first BrokenRule object corresponding to the specified property and severity.
BrokenRuleGetFirstMessage (string property, RuleSeverity severity)
 Returns the first BrokenRule object corresponding to the specified property and severity.
override string ToString ()
 Returns the text of all broken rule descriptions, each separated by a Environment.NewLine.
string ToString (RuleSeverity severity)
 Returns the text of all broken rule descriptions for a specific severity, each separated by a Environment.NewLine.
string ToString (string separator)
 Returns the text of all broken rule descriptions.
string ToString (string separator, RuleSeverity severity)
 Returns the text of all broken rule descriptions for a specific severity.
string ToString (string separator, RuleSeverity severity, string propertyName)
 Returns the text of all broken rule descriptions for a specific severity and property.
string[] ToArray ()
 Returns a string array containing all broken rule descriptions.
string[] ToArray (RuleSeverity severity)
 Returns a string array containing all broken rule descriptions.
void AddRange (List< BrokenRule > list)
 Merges a list of items into the collection.
Public Member Functions inherited from Csla.Core.ReadOnlyObservableBindingList< C >
 ReadOnlyObservableBindingList ()
 Creates an instance of the type.
Public Member Functions inherited from Csla.Core.ObservableBindingList< T >
AddNew ()
 Adds a new item to this collection.
async Task< T > AddNewAsync ()
 Adds a new item to this collection.
void AddRange (IEnumerable< T > range)
 Add a range of items to the list.
Task WaitForIdle (TimeSpan timeout)
 Await this method to ensure business object is not busy.
virtual Task WaitForIdle (CancellationToken ct)
 Await this method to ensure the business object is not busy.
virtual void OnAddedNew (T item)
 Raises the AddedNew event.
 SuppressListChangedEventsClass (ObservableBindingList< TC > businessObject)
void Dispose ()
Public Member Functions inherited from Csla.Core.MobileObservableCollection< T >
 LoadListModeObject (IMobileList target)
 Create instance of type.
void Dispose ()
 Disposes the object.

Protected Member Functions

override void OnGetState (SerializationInfo info)
 Override this method to insert your field values into the MobileFormatter serialization stream.
override void OnSetState (SerializationInfo info)
 Override this method to retrieve your field values from the MobileFormatter serialization stream.
Protected Member Functions inherited from Csla.Core.ReadOnlyObservableBindingList< C >
override void OnCollectionChanged (NotifyCollectionChangedEventArgs e)
 Method invoked when collection is changed.
override void SetLoadListMode (bool enabled)
 Sets the LoadListMode for the collection.
override void OnGetState (Serialization.Mobile.SerializationInfo info)
 Override this method to insert your field values into the MobileFormatter serialization stream.
override void OnSetState (Serialization.Mobile.SerializationInfo info)
 Override this method to retrieve your field values from the MobileFormatter serialization stream.
override void OnGetMetastate (BinaryWriter writer)
 Override this method to write field values directly to a binary stream for metastate serialization.
Parameters
writerBinary writer for the output stream.

override void OnSetMetastate (BinaryReader reader)
 Override this method to read field values directly from a binary stream for metastate deserialization.
Parameters
readerBinary reader for the input stream.

override void OnSetChildren (Serialization.Mobile.SerializationInfo info, Serialization.Mobile.MobileFormatter formatter)
 Override this method to retrieve your child object references from the MobileFormatter serialization stream.
Protected Member Functions inherited from Csla.Core.ObservableBindingList< T >
void OnRemovingItem (T removedItem)
 Raise the RemovingItem event.
override void RemoveItem (int index)
 Remove the item at the specified index.
virtual void OnBusyChanged (BusyChangedEventArgs args)
 Override this method to be notified when the IsBusy property has changed.
void OnBusyChanged (string propertyName, bool busy)
 Raises the BusyChanged event for a specific property.
virtual void OnUnhandledAsyncException (ErrorEventArgs error)
 Method invoked when an unhandled async exception has occurred.
void OnUnhandledAsyncException (object originalSender, Exception error)
 Raises the UnhandledAsyncException event.
override void InsertItem (int index, T item)
 Invoked when an item is inserted into the list.
virtual void OnAddEventHooks (T item)
 Method invoked when events are hooked for a child object.
virtual void OnRemoveEventHooks (T item)
 Method invoked when events are unhooked for a child object.
virtual void Deserialized ()
 Invoked after the object has been deserialized to allow derived classes to perform custom post-deserialization processing.
virtual void OnChildChanged (ChildChangedEventArgs e)
 Raises the ChildChanged event, indicating that a child object has been changed.
virtual void Child_PropertyChanged (object? sender, PropertyChangedEventArgs e)
 Handles any PropertyChanged event from a child object and echoes it up as a ChildChanged event.
virtual T AddNewCore ()
 Override this method to create a new object that is added to the collection.
virtual async Task< T > AddNewCoreAsync ()
 Override this method to create a new object that is added to the collection.
override void OnCollectionChanged (NotifyCollectionChangedEventArgs e)
 Raises the CollectionChanged event.
override void OnGetState (SerializationInfo info)
 Override this method to get custom field values from the serialization stream.
override void OnSetState (SerializationInfo info)
 Override this method to set custom field values into the serialization stream.
Protected Member Functions inherited from Csla.Core.MobileObservableCollection< T >
virtual void OnGetChildren (SerializationInfo info, MobileFormatter formatter)
 Override this method to get custom child object values from the serialization stream.
virtual void OnSetChildren (SerializationInfo info, MobileFormatter formatter)
 Override this method to set custom child object values into the serialization stream.

Properties

int ErrorCount [get]
 Gets the number of broken rules in the collection that have a severity of Error.
int WarningCount [get]
 Gets the number of broken rules in the collection that have a severity of Warning.
int InformationCount [get]
 Gets the number of broken rules in the collection that have a severity of Information.
Properties inherited from Csla.Core.ReadOnlyObservableBindingList< C >
bool IsReadOnly [get, protected set]
 Gets or sets a value indicating whether the list is readonly.
Properties inherited from Csla.Core.ObservableBindingList< T >
virtual bool SupportsChangeNotificationCore [get]
 Gets a value indicating whether this object supports change notification.
bool AllowEdit [get, protected set]
 Gets or sets a value indicating whether data binding can automatically edit items in this collection.
bool AllowNew [get, protected set]
 Gets or sets a value indicating whether data binding can automatically add new items to this collection.
bool AllowRemove [get, protected set]
 Gets or sets a value indicating whether data binding can automatically remove items from this collection.
bool RaiseListChangedEvents [get, set]
 Gets or sets a value indicating whether the collection should raise changed events.
virtual bool IsBusy [get]
 Gets the busy status for this object and its child objects.
virtual bool IsSelfBusy [get]
 Gets the busy status for this object.
IDisposable SuppressListChangedEvents [get]
 Use this object to suppress ListChangedEvents for an entire code block. May be nested in multiple levels for the same object.
Properties inherited from Csla.Core.MobileObservableCollection< T >
LoadListModeObject LoadListMode [get]
 By wrapping this property inside Using block you can set property values on current business object without raising PropertyChanged events and checking user rights.

Additional Inherited Members

Events inherited from Csla.Core.ObservableBindingList< T >
EventHandler< RemovingItemEventArgs >? RemovingItem [add, remove]
 Implements a serialization-safe RemovingItem event.
BusyChangedEventHandlerBusyChanged [add, remove]
 Event indicating that the busy status of the object has changed.
EventHandler< ErrorEventArgs >? UnhandledAsyncException [add, remove]
 Event indicating that an exception occurred during an async operation.
EventHandler< ChildChangedEventArgs >? ChildChanged [add, remove]
 Event raised when a child object has been changed.
EventHandler< AddedNewEventArgs< T > >? AddedNew [add, remove]
 Event raised when a new object has been added to the collection.
Events inherited from Csla.Core.IObservableBindingList
EventHandler< RemovingItemEventArgs >? RemovingItem
 Event indicating that an item is being removed from the list.
Events inherited from Csla.Core.INotifyBusy
BusyChangedEventHandlerBusyChanged
 Event raised when the object's busy status changes.
Events inherited from Csla.Core.INotifyUnhandledAsyncException
EventHandler< ErrorEventArgs >? UnhandledAsyncException
 Event indicating that an exception occurred during an asynchronous operation.
Events inherited from Csla.Core.INotifyChildChanged
EventHandler< ChildChangedEventArgs >? ChildChanged
 Event indictating that a child object has changed.

Detailed Description

A collection of currently broken rules.

This collection is readonly and can be safely made available to code outside the business object such as the UI. This allows external code, such as a UI, to display the list of broken rules to the user.

Constructor & Destructor Documentation

◆ BrokenRulesCollection()

Csla.Rules.BrokenRulesCollection.BrokenRulesCollection ( )
inline

Creates a read-write instance of the collection.

Member Function Documentation

◆ AddRange()

void Csla.Rules.BrokenRulesCollection.AddRange ( List< BrokenRule > list)
inline

Merges a list of items into the collection.

Parameters
listList of items to add.
Exceptions
ArgumentNullExceptionlist is null.

◆ GetFirstBrokenRule() [1/2]

BrokenRule? Csla.Rules.BrokenRulesCollection.GetFirstBrokenRule ( Core.IPropertyInfo property)
inline

Returns the first BrokenRule object corresponding to the specified property.

Code in a business object or UI can also use this value to retrieve the first broken rule in BrokenRulesCollection that corresponds to a specfic property on the object.

Parameters
propertyThe property affected by the rule.
Returns
The first BrokenRule object corresponding to the specified property, or null if there are no rules defined for the property.
Exceptions
ArgumentNullExceptionproperty is null.

◆ GetFirstBrokenRule() [2/2]

BrokenRule? Csla.Rules.BrokenRulesCollection.GetFirstBrokenRule ( string property)
inline

Returns the first BrokenRule object corresponding to the specified property.

Code in a business object or UI can also use this value to retrieve the first broken rule in BrokenRulesCollection that corresponds to a specfic property on the object.

Parameters
propertyThe name of the property affected by the rule.
Returns
The first BrokenRule object corresponding to the specified property, or null if there are no rules defined for the property.
Exceptions
ArgumentExceptionproperty is null, string.Empty or only consists of white spaces.

◆ GetFirstMessage() [1/3]

BrokenRule? Csla.Rules.BrokenRulesCollection.GetFirstMessage ( Core.IPropertyInfo property)
inline

Returns the first BrokenRule object corresponding to the specified property.

Code in a business object or UI can also use this value to retrieve the first broken rule in BrokenRulesCollection that corresponds to a specfic property.

Parameters
propertyThe name of the property affected by the rule.
Returns
The first BrokenRule object corresponding to the specified property, or Nothing (null in C#) if there are no rules defined for the property.
Exceptions
ArgumentNullExceptionproperty is null.

◆ GetFirstMessage() [2/3]

BrokenRule? Csla.Rules.BrokenRulesCollection.GetFirstMessage ( Core.IPropertyInfo property,
RuleSeverity severity )
inline

Returns the first BrokenRule object corresponding to the specified property and severity.

Parameters
propertyThe property affected by the rule.
severityThe severity of broken rule to return.
Returns
The first BrokenRule object corresponding to the specified property, or Nothing (null in C#) if there are no rules defined for the property.
Exceptions
ArgumentNullExceptionproperty is null.

◆ GetFirstMessage() [3/3]

BrokenRule? Csla.Rules.BrokenRulesCollection.GetFirstMessage ( string property,
RuleSeverity severity )
inline

Returns the first BrokenRule object corresponding to the specified property and severity.

Parameters
propertyThe name of the property affected by the rule.
severityThe severity of broken rule to return.
Returns
The first BrokenRule object corresponding to the specified property, or Nothing (null in C#) if there are no rules defined for the property.
Exceptions
ArgumentExceptionproperty is null, string.Empty or only consists of white spaces.

◆ OnGetState()

override void Csla.Rules.BrokenRulesCollection.OnGetState ( SerializationInfo info)
inlineprotectedvirtual

Override this method to insert your field values into the MobileFormatter serialization stream.

Parameters
infoObject containing the data to serialize.

Reimplemented from Csla.Core.MobileObservableCollection< T >.

◆ OnSetState()

override void Csla.Rules.BrokenRulesCollection.OnSetState ( SerializationInfo info)
inlineprotectedvirtual

Override this method to retrieve your field values from the MobileFormatter serialization stream.

Parameters
infoObject containing the data to serialize.

Reimplemented from Csla.Core.MobileObservableCollection< T >.

◆ ToArray() [1/2]

string[] Csla.Rules.BrokenRulesCollection.ToArray ( )
inline

Returns a string array containing all broken rule descriptions.

Returns
The text of all broken rule descriptions matching the specified severtiy.

◆ ToArray() [2/2]

string[] Csla.Rules.BrokenRulesCollection.ToArray ( RuleSeverity severity)
inline

Returns a string array containing all broken rule descriptions.

Parameters
severityThe severity of rules to include in the result.
Returns
The text of all broken rule descriptions matching the specified severtiy.

◆ ToString() [1/5]

override string Csla.Rules.BrokenRulesCollection.ToString ( )
inline

Returns the text of all broken rule descriptions, each separated by a Environment.NewLine.

Returns
The text of all broken rule descriptions.

◆ ToString() [2/5]

string Csla.Rules.BrokenRulesCollection.ToString ( RuleSeverity severity)
inline

Returns the text of all broken rule descriptions for a specific severity, each separated by a Environment.NewLine.

Parameters
severityThe severity of rules to include in the result.
Returns
The text of all broken rule descriptions matching the specified severtiy.

◆ ToString() [3/5]

string Csla.Rules.BrokenRulesCollection.ToString ( string separator)
inline

Returns the text of all broken rule descriptions.

Parameters
separatorString to place between each broken rule description.
Returns
The text of all broken rule descriptions.
Exceptions
ArgumentNullExceptionseparator is null.

◆ ToString() [4/5]

string Csla.Rules.BrokenRulesCollection.ToString ( string separator,
RuleSeverity severity )
inline

Returns the text of all broken rule descriptions for a specific severity.

Parameters
separatorString to place between each broken rule description.
severityThe severity of rules to include in the result.
Returns
The text of all broken rule descriptions matching the specified severtiy.
Exceptions
ArgumentNullExceptionseparator is null.

◆ ToString() [5/5]

string Csla.Rules.BrokenRulesCollection.ToString ( string separator,
RuleSeverity severity,
string propertyName )
inline

Returns the text of all broken rule descriptions for a specific severity and property.

Parameters
separatorString to place between each broken rule description.
severityThe severity of rules to include in the result.
propertyNameProperty name
Returns
The text of all broken rule descriptions matching the specified severtiy.
Exceptions
ArgumentNullExceptionseparator is null.
ArgumentExceptionpropertyName is null, string.Empty or only consists of white spaces.

Property Documentation

◆ ErrorCount

int Csla.Rules.BrokenRulesCollection.ErrorCount
get

Gets the number of broken rules in the collection that have a severity of Error.

An integer value.

◆ InformationCount

int Csla.Rules.BrokenRulesCollection.InformationCount
get

Gets the number of broken rules in the collection that have a severity of Information.

An integer value.

◆ WarningCount

int Csla.Rules.BrokenRulesCollection.WarningCount
get

Gets the number of broken rules in the collection that have a severity of Warning.

An integer value.


The documentation for this class was generated from the following file: