CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla.Core.BusinessBase Class Reference

This is the non-generic base class from which most business objects will be derived. More...

Inheritance diagram for Csla.Core.BusinessBase:
Csla.Serialization.Mobile.ISerializationNotification Csla.Core.INotifyChildChanged Csla.Core.INotifyBusy Csla.Core.ICheckRules Csla.Rules.IHostRules Csla.Core.IParent Csla.Security.IAuthorizeReadWrite Csla.Core.IEditableBusinessObject Csla.Core.UndoableBase Csla.BusinessBase< T > Csla.Validation.BusinessBase< T >

Classes

class  BypassPropertyChecksObject
 Class that allows setting of property values on current business object without raising PropertyChanged events and checking user rights.
 

Public Member Functions

virtual bool CanReadProperty (Csla.Core.IPropertyInfo property)
 Returns true if the user is allowed to read the calling property. More...
 
bool CanReadProperty (Csla.Core.IPropertyInfo property, bool throwOnFalse)
 Returns true if the user is allowed to read the calling property. More...
 
bool CanReadProperty (string propertyName)
 Returns true if the user is allowed to read the specified property. More...
 
virtual bool CanWriteProperty (Csla.Core.IPropertyInfo property)
 Returns true if the user is allowed to write the specified property. More...
 
bool CanWriteProperty (Csla.Core.IPropertyInfo property, bool throwOnFalse)
 Returns true if the user is allowed to write the calling property. More...
 
bool CanWriteProperty (string propertyName)
 Returns true if the user is allowed to write the specified property. More...
 
virtual bool CanExecuteMethod (Csla.Core.IMemberInfo method)
 Returns true if the user is allowed to execute the specified method. More...
 
bool CanExecuteMethod (Csla.Core.IMemberInfo method, bool throwOnFalse)
 Returns true if the user is allowed to execute the specified method. More...
 
virtual bool CanExecuteMethod (string methodName)
 Returns true if the user is allowed to execute the specified method. More...
 
void BeginEdit ()
 Starts a nested edit on the object. More...
 
void CancelEdit ()
 Cancels the current edit process, restoring the object's state to its previous values. More...
 
void ApplyEdit ()
 Commits the current edit process. More...
 
virtual void Delete ()
 Marks the object for deletion. More...
 
virtual bool IsPropertyBusy (Csla.Core.IPropertyInfo property)
 Gets a value indicating whether a specific property is busy (has a currently executing async rule). More...
 
bool IsPropertyBusy (string propertyName)
 Gets a value indicating whether a specific property is busy (has a currently executing async rule). More...
 
BrokenRulesCollection GetBrokenRules ()
 Gets the broken rules for this object More...
 
- Public Member Functions inherited from Csla.Security.IAuthorizeReadWrite
bool CanWriteProperty (Csla.Core.IPropertyInfo property)
 Returns true if the user is allowed to write the to the specified property. More...
 
bool CanReadProperty (Csla.Core.IPropertyInfo property)
 Returns true if the user is allowed to read the specified property. More...
 
bool CanExecuteMethod (Csla.Core.IMemberInfo method)
 Returns true if the user is allowed to execute the specified method. More...
 
- Public Member Functions inherited from Csla.Core.IParent
void RemoveChild (Core.IEditableBusinessObject child)
 This method is called by a child object when it wants to be removed from the collection. More...
 

Protected Member Functions

 BusinessBase ()
 Creates an instance of the object. More...
 
virtual void Initialize ()
 Override this method to set up event handlers so user code in a partial class can respond to events raised by generated code. More...
 
virtual void SetParent (Core.IParent parent)
 Used by BusinessListBase as a child object is created to tell the child object about its parent. More...
 
virtual void MarkNew ()
 Marks the object as being a new object. More...
 
virtual void MarkOld ()
 Marks the object as being an old (not new) object. More...
 
void MarkDeleted ()
 Marks an object for deletion. More...
 
void MarkDirty ()
 Marks an object as being dirty, or changed. More...
 
void MarkDirty (bool suppressEvent)
 Marks an object as being dirty, or changed. More...
 
virtual void PropertyHasChanged (Csla.Core.IPropertyInfo property)
 Performs processing required when a property has changed. More...
 
virtual void MetaPropertyHasChanged (string name)
 Raises OnPropertyChanged for meta properties (IsXYZ) when PropertyChangedMode is not Windows More...
 
virtual void CheckPropertyRules (IPropertyInfo property)
 Check rules for the property and notifies UI of properties that may have changed. More...
 
virtual void CheckObjectRules ()
 Check object rules and notifies UI of properties that may have changed. More...
 
void MarkClean ()
 Forces the object's IsDirty flag to false. More...
 
override void UndoChangesComplete ()
 Called when an undo operation has completed. More...
 
override void AcceptChangesComplete ()
 Notifies the parent object (if any) that this child object's edits have been accepted. More...
 
void MarkAsChild ()
 Marks the object as being a child object. More...
 
virtual object GetClone ()
 Creates a clone of the object. More...
 
virtual void OnValidationComplete ()
 Raises the ValidationComplete event More...
 
BusinessRuleManager GetRegisteredRules ()
 Gets the registered rules. More...
 
virtual void AddBusinessRules ()
 Override this method in your business class to be notified when you need to set up shared business rules. More...
 
virtual void DataPortal_OnDataPortalInvoke (DataPortalEventArgs e)
 Called by the server-side DataPortal prior to calling the requested DataPortal_XYZ method. More...
 
virtual void DataPortal_OnDataPortalInvokeComplete (DataPortalEventArgs e)
 Called by the server-side DataPortal after calling the requested DataPortal_XYZ method. More...
 
virtual void DataPortal_OnDataPortalException (DataPortalEventArgs e, Exception ex)
 Called by the server-side DataPortal if an exception occurs during data access. More...
 
virtual void Child_Create ()
 Override this method to load a new business object with default values from the database. More...
 
virtual void Child_OnDataPortalInvoke (DataPortalEventArgs e)
 Called by the server-side DataPortal prior to calling the requested DataPortal_XYZ method. More...
 
virtual void Child_OnDataPortalInvokeComplete (DataPortalEventArgs e)
 Called by the server-side DataPortal after calling the requested DataPortal_XYZ method. More...
 
virtual void Child_OnDataPortalException (DataPortalEventArgs e, Exception ex)
 Called by the server-side DataPortal if an exception occurs during data access. More...
 
virtual void OnDeserialized (System.Runtime.Serialization.StreamingContext context)
 This method is called on a newly deserialized object after deserialization is complete. More...
 
void AddEventHooks (IBusinessObject child)
 For internal use. More...
 
virtual void OnAddEventHooks (IBusinessObject child)
 Hook child object events. More...
 
void RemoveEventHooks (IBusinessObject child)
 For internal use only. More...
 
virtual void OnRemoveEventHooks (IBusinessObject child)
 Unhook child object events. More...
 
GetProperty< P > (string propertyName, P field, P defaultValue)
 Gets a property's value, first checking authorization. More...
 
GetProperty< P > (string propertyName, P field, P defaultValue, Security.NoAccessBehavior noAccess)
 Gets a property's value, first checking authorization. More...
 
GetProperty< P > (PropertyInfo< P > propertyInfo, P field)
 Gets a property's value, first checking authorization. More...
 
GetProperty< P > (PropertyInfo< P > propertyInfo, P field, P defaultValue, Security.NoAccessBehavior noAccess)
 Gets a property's value, first checking authorization. More...
 
GetPropertyConvert< F, P > (PropertyInfo< F > propertyInfo, F field)
 Gets a property's value as a specified type, first checking authorization. More...
 
GetPropertyConvert< F, P > (PropertyInfo< F > propertyInfo, F field, Security.NoAccessBehavior noAccess)
 Gets a property's value as a specified type, first checking authorization. More...
 
GetProperty< P > (PropertyInfo< P > propertyInfo)
 Gets a property's managed field value, first checking authorization. More...
 
GetPropertyConvert< F, P > (PropertyInfo< F > propertyInfo)
 Gets a property's value from the list of managed field values, first checking authorization, and converting the value to an appropriate type. More...
 
GetPropertyConvert< F, P > (PropertyInfo< F > propertyInfo, Security.NoAccessBehavior noAccess)
 Gets a property's value from the list of managed field values, first checking authorization, and converting the value to an appropriate type. More...
 
GetProperty< P > (PropertyInfo< P > propertyInfo, Security.NoAccessBehavior noAccess)
 Gets a property's value as a specified type, first checking authorization. More...
 
object GetProperty (IPropertyInfo propertyInfo)
 Gets a property's value as a specified type. More...
 
GetProperty< P > (IPropertyInfo propertyInfo)
 Gets a property's managed field value, first checking authorization. More...
 
LazyGetProperty< P > (PropertyInfo< P > property, Func< P > valueGenerator)
 Lazily initializes a property and returns the resulting value. More...
 
LazyGetPropertyAsync< P > (PropertyInfo< P > property, Task< P > factory)
 Lazily initializes a property and returns the resulting value. More...
 
ReadPropertyConvert< F, P > (PropertyInfo< F > propertyInfo)
 Gets a property's value from the list of managed field values, converting the value to an appropriate type. More...
 
ReadProperty< P > (PropertyInfo< P > propertyInfo)
 Gets a property's value as a specified type. More...
 
virtual object ReadProperty (IPropertyInfo propertyInfo)
 Gets a property's value. More...
 
LazyReadProperty< P > (PropertyInfo< P > property, Func< P > valueGenerator)
 Gets a property's value as a specified type. More...
 
LazyReadPropertyAsync< P > (PropertyInfo< P > property, Task< P > factory)
 Gets a property's value as a specified type. More...
 
void SetProperty< P > (PropertyInfo< P > propertyInfo, ref P field, P newValue)
 Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change. More...
 
void SetProperty< P > (string propertyName, ref P field, P newValue)
 Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change. More...
 
void SetPropertyConvert< P, V > (PropertyInfo< P > propertyInfo, ref P field, V newValue)
 Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change. More...
 
void SetPropertyConvert< P, V > (PropertyInfo< P > propertyInfo, ref P field, V newValue, Security.NoAccessBehavior noAccess)
 Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change. More...
 
void SetProperty< P > (string propertyName, ref P field, P newValue, Security.NoAccessBehavior noAccess)
 Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change. More...
 
void SetPropertyConvert< P, V > (string propertyName, ref P field, V newValue, Security.NoAccessBehavior noAccess)
 Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change. More...
 
void SetProperty< P > (PropertyInfo< P > propertyInfo, P newValue)
 Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change. More...
 
void SetPropertyConvert< P, F > (PropertyInfo< P > propertyInfo, F newValue)
 Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change. More...
 
void SetPropertyConvert< P, F > (PropertyInfo< P > propertyInfo, F newValue, Security.NoAccessBehavior noAccess)
 Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change. More...
 
void SetProperty< P > (PropertyInfo< P > propertyInfo, P newValue, Security.NoAccessBehavior noAccess)
 Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change. More...
 
void SetProperty (IPropertyInfo propertyInfo, object newValue)
 Sets a property's managed field with the supplied value, and then calls PropertyHasChanged if the value does change. More...
 
void SetProperty< P > (IPropertyInfo propertyInfo, P newValue)
 Sets a property's managed field with the supplied value, and then calls PropertyHasChanged if the value does change. More...
 
void LoadPropertyConvert< P, F > (PropertyInfo< P > propertyInfo, F newValue)
 Loads a property's managed field with the supplied value. More...
 
void LoadProperty< P > (PropertyInfo< P > propertyInfo, P newValue)
 Loads a property's managed field with the supplied value. More...
 
bool LoadPropertyMarkDirty< P > (PropertyInfo< P > propertyInfo, P newValue)
 Loads a property's managed field with the supplied value and mark field as dirty if value is modified. More...
 
virtual bool LoadPropertyMarkDirty (IPropertyInfo propertyInfo, object newValue)
 Loads a property's managed field with the supplied value. More...
 
virtual void LoadProperty (IPropertyInfo propertyInfo, object newValue)
 Loads a property's managed field with the supplied value. More...
 
void LoadPropertyAsync< R > (PropertyInfo< R > property, Task< R > factory)
 Load a property from an async method. More...
 
void MarkBusy ()
 Mark the object as busy (it is running an async operation). More...
 
void MarkIdle ()
 Mark the object as not busy (it is not running an async operation). More...
 
virtual void OnBusyChanged (BusyChangedEventArgs args)
 Raise the BusyChanged event. More...
 
virtual void OnUnhandledAsyncException (ErrorEventArgs error)
 Raises the UnhandledAsyncException event. More...
 
void OnUnhandledAsyncException (object originalSender, Exception error)
 Raises the UnhandledAsyncException event. More...
 
virtual void OnChildChanged (ChildChangedEventArgs e)
 Raises the ChildChanged event, indicating that a child object has been changed. More...
 
virtual void EditChildComplete (Core.IEditableBusinessObject child)
 Override this method to be notified when a child object's Core.BusinessBase.ApplyEdit method has completed. More...
 
override void OnGetState (Csla.Serialization.Mobile.SerializationInfo info, StateMode mode)
 Override this method to insert your field values into the MobileFormatter serialzation stream. More...
 
override void OnSetState (Csla.Serialization.Mobile.SerializationInfo info, StateMode mode)
 Override this method to retrieve your field values from the MobileFormatter serialzation stream. More...
 
override void OnGetChildren (Csla.Serialization.Mobile.SerializationInfo info, Csla.Serialization.Mobile.MobileFormatter formatter)
 Override this method to insert your child object references into the MobileFormatter serialzation stream. More...
 
override void OnSetChildren (Csla.Serialization.Mobile.SerializationInfo info, Csla.Serialization.Mobile.MobileFormatter formatter)
 Override this method to retrieve your child object references from the MobileFormatter serialzation stream. More...
 
- Protected Member Functions inherited from Csla.Core.UndoableBase
 UndoableBase ()
 Creates an instance of the object. More...
 
virtual void CopyingState ()
 This method is invoked before the CopyState operation begins. More...
 
virtual void CopyStateComplete ()
 This method is invoked after the CopyState operation is complete. More...
 
virtual void UndoingChanges ()
 This method is invoked after the UndoChanges operation is complete. More...
 
virtual void AcceptingChanges ()
 This method is invoked before the AcceptChanges operation begins. More...
 
override void OnGetState (SerializationInfo info, StateMode mode)
 Override this method to insert your field values into the MobileFormatter serialzation stream. More...
 
override void OnSetState (SerializationInfo info, StateMode mode)
 Override this method to retrieve your field values from the MobileFormatter serialzation stream. More...
 
- Protected Member Functions inherited from Csla.Core.BindableBase
 BindableBase ()
 Creates an instance of the object. More...
 
virtual bool ShouldHandlerSerialize (PropertyChangedEventHandler value)
 Override this method to change the default logic for determining if the event handler should be serialized More...
 
virtual void OnPropertyChanged (string propertyName)
 Call this method to raise the PropertyChanged event for a specific property. More...
 
virtual void OnMetaPropertyChanged (string propertyName)
 
virtual void OnPropertyChanged (IPropertyInfo propertyInfo)
 Call this method to raise the PropertyChanged event for a specific property. More...
 
virtual void OnIsDirtyChanged ()
 Call this method to raise the PropertyChanged event for all object properties. More...
 
virtual void OnUnknownPropertyChanged ()
 Call this method to raise the PropertyChanged event for all object properties. More...
 
virtual void OnIsDirtyChanging ()
 Call this method to raise the PropertyChanging event for all object properties. More...
 
virtual void OnUnknownPropertyChanging ()
 Call this method to raise the PropertyChanging event for all object properties. More...
 
virtual void OnPropertyChanging (string propertyName)
 Call this method to raise the PropertyChanging event for a specific property. More...
 
virtual void OnPropertyChanging (IPropertyInfo propertyInfo)
 Call this method to raise the PropertyChanging event for a specific property. More...
 
virtual bool ShouldHandlerSerialize (PropertyChangingEventHandler value)
 Override this method to change the default logic for determining if the event handler should be serialized More...
 
- Protected Member Functions inherited from Csla.Core.MobileObject
virtual void OnGetChildren (SerializationInfo info, MobileFormatter formatter)
 Override this method to insert your child object references into the MobileFormatter serialzation stream. More...
 
virtual void OnSetChildren (SerializationInfo info, MobileFormatter formatter)
 Override this method to retrieve your child object references from the MobileFormatter serialzation stream. More...
 

Static Protected Member Functions

static Csla.Core.IMemberInfo RegisterMethod (Type objectType, IMemberInfo info)
 Indicates that the specified method belongs to the type. More...
 
static MethodInfo RegisterMethod (Type objectType, string methodName)
 Indicates that the specified method belongs to the type. More...
 
static PropertyInfo< P > RegisterProperty< P > (Type objectType, PropertyInfo< P > info)
 Indicates that the specified property belongs to the type. More...
 

Properties

Core.IParent Parent [get]
 Provide access to the parent reference for use in child object code. More...
 
bool IsNew [get]
 Returns true if this is a new object, false if it is a pre-existing object. More...
 
bool IsDeleted [get]
 Returns true if this object is marked for deletion. More...
 
virtual bool IsDirty [get]
 Returns true if this object's data, or any of its fields or child objects data, has been changed. More...
 
virtual bool IsSelfDirty [get]
 Returns true if this object's data has been changed. More...
 
virtual bool IsSavable [get]
 Returns true if this object is both dirty and valid. More...
 
bool DisableIEditableObject [getset]
 Gets or sets a value indicating whether the IEditableObject interface methods should be disabled for this object. More...
 
bool IsChild [get]
 Returns true if this is a child (non-root) object. More...
 
EventHandler ValidationComplete
 Event raised when validation is complete. More...
 
BusinessRules BusinessRules [get]
 Provides access to the broken rules functionality. More...
 
virtual bool IsValid [get]
 Returns true if the object and its child objects are currently valid, false if the object or any of its child objects have broken rules or are otherwise invalid. More...
 
virtual bool IsSelfValid [get]
 Returns true if the object is currently valid, false if the object has broken rules or is otherwise invalid. More...
 
virtual Rules.BrokenRulesCollection BrokenRulesCollection [get]
 Provides access to the readonly collection of broken business rules for this object. More...
 
virtual bool IsBusy [get]
 Gets a value indicating if this object or its child objects are busy. More...
 
virtual bool IsSelfBusy [get]
 Gets a value indicating if this object is busy. More...
 
BusyChangedEventHandler BusyChanged
 Event indicating that the IsBusy property has changed. More...
 
EventHandler< ErrorEventArgsUnhandledAsyncException
 Event indicating that an exception occurred during the processing of an async operation. More...
 
EventHandler< Csla.Core.ChildChangedEventArgsChildChanged
 Event raised when a child object has been changed. More...
 
FieldDataManager FieldManager [get]
 Gets the PropertyManager object for this business object. More...
 
- Properties inherited from Csla.Core.UndoableBase
bool BindingEdit [getset]
 Gets or sets a value indicating whether n-level undo was invoked through IEditableObject. More...
 
int EditLevel [get]
 Returns the current edit level of the object. More...
 
- Properties inherited from Csla.Core.BindableBase
PropertyChangedEventHandler PropertyChanged
 Implements a serialization-safe PropertyChanged event. More...
 
PropertyChangingEventHandler PropertyChanging
 Implements a serialization-safe PropertyChanging event. More...
 
- Properties inherited from Csla.Core.IUndoableObject
int EditLevel [get]
 Gets the current edit level of the object. More...
 
- Properties inherited from Csla.Core.IEditableBusinessObject
int EditLevelAdded [getset]
 For internal use only!! More...
 
- Properties inherited from Csla.Core.IBusinessObject
int Identity [get]
 Gets a value representing this object instance's unique identity value within the business object graph. More...
 
- Properties inherited from Csla.Core.ITrackStatus
bool IsValid [get]
 Returns true if the object and its child objects are currently valid, false if the object or any of its child objects have broken rules or are otherwise invalid. More...
 
bool IsSelfValid [get]
 Returns true if the object is currently valid, false if the object has broken rules or is otherwise invalid. More...
 
bool IsDirty [get]
 Returns true if this object's data, or any of its fields or child objects data, has been changed. More...
 
bool IsSelfDirty [get]
 Returns true if this object's data has been changed. More...
 
bool IsDeleted [get]
 Returns true if this object is marked for deletion. More...
 
bool IsNew [get]
 Returns true if this is a new object, false if it is a pre-existing object. More...
 
bool IsSavable [get]
 Returns true if this object is both dirty and valid. More...
 
bool IsChild [get]
 Returns true if this is a child object, false if it is a root object. More...
 
- Properties inherited from Csla.Core.INotifyBusy
bool IsBusy [get]
 Gets a value indicating whether the object, or any of the object's child objects, are busy running an asynchronous operation. More...
 
bool IsSelfBusy [get]
 Gets a value indicating whether the object is busy running an asynchronous operation. More...
 
- Properties inherited from Csla.Core.IParent
IParent Parent [get]
 Provide access to the parent reference for use in child object code. More...
 

Additional Inherited Members

- Events inherited from Csla.Core.INotifyBusy
BusyChangedEventHandler BusyChanged
 Event raised when the object's busy status changes. More...
 
- Events inherited from Csla.Core.INotifyUnhandledAsyncException
EventHandler< ErrorEventArgsUnhandledAsyncException
 Event indicating that an exception occurred during an asynchronous operation. More...
 
- Events inherited from Csla.Core.INotifyChildChanged
EventHandler< ChildChangedEventArgsChildChanged
 Event indictating that a child object has changed. More...
 

Detailed Description

This is the non-generic base class from which most business objects will be derived.

Definition at line 40 of file Csla/Core/BusinessBase.cs.

Constructor & Destructor Documentation

◆ BusinessBase()

Csla.Core.BusinessBase.BusinessBase ( )
protected

Creates an instance of the object.

Definition at line 59 of file Csla/Core/BusinessBase.cs.

Member Function Documentation

◆ AcceptChangesComplete()

override void Csla.Core.BusinessBase.AcceptChangesComplete ( )
protectedvirtual

Notifies the parent object (if any) that this child object's edits have been accepted.

Reimplemented from Csla.Core.UndoableBase.

Definition at line 908 of file Csla/Core/BusinessBase.cs.

◆ AddBusinessRules()

virtual void Csla.Core.BusinessBase.AddBusinessRules ( )
protectedvirtual

Override this method in your business class to be notified when you need to set up shared business rules.

This method is automatically called by CSLA .NET when your object should associate per-type validation rules with its properties.

Definition at line 1165 of file Csla/Core/BusinessBase.cs.

◆ AddEventHooks()

void Csla.Core.BusinessBase.AddEventHooks ( IBusinessObject  child)
protected

For internal use.

Parameters
childChild object.

Definition at line 1379 of file Csla/Core/BusinessBase.cs.

◆ ApplyEdit()

void Csla.Core.BusinessBase.ApplyEdit ( )

Commits the current edit process.

Calling this method causes the most recently taken snapshot of the object's state to be discarded, thus committing any changes made to the object's state since the last BeginEdit call.

Implements Csla.Core.ISupportUndo.

Definition at line 896 of file Csla/Core/BusinessBase.cs.

◆ BeginEdit()

void Csla.Core.BusinessBase.BeginEdit ( )

Starts a nested edit on the object.

When this method is called the object takes a snapshot of its current state (the values of its variables). This snapshot can be restored by calling CancelEdit or committed by calling ApplyEdit.

This is a nested operation. Each call to BeginEdit adds a new snapshot of the object's state to a stack. You should ensure that for each call to BeginEdit there is a corresponding call to either CancelEdit or ApplyEdit to remove that snapshot from the stack.

See Chapters 2 and 3 for details on n-level undo and state stacking.

Implements Csla.Core.ISupportUndo.

Definition at line 853 of file Csla/Core/BusinessBase.cs.

◆ CancelEdit()

void Csla.Core.BusinessBase.CancelEdit ( )

Cancels the current edit process, restoring the object's state to its previous values.

Calling this method causes the most recently taken snapshot of the object's state to be restored. This resets the object's values to the point of the last BeginEdit call.

Implements Csla.Core.ISupportUndo.

Definition at line 867 of file Csla/Core/BusinessBase.cs.

◆ CanExecuteMethod() [1/3]

virtual bool Csla.Core.BusinessBase.CanExecuteMethod ( Csla.Core.IMemberInfo  method)
virtual

Returns true if the user is allowed to execute the specified method.

Parameters
methodMethod to execute.
Returns
true if execute is allowed.

Definition at line 664 of file Csla/Core/BusinessBase.cs.

◆ CanExecuteMethod() [2/3]

bool Csla.Core.BusinessBase.CanExecuteMethod ( Csla.Core.IMemberInfo  method,
bool  throwOnFalse 
)

Returns true if the user is allowed to execute the specified method.

Returns
true if execute is allowed.
Parameters
methodMethod to execute.
throwOnFalseIndicates whether a negative result should cause an exception.

Definition at line 691 of file Csla/Core/BusinessBase.cs.

◆ CanExecuteMethod() [3/3]

virtual bool Csla.Core.BusinessBase.CanExecuteMethod ( string  methodName)
virtual

Returns true if the user is allowed to execute the specified method.

Parameters
methodNameName of the method to execute.
Returns
true if execute is allowed.

Implements Csla.Security.IAuthorizeReadWrite.

Definition at line 713 of file Csla/Core/BusinessBase.cs.

◆ CanReadProperty() [1/3]

virtual bool Csla.Core.BusinessBase.CanReadProperty ( Csla.Core.IPropertyInfo  property)
virtual

Returns true if the user is allowed to read the calling property.

Parameters
propertyProperty to check.

Definition at line 496 of file Csla/Core/BusinessBase.cs.

◆ CanReadProperty() [2/3]

bool Csla.Core.BusinessBase.CanReadProperty ( Csla.Core.IPropertyInfo  property,
bool  throwOnFalse 
)

Returns true if the user is allowed to read the calling property.

Returns
true if read is allowed.
Parameters
propertyProperty to read.
throwOnFalseIndicates whether a negative result should cause an exception.

Definition at line 523 of file Csla/Core/BusinessBase.cs.

◆ CanReadProperty() [3/3]

bool Csla.Core.BusinessBase.CanReadProperty ( string  propertyName)

Returns true if the user is allowed to read the specified property.

Parameters
propertyNameName of the property to read.

Implements Csla.Security.IAuthorizeReadWrite.

Definition at line 542 of file Csla/Core/BusinessBase.cs.

◆ CanWriteProperty() [1/3]

virtual bool Csla.Core.BusinessBase.CanWriteProperty ( Csla.Core.IPropertyInfo  property)
virtual

Returns true if the user is allowed to write the specified property.

Parameters
propertyProperty to write.

Definition at line 571 of file Csla/Core/BusinessBase.cs.

◆ CanWriteProperty() [2/3]

bool Csla.Core.BusinessBase.CanWriteProperty ( Csla.Core.IPropertyInfo  property,
bool  throwOnFalse 
)

Returns true if the user is allowed to write the calling property.

Returns
true if write is allowed.
Parameters
propertyProperty to write.
throwOnFalseIndicates whether a negative result should cause an exception.

Definition at line 598 of file Csla/Core/BusinessBase.cs.

◆ CanWriteProperty() [3/3]

bool Csla.Core.BusinessBase.CanWriteProperty ( string  propertyName)

Returns true if the user is allowed to write the specified property.

Parameters
propertyNameName of the property to write.

Implements Csla.Security.IAuthorizeReadWrite.

Definition at line 616 of file Csla/Core/BusinessBase.cs.

◆ CheckObjectRules()

virtual void Csla.Core.BusinessBase.CheckObjectRules ( )
protectedvirtual

Check object rules and notifies UI of properties that may have changed.

Definition at line 411 of file Csla/Core/BusinessBase.cs.

◆ CheckPropertyRules()

virtual void Csla.Core.BusinessBase.CheckPropertyRules ( IPropertyInfo  property)
protectedvirtual

Check rules for the property and notifies UI of properties that may have changed.

Parameters
propertyThe property.

Definition at line 398 of file Csla/Core/BusinessBase.cs.

◆ Child_Create()

virtual void Csla.Core.BusinessBase.Child_Create ( )
protectedvirtual

Override this method to load a new business object with default values from the database.

Normally you will overload this method to accept a strongly-typed criteria parameter, rather than overriding the method with a loosely-typed criteria parameter.

Definition at line 1275 of file Csla/Core/BusinessBase.cs.

◆ Child_OnDataPortalException()

virtual void Csla.Core.BusinessBase.Child_OnDataPortalException ( DataPortalEventArgs  e,
Exception  ex 
)
protectedvirtual

Called by the server-side DataPortal if an exception occurs during data access.

Parameters
eThe DataPortalContext object passed to the DataPortal.
exThe Exception thrown during data access.

Definition at line 1305 of file Csla/Core/BusinessBase.cs.

◆ Child_OnDataPortalInvoke()

virtual void Csla.Core.BusinessBase.Child_OnDataPortalInvoke ( DataPortalEventArgs  e)
protectedvirtual

Called by the server-side DataPortal prior to calling the requested DataPortal_XYZ method.

Parameters
eThe DataPortalContext object passed to the DataPortal.

Definition at line 1286 of file Csla/Core/BusinessBase.cs.

◆ Child_OnDataPortalInvokeComplete()

virtual void Csla.Core.BusinessBase.Child_OnDataPortalInvokeComplete ( DataPortalEventArgs  e)
protectedvirtual

Called by the server-side DataPortal after calling the requested DataPortal_XYZ method.

Parameters
eThe DataPortalContext object passed to the DataPortal.

Definition at line 1295 of file Csla/Core/BusinessBase.cs.

◆ DataPortal_OnDataPortalException()

virtual void Csla.Core.BusinessBase.DataPortal_OnDataPortalException ( DataPortalEventArgs  e,
Exception  ex 
)
protectedvirtual

Called by the server-side DataPortal if an exception occurs during data access.

Parameters
eThe DataPortalContext object passed to the DataPortal.
exThe Exception thrown during data access.

Definition at line 1263 of file Csla/Core/BusinessBase.cs.

◆ DataPortal_OnDataPortalInvoke()

virtual void Csla.Core.BusinessBase.DataPortal_OnDataPortalInvoke ( DataPortalEventArgs  e)
protectedvirtual

Called by the server-side DataPortal prior to calling the requested DataPortal_XYZ method.

Parameters
eThe DataPortalContext object passed to the DataPortal.

Definition at line 1244 of file Csla/Core/BusinessBase.cs.

◆ DataPortal_OnDataPortalInvokeComplete()

virtual void Csla.Core.BusinessBase.DataPortal_OnDataPortalInvokeComplete ( DataPortalEventArgs  e)
protectedvirtual

Called by the server-side DataPortal after calling the requested DataPortal_XYZ method.

Parameters
eThe DataPortalContext object passed to the DataPortal.

Definition at line 1253 of file Csla/Core/BusinessBase.cs.

◆ Delete()

virtual void Csla.Core.BusinessBase.Delete ( )
virtual

Marks the object for deletion.

The object will be deleted as part of the next save operation.

CSLA .NET supports both immediate and deferred deletion of objects. This method is part of the support for deferred deletion, where an object can be marked for deletion, but isn't actually deleted until the object is saved to the database. This method is called by the UI developer to mark the object for deletion.

To 'undelete' an object, use n-level undo as discussed in Chapters 2 and 3.

Implements Csla.Core.IEditableBusinessObject.

Definition at line 964 of file Csla/Core/BusinessBase.cs.

◆ EditChildComplete()

virtual void Csla.Core.BusinessBase.EditChildComplete ( Core.IEditableBusinessObject  child)
protectedvirtual

Override this method to be notified when a child object's Core.BusinessBase.ApplyEdit method has completed.

Parameters
childThe child object that was edited.

Definition at line 3336 of file Csla/Core/BusinessBase.cs.

◆ GetBrokenRules()

BrokenRulesCollection Csla.Core.BusinessBase.GetBrokenRules ( )

Gets the broken rules for this object

Implements Csla.Core.ICheckRules.

Definition at line 3735 of file Csla/Core/BusinessBase.cs.

◆ GetClone()

virtual object Csla.Core.BusinessBase.GetClone ( )
protectedvirtual

Creates a clone of the object.

Returns
A new object containing the exact data of the original object.

Definition at line 1033 of file Csla/Core/BusinessBase.cs.

◆ GetProperty()

object Csla.Core.BusinessBase.GetProperty ( IPropertyInfo  propertyInfo)
protected

Gets a property's value as a specified type.

Parameters
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Definition at line 1825 of file Csla/Core/BusinessBase.cs.

◆ GetProperty< P >() [1/7]

P Csla.Core.BusinessBase.GetProperty< P > ( IPropertyInfo  propertyInfo)
protected

Gets a property's managed field value, first checking authorization.

Template Parameters
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Definition at line 1854 of file Csla/Core/BusinessBase.cs.

◆ GetProperty< P >() [2/7]

P Csla.Core.BusinessBase.GetProperty< P > ( PropertyInfo< P >  propertyInfo)
protected

Gets a property's managed field value, first checking authorization.

Template Parameters
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Definition at line 1734 of file Csla/Core/BusinessBase.cs.

◆ GetProperty< P >() [3/7]

P Csla.Core.BusinessBase.GetProperty< P > ( PropertyInfo< P >  propertyInfo,
field 
)
protected

Gets a property's value, first checking authorization.

Template Parameters
PType of the property.
Parameters
fieldThe backing field for the property.
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Definition at line 1643 of file Csla/Core/BusinessBase.cs.

◆ GetProperty< P >() [4/7]

P Csla.Core.BusinessBase.GetProperty< P > ( PropertyInfo< P >  propertyInfo,
field,
defaultValue,
Security.NoAccessBehavior  noAccess 
)
protected

Gets a property's value, first checking authorization.

Template Parameters
PType of the property.
Parameters
fieldThe backing field for the property.
propertyInfoPropertyInfo object containing property metadata.
defaultValueValue to be returned if the user is not authorized to read the property.
noAccessTrue if an exception should be thrown when the user is not authorized to read this property.

Definition at line 1664 of file Csla/Core/BusinessBase.cs.

◆ GetProperty< P >() [5/7]

P Csla.Core.BusinessBase.GetProperty< P > ( PropertyInfo< P >  propertyInfo,
Security.NoAccessBehavior  noAccess 
)
protected

Gets a property's value as a specified type, first checking authorization.

Template Parameters
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.
noAccessTrue if an exception should be thrown when the user is not authorized to read this property.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Definition at line 1805 of file Csla/Core/BusinessBase.cs.

◆ GetProperty< P >() [6/7]

P Csla.Core.BusinessBase.GetProperty< P > ( string  propertyName,
field,
defaultValue 
)
protected

Gets a property's value, first checking authorization.

Template Parameters
PType of the property.
Parameters
fieldThe backing field for the property.
propertyNameThe name of the property.
defaultValueValue to be returned if the user is not authorized to read the property.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Definition at line 1590 of file Csla/Core/BusinessBase.cs.

◆ GetProperty< P >() [7/7]

P Csla.Core.BusinessBase.GetProperty< P > ( string  propertyName,
field,
defaultValue,
Security.NoAccessBehavior  noAccess 
)
protected

Gets a property's value, first checking authorization.

Template Parameters
PType of the property.
Parameters
fieldThe backing field for the property.
propertyNameThe name of the property.
defaultValueValue to be returned if the user is not authorized to read the property.
noAccessTrue if an exception should be thrown when the user is not authorized to read this property.

Definition at line 1611 of file Csla/Core/BusinessBase.cs.

◆ GetPropertyConvert< F, P >() [1/4]

P Csla.Core.BusinessBase.GetPropertyConvert< F, P > ( PropertyInfo< F >  propertyInfo)
protected

Gets a property's value from the list of managed field values, first checking authorization, and converting the value to an appropriate type.

Template Parameters
FType of the field.
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Definition at line 1757 of file Csla/Core/BusinessBase.cs.

◆ GetPropertyConvert< F, P >() [2/4]

P Csla.Core.BusinessBase.GetPropertyConvert< F, P > ( PropertyInfo< F >  propertyInfo,
field 
)
protected

Gets a property's value as a specified type, first checking authorization.

Template Parameters
FType of the field.
PType of the property.
Parameters
fieldThe backing field for the property.
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Definition at line 1688 of file Csla/Core/BusinessBase.cs.

◆ GetPropertyConvert< F, P >() [3/4]

P Csla.Core.BusinessBase.GetPropertyConvert< F, P > ( PropertyInfo< F >  propertyInfo,
field,
Security.NoAccessBehavior  noAccess 
)
protected

Gets a property's value as a specified type, first checking authorization.

Template Parameters
FType of the field.
PType of the property.
Parameters
fieldThe backing field for the property.
propertyInfoPropertyInfo object containing property metadata.
noAccessTrue if an exception should be thrown when the user is not authorized to read this property.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Definition at line 1715 of file Csla/Core/BusinessBase.cs.

◆ GetPropertyConvert< F, P >() [4/4]

P Csla.Core.BusinessBase.GetPropertyConvert< F, P > ( PropertyInfo< F >  propertyInfo,
Security.NoAccessBehavior  noAccess 
)
protected

Gets a property's value from the list of managed field values, first checking authorization, and converting the value to an appropriate type.

Template Parameters
FType of the field.
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.
noAccessTrue if an exception should be thrown when the user is not authorized to read this property.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Definition at line 1783 of file Csla/Core/BusinessBase.cs.

◆ GetRegisteredRules()

BusinessRuleManager Csla.Core.BusinessBase.GetRegisteredRules ( )
protected

Gets the registered rules.

Only for unit testing and not visible to code.

Returns

Definition at line 1120 of file Csla/Core/BusinessBase.cs.

◆ Initialize()

virtual void Csla.Core.BusinessBase.Initialize ( )
protectedvirtual

Override this method to set up event handlers so user code in a partial class can respond to events raised by generated code.

Definition at line 73 of file Csla/Core/BusinessBase.cs.

◆ IsPropertyBusy() [1/2]

virtual bool Csla.Core.BusinessBase.IsPropertyBusy ( Csla.Core.IPropertyInfo  property)
virtual

Gets a value indicating whether a specific property is busy (has a currently executing async rule).

Parameters
propertyProperty to check.

Definition at line 3096 of file Csla/Core/BusinessBase.cs.

◆ IsPropertyBusy() [2/2]

bool Csla.Core.BusinessBase.IsPropertyBusy ( string  propertyName)

Gets a value indicating whether a specific property is busy (has a currently executing async rule).

Parameters
propertyNameName of the property.

Definition at line 3109 of file Csla/Core/BusinessBase.cs.

◆ LazyGetProperty< P >()

P Csla.Core.BusinessBase.LazyGetProperty< P > ( PropertyInfo< P >  property,
Func< P >  valueGenerator 
)
protected

Lazily initializes a property and returns the resulting value.

Template Parameters
PType of the property.
Parameters
propertyPropertyInfo object containing property metadata.
valueGeneratorMethod returning the new value.
Returns

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Definition at line 1872 of file Csla/Core/BusinessBase.cs.

◆ LazyGetPropertyAsync< P >()

P Csla.Core.BusinessBase.LazyGetPropertyAsync< P > ( PropertyInfo< P >  property,
Task< P >  factory 
)
protected

Lazily initializes a property and returns the resulting value.

Template Parameters
PType of the property.
Parameters
propertyPropertyInfo object containing property metadata.
factoryAsync method returning the new value.
Returns

Note that the first value returned is almost certainly the defaultValue because the value is initialized asynchronously. The real value is provided later along with a PropertyChanged event to indicate the value has changed.

If the user is not authorized to read the property value, the defaultValue value is returned as a result.

Definition at line 1906 of file Csla/Core/BusinessBase.cs.

◆ LazyReadProperty< P >()

P Csla.Core.BusinessBase.LazyReadProperty< P > ( PropertyInfo< P >  property,
Func< P >  valueGenerator 
)
protected

Gets a property's value as a specified type.

Template Parameters
PType of the property.
Parameters
propertyPropertyInfo object containing property metadata.
valueGeneratorMethod returning the new value.

Definition at line 2021 of file Csla/Core/BusinessBase.cs.

◆ LazyReadPropertyAsync< P >()

P Csla.Core.BusinessBase.LazyReadPropertyAsync< P > ( PropertyInfo< P >  property,
Task< P >  factory 
)
protected

Gets a property's value as a specified type.

Template Parameters
PType of the property.
Parameters
propertyPropertyInfo object containing property metadata.
factoryAsync method returning the new value.

Definition at line 2040 of file Csla/Core/BusinessBase.cs.

◆ LoadProperty()

virtual void Csla.Core.BusinessBase.LoadProperty ( IPropertyInfo  propertyInfo,
object  newValue 
)
protectedvirtual

Loads a property's managed field with the supplied value.

Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

No authorization checks occur when this method is called, and no PropertyChanging or PropertyChanged events are raised. Loading values does not cause validation rules to be invoked.

Definition at line 2853 of file Csla/Core/BusinessBase.cs.

◆ LoadProperty< P >()

void Csla.Core.BusinessBase.LoadProperty< P > ( PropertyInfo< P >  propertyInfo,
newValue 
)
protected

Loads a property's managed field with the supplied value.

Template Parameters
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

No authorization checks occur when this method is called, and no PropertyChanging or PropertyChanged events are raised. Loading values does not cause validation rules to be invoked.

Definition at line 2570 of file Csla/Core/BusinessBase.cs.

◆ LoadPropertyAsync< R >()

void Csla.Core.BusinessBase.LoadPropertyAsync< R > ( PropertyInfo< R >  property,
Task< R >  factory 
)
protected

Load a property from an async method.

Template Parameters
R
Parameters
property
factory

Definition at line 3000 of file Csla/Core/BusinessBase.cs.

◆ LoadPropertyConvert< P, F >()

void Csla.Core.BusinessBase.LoadPropertyConvert< P, F > ( PropertyInfo< P >  propertyInfo,
newValue 
)
protected

Loads a property's managed field with the supplied value.

Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

No authorization checks occur when this method is called, and no PropertyChanging or PropertyChanged events are raised. Loading values does not cause validation rules to be invoked.

Definition at line 2515 of file Csla/Core/BusinessBase.cs.

◆ LoadPropertyMarkDirty()

virtual bool Csla.Core.BusinessBase.LoadPropertyMarkDirty ( IPropertyInfo  propertyInfo,
object  newValue 
)
protectedvirtual

Loads a property's managed field with the supplied value.

Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

No authorization checks occur when this method is called, and no PropertyChanging or PropertyChanged events are raised. Loading values does not cause validation rules to be invoked.

Definition at line 2770 of file Csla/Core/BusinessBase.cs.

◆ LoadPropertyMarkDirty< P >()

bool Csla.Core.BusinessBase.LoadPropertyMarkDirty< P > ( PropertyInfo< P >  propertyInfo,
newValue 
)
protected

Loads a property's managed field with the supplied value and mark field as dirty if value is modified.

Template Parameters
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

No authorization checks occur when this method is called, and no PropertyChanging or PropertyChanged events are raised. Loading values does not cause validation rules to be invoked.

Definition at line 2615 of file Csla/Core/BusinessBase.cs.

◆ MarkAsChild()

void Csla.Core.BusinessBase.MarkAsChild ( )
protected

Marks the object as being a child object.

Definition at line 939 of file Csla/Core/BusinessBase.cs.

◆ MarkBusy()

void Csla.Core.BusinessBase.MarkBusy ( )
protected

Mark the object as busy (it is running an async operation).

Definition at line 3018 of file Csla/Core/BusinessBase.cs.

◆ MarkClean()

void Csla.Core.BusinessBase.MarkClean ( )
protected

Forces the object's IsDirty flag to false.

This method is normally called automatically and is not intended to be called manually.

Definition at line 433 of file Csla/Core/BusinessBase.cs.

◆ MarkDeleted()

void Csla.Core.BusinessBase.MarkDeleted ( )
protected

Marks an object for deletion.

This also marks the object as being dirty.

You should call this method in your business logic in the case that you want to have the object deleted when it is saved to the database.

Definition at line 309 of file Csla/Core/BusinessBase.cs.

◆ MarkDirty() [1/2]

void Csla.Core.BusinessBase.MarkDirty ( )
protected

Marks an object as being dirty, or changed.

You should call this method in your business logic any time the object's internal data changes. Any time any instance variable changes within the object, this method should be called to tell CSLA .NET that the object's data has been changed.

Marking an object as dirty does two things. First it ensures that CSLA .NET will properly save the object as appropriate. Second, it causes CSLA .NET to tell Windows Forms data binding that the object's data has changed so any bound controls will update to reflect the new values.

Definition at line 333 of file Csla/Core/BusinessBase.cs.

◆ MarkDirty() [2/2]

void Csla.Core.BusinessBase.MarkDirty ( bool  suppressEvent)
protected

Marks an object as being dirty, or changed.

Parameters
suppressEventtrue to supress the PropertyChanged event that is otherwise raised to indicate that the object's state has changed.

Definition at line 346 of file Csla/Core/BusinessBase.cs.

◆ MarkIdle()

void Csla.Core.BusinessBase.MarkIdle ( )
protected

Mark the object as not busy (it is not running an async operation).

Definition at line 3032 of file Csla/Core/BusinessBase.cs.

◆ MarkNew()

virtual void Csla.Core.BusinessBase.MarkNew ( )
protectedvirtual

Marks the object as being a new object.

This also marks the object as being dirty and ensures that it is not marked for deletion.

Newly created objects are marked new by default. You should call this method in the implementation of DataPortal_Update when the object is deleted (due to being marked for deletion) to indicate that the object no longer reflects data in the database.

If you override this method, make sure to call the base implementation after executing your new code.

Definition at line 266 of file Csla/Core/BusinessBase.cs.

◆ MarkOld()

virtual void Csla.Core.BusinessBase.MarkOld ( )
protectedvirtual

Marks the object as being an old (not new) object.

This also marks the object as being unchanged (not dirty).

You should call this method in the implementation of DataPortal_Fetch to indicate that an existing object has been successfully retrieved from the database.

You should call this method in the implementation of DataPortal_Update to indicate that a new object has been successfully inserted into the database.

If you override this method, make sure to call the base implementation after executing your new code.

Definition at line 293 of file Csla/Core/BusinessBase.cs.

◆ MetaPropertyHasChanged()

virtual void Csla.Core.BusinessBase.MetaPropertyHasChanged ( string  name)
protectedvirtual

Raises OnPropertyChanged for meta properties (IsXYZ) when PropertyChangedMode is not Windows

Parameters
namemeta property name that has cchanged.

Definition at line 387 of file Csla/Core/BusinessBase.cs.

◆ OnAddEventHooks()

virtual void Csla.Core.BusinessBase.OnAddEventHooks ( IBusinessObject  child)
protectedvirtual

Hook child object events.

Parameters
childChild object.

Definition at line 1389 of file Csla/Core/BusinessBase.cs.

◆ OnBusyChanged()

virtual void Csla.Core.BusinessBase.OnBusyChanged ( BusyChangedEventArgs  args)
protectedvirtual

Raise the BusyChanged event.

Parameters
argsEvent args.

Definition at line 3080 of file Csla/Core/BusinessBase.cs.

◆ OnChildChanged()

virtual void Csla.Core.BusinessBase.OnChildChanged ( ChildChangedEventArgs  e)
protectedvirtual

Raises the ChildChanged event, indicating that a child object has been changed.

Parameters
eChildChangedEventArgs object.

Definition at line 3190 of file Csla/Core/BusinessBase.cs.

◆ OnDeserialized()

virtual void Csla.Core.BusinessBase.OnDeserialized ( System.Runtime.Serialization.StreamingContext  context)
protectedvirtual

This method is called on a newly deserialized object after deserialization is complete.

Parameters
contextSerialization context object.

Definition at line 1367 of file Csla/Core/BusinessBase.cs.

◆ OnGetChildren()

override void Csla.Core.BusinessBase.OnGetChildren ( Csla.Serialization.Mobile.SerializationInfo  info,
Csla.Serialization.Mobile.MobileFormatter  formatter 
)
protected

Override this method to insert your child object references into the MobileFormatter serialzation stream.

Parameters
infoObject containing the data to serialize.
formatterReference to MobileFormatter instance. Use this to convert child references to/from reference id values.

Definition at line 3525 of file Csla/Core/BusinessBase.cs.

◆ OnGetState()

override void Csla.Core.BusinessBase.OnGetState ( Csla.Serialization.Mobile.SerializationInfo  info,
StateMode  mode 
)
protected

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

Parameters
infoObject containing the data to serialize.
modeThe StateMode indicating why this method was invoked.

Definition at line 3475 of file Csla/Core/BusinessBase.cs.

◆ OnRemoveEventHooks()

virtual void Csla.Core.BusinessBase.OnRemoveEventHooks ( IBusinessObject  child)
protectedvirtual

Unhook child object events.

Parameters
childChild object.

Definition at line 1431 of file Csla/Core/BusinessBase.cs.

◆ OnSetChildren()

override void Csla.Core.BusinessBase.OnSetChildren ( Csla.Serialization.Mobile.SerializationInfo  info,
Csla.Serialization.Mobile.MobileFormatter  formatter 
)
protected

Override this method to retrieve your child object references from the MobileFormatter serialzation stream.

Parameters
infoObject containing the data to serialize.
formatterReference to MobileFormatter instance. Use this to convert child references to/from reference id values.

Definition at line 3555 of file Csla/Core/BusinessBase.cs.

◆ OnSetState()

override void Csla.Core.BusinessBase.OnSetState ( Csla.Serialization.Mobile.SerializationInfo  info,
StateMode  mode 
)
protected

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

Parameters
infoObject containing the data to serialize.
modeThe StateMode indicating why this method was invoked.

Definition at line 3499 of file Csla/Core/BusinessBase.cs.

◆ OnUnhandledAsyncException() [1/2]

virtual void Csla.Core.BusinessBase.OnUnhandledAsyncException ( ErrorEventArgs  error)
protectedvirtual

Raises the UnhandledAsyncException event.

Parameters
errorArgs parameter.

Definition at line 3137 of file Csla/Core/BusinessBase.cs.

◆ OnUnhandledAsyncException() [2/2]

void Csla.Core.BusinessBase.OnUnhandledAsyncException ( object  originalSender,
Exception  error 
)
protected

Raises the UnhandledAsyncException event.

Parameters
originalSenderOriginal sender of the event.
errorException object.

Definition at line 3150 of file Csla/Core/BusinessBase.cs.

◆ OnValidationComplete()

virtual void Csla.Core.BusinessBase.OnValidationComplete ( )
protectedvirtual

Raises the ValidationComplete event

Definition at line 1067 of file Csla/Core/BusinessBase.cs.

◆ PropertyHasChanged()

virtual void Csla.Core.BusinessBase.PropertyHasChanged ( Csla.Core.IPropertyInfo  property)
protectedvirtual

Performs processing required when a property has changed.

Parameters
propertyProperty that has changed.

This method calls CheckRules(propertyName), MarkDirty and OnPropertyChanged(propertyName). MarkDirty is called such that no event is raised for IsDirty, so only the specific property changed event for the current property is raised.

Definition at line 372 of file Csla/Core/BusinessBase.cs.

◆ ReadProperty()

virtual object Csla.Core.BusinessBase.ReadProperty ( IPropertyInfo  propertyInfo)
protectedvirtual

Gets a property's value.

Parameters
propertyInfoPropertyInfo object containing property metadata.

Definition at line 1984 of file Csla/Core/BusinessBase.cs.

◆ ReadProperty< P >()

P Csla.Core.BusinessBase.ReadProperty< P > ( PropertyInfo< P >  propertyInfo)
protected

Gets a property's value as a specified type.

Template Parameters
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.

Definition at line 1956 of file Csla/Core/BusinessBase.cs.

◆ ReadPropertyConvert< F, P >()

P Csla.Core.BusinessBase.ReadPropertyConvert< F, P > ( PropertyInfo< F >  propertyInfo)
protected

Gets a property's value from the list of managed field values, converting the value to an appropriate type.

Template Parameters
FType of the field.
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.

Definition at line 1943 of file Csla/Core/BusinessBase.cs.

◆ RegisterMethod() [1/2]

static Csla.Core.IMemberInfo Csla.Core.BusinessBase.RegisterMethod ( Type  objectType,
IMemberInfo  info 
)
staticprotected

Indicates that the specified method belongs to the type.

Parameters
objectTypeType of object to which the method belongs.
infoIMemberInfo object for the property.
Returns
The provided IMemberInfo object.

Definition at line 1515 of file Csla/Core/BusinessBase.cs.

◆ RegisterMethod() [2/2]

static MethodInfo Csla.Core.BusinessBase.RegisterMethod ( Type  objectType,
string  methodName 
)
staticprotected

Indicates that the specified method belongs to the type.

Parameters
objectTypeType of object to which the method belongs.
methodNameName of the method.
Returns
The provided IMemberInfo object.

Definition at line 1536 of file Csla/Core/BusinessBase.cs.

◆ RegisterProperty< P >()

static PropertyInfo< P > Csla.Core.BusinessBase.RegisterProperty< P > ( Type  objectType,
PropertyInfo< P >  info 
)
staticprotected

Indicates that the specified property belongs to the type.

Template Parameters
PType of property.
Parameters
objectTypeType of object to which the property belongs.
infoPropertyInfo object for the property.
Returns
The provided IPropertyInfo object.

Definition at line 1563 of file Csla/Core/BusinessBase.cs.

◆ RemoveEventHooks()

void Csla.Core.BusinessBase.RemoveEventHooks ( IBusinessObject  child)
protected

For internal use only.

Parameters
childChild object.

Definition at line 1421 of file Csla/Core/BusinessBase.cs.

◆ SetParent()

virtual void Csla.Core.BusinessBase.SetParent ( Core.IParent  parent)
protectedvirtual

Used by BusinessListBase as a child object is created to tell the child object about its parent.

Parameters
parentA reference to the parent collection object.

Definition at line 140 of file Csla/Core/BusinessBase.cs.

◆ SetProperty()

void Csla.Core.BusinessBase.SetProperty ( IPropertyInfo  propertyInfo,
object  newValue 
)
protected

Sets a property's managed field with the supplied value, and then calls PropertyHasChanged if the value does change.

Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

If the user is not authorized to change the property a SecurityException is thrown.

Definition at line 2450 of file Csla/Core/BusinessBase.cs.

◆ SetProperty< P >() [1/6]

void Csla.Core.BusinessBase.SetProperty< P > ( IPropertyInfo  propertyInfo,
newValue 
)
protected

Sets a property's managed field with the supplied value, and then calls PropertyHasChanged if the value does change.

Template Parameters
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

If the user is not authorized to change the property a SecurityException is thrown.

Definition at line 2492 of file Csla/Core/BusinessBase.cs.

◆ SetProperty< P >() [2/6]

void Csla.Core.BusinessBase.SetProperty< P > ( PropertyInfo< P >  propertyInfo,
newValue 
)
protected

Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Template Parameters
PProperty type.
Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

If the user is not authorized to change the property, this overload throws a SecurityException.

Definition at line 2313 of file Csla/Core/BusinessBase.cs.

◆ SetProperty< P >() [3/6]

void Csla.Core.BusinessBase.SetProperty< P > ( PropertyInfo< P >  propertyInfo,
newValue,
Security.NoAccessBehavior  noAccess 
)
protected

Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Template Parameters
PType of the property.
Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.
noAccessTrue if an exception should be thrown when the user is not authorized to change this property.

Definition at line 2404 of file Csla/Core/BusinessBase.cs.

◆ SetProperty< P >() [4/6]

void Csla.Core.BusinessBase.SetProperty< P > ( PropertyInfo< P >  propertyInfo,
ref P  field,
newValue 
)
protected

Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Parameters
fieldA reference to the backing field for the property.
newValueThe new value for the property.
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to change the property, this overload throws a SecurityException.

Definition at line 2079 of file Csla/Core/BusinessBase.cs.

◆ SetProperty< P >() [5/6]

void Csla.Core.BusinessBase.SetProperty< P > ( string  propertyName,
ref P  field,
newValue 
)
protected

Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Parameters
fieldA reference to the backing field for the property.
newValueThe new value for the property.
propertyNameThe name of the property.

If the user is not authorized to change the property, this overload throws a SecurityException.

Definition at line 2099 of file Csla/Core/BusinessBase.cs.

◆ SetProperty< P >() [6/6]

void Csla.Core.BusinessBase.SetProperty< P > ( string  propertyName,
ref P  field,
newValue,
Security.NoAccessBehavior  noAccess 
)
protected

Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Parameters
fieldA reference to the backing field for the property.
newValueThe new value for the property.
propertyNameThe name of the property.
noAccessTrue if an exception should be thrown when the user is not authorized to change this property.

Definition at line 2173 of file Csla/Core/BusinessBase.cs.

◆ SetPropertyConvert< P, F >() [1/2]

void Csla.Core.BusinessBase.SetPropertyConvert< P, F > ( PropertyInfo< P >  propertyInfo,
newValue 
)
protected

Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

If the user is not authorized to change the property, this overload throws a SecurityException.

Definition at line 2331 of file Csla/Core/BusinessBase.cs.

◆ SetPropertyConvert< P, F >() [2/2]

void Csla.Core.BusinessBase.SetPropertyConvert< P, F > ( PropertyInfo< P >  propertyInfo,
newValue,
Security.NoAccessBehavior  noAccess 
)
protected

Sets a property's managed field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Parameters
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.
noAccessTrue if an exception should be thrown when the user is not authorized to change this property.

Definition at line 2348 of file Csla/Core/BusinessBase.cs.

◆ SetPropertyConvert< P, V >() [1/3]

void Csla.Core.BusinessBase.SetPropertyConvert< P, V > ( PropertyInfo< P >  propertyInfo,
ref P  field,
newValue 
)
protected

Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Template Parameters
PType of the field being set.
VType of the value provided to the field.
Parameters
fieldA reference to the backing field for the property.
newValueThe new value for the property.
propertyInfoPropertyInfo object containing property metadata.

If the user is not authorized to change the property, this overload throws a SecurityException.

Definition at line 2125 of file Csla/Core/BusinessBase.cs.

◆ SetPropertyConvert< P, V >() [2/3]

void Csla.Core.BusinessBase.SetPropertyConvert< P, V > ( PropertyInfo< P >  propertyInfo,
ref P  field,
newValue,
Security.NoAccessBehavior  noAccess 
)
protected

Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Template Parameters
PType of the field being set.
VType of the value provided to the field.
Parameters
fieldA reference to the backing field for the property.
newValueThe new value for the property.
propertyInfoPropertyInfo object containing property metadata.
noAccessTrue if an exception should be thrown when the user is not authorized to change this property.

If the field value is of type string, any incoming null values are converted to string.Empty.

Definition at line 2154 of file Csla/Core/BusinessBase.cs.

◆ SetPropertyConvert< P, V >() [3/3]

void Csla.Core.BusinessBase.SetPropertyConvert< P, V > ( string  propertyName,
ref P  field,
newValue,
Security.NoAccessBehavior  noAccess 
)
protected

Sets a property's backing field with the supplied value, first checking authorization, and then calling PropertyHasChanged if the value does change.

Template Parameters
PType of the field being set.
VType of the value provided to the field.
Parameters
fieldA reference to the backing field for the property.
newValueThe new value for the property.
propertyNameThe name of the property.
noAccessTrue if an exception should be thrown when the user is not authorized to change this property.

If the field value is of type string, any incoming null values are converted to string.Empty.

Definition at line 2248 of file Csla/Core/BusinessBase.cs.

◆ UndoChangesComplete()

override void Csla.Core.BusinessBase.UndoChangesComplete ( )
protectedvirtual

Called when an undo operation has completed.

This method resets the object as a result of deserialization and raises PropertyChanged events to notify data binding that the object has changed.

Reimplemented from Csla.Core.UndoableBase.

Definition at line 880 of file Csla/Core/BusinessBase.cs.

Property Documentation

◆ BrokenRulesCollection

virtual Rules.BrokenRulesCollection Csla.Core.BusinessBase.BrokenRulesCollection
get

Provides access to the readonly collection of broken business rules for this object.

Definition at line 1229 of file Csla/Core/BusinessBase.cs.

◆ BusinessRules

BusinessRules Csla.Core.BusinessBase.BusinessRules
getprotected

Provides access to the broken rules functionality.

This property is used within your business logic so you can easily call the AddRule() method to associate business rules with your object's properties.

Definition at line 1103 of file Csla/Core/BusinessBase.cs.

◆ BusyChanged

BusyChangedEventHandler Csla.Core.BusinessBase.BusyChanged
addremove

Event indicating that the IsBusy property has changed.

Definition at line 3070 of file Csla/Core/BusinessBase.cs.

◆ ChildChanged

EventHandler<Csla.Core.ChildChangedEventArgs> Csla.Core.BusinessBase.ChildChanged
addremove

Event raised when a child object has been changed.

Definition at line 3168 of file Csla/Core/BusinessBase.cs.

◆ DisableIEditableObject

bool Csla.Core.BusinessBase.DisableIEditableObject
getsetprotected

Gets or sets a value indicating whether the IEditableObject interface methods should be disabled for this object.

Defaults to False, indicating that the IEditableObject methods will behave normally.

If you disable the IEditableObject methods then Windows Forms data binding will no longer automatically call BeginEdit, CancelEdit or ApplyEdit on your object, and you will have to call these methods manually to get proper n-level undo behavior.

Definition at line 755 of file Csla/Core/BusinessBase.cs.

◆ FieldManager

FieldDataManager Csla.Core.BusinessBase.FieldManager
getprotected

Gets the PropertyManager object for this business object.

Definition at line 3294 of file Csla/Core/BusinessBase.cs.

◆ IsBusy

virtual bool Csla.Core.BusinessBase.IsBusy
get

Gets a value indicating if this object or its child objects are busy.

Definition at line 3046 of file Csla/Core/BusinessBase.cs.

◆ IsChild

bool Csla.Core.BusinessBase.IsChild
get

Returns true if this is a child (non-root) object.

Definition at line 931 of file Csla/Core/BusinessBase.cs.

◆ IsDeleted

bool Csla.Core.BusinessBase.IsDeleted
get

Returns true if this object is marked for deletion.

CSLA .NET supports both immediate and deferred deletion of objects. This property is part of the support for deferred deletion, where an object can be marked for deletion, but isn't actually deleted until the object is saved to the database. This property indicates whether or not the current object has been marked for deletion. If it is true , the object will be deleted when it is saved to the database, otherwise it will be inserted or updated by the save operation.

Returns
A value indicating if this object is marked for deletion.

Definition at line 194 of file Csla/Core/BusinessBase.cs.

◆ IsDirty

virtual bool Csla.Core.BusinessBase.IsDirty
get

Returns true if this object's data, or any of its fields or child objects data, has been changed.

When an object's data is changed, CSLA .NET makes note of that change and considers the object to be 'dirty' or changed. This value is used to optimize data updates, since an unchanged object does not need to be updated into the database. All new objects are considered dirty. All objects marked for deletion are considered dirty.

Once an object's data has been saved to the database (inserted or updated) the dirty flag is cleared and the object is considered unchanged. Objects newly loaded from the database are also considered unchanged.

Returns
A value indicating if this object's data has been changed.

Definition at line 221 of file Csla/Core/BusinessBase.cs.

◆ IsNew

bool Csla.Core.BusinessBase.IsNew
get

Returns true if this is a new object, false if it is a pre-existing object.

An object is considered to be new if its primary identifying (key) value doesn't correspond to data in the database. In other words, if the data values in this particular object have not yet been saved to the database the object is considered to be new. Likewise, if the object's data has been deleted from the database then the object is considered to be new.

Returns
A value indicating if this object is new.

Definition at line 172 of file Csla/Core/BusinessBase.cs.

◆ IsSavable

virtual bool Csla.Core.BusinessBase.IsSavable
get

Returns true if this object is both dirty and valid.

An object is considered dirty (changed) if P:Csla.BusinessBase.IsDirty returns true. It is considered valid if IsValid returns true. The IsSavable property is a combination of these two properties.

Returns
A value indicating if this object is both dirty and valid.

Definition at line 458 of file Csla/Core/BusinessBase.cs.

◆ IsSelfBusy

virtual bool Csla.Core.BusinessBase.IsSelfBusy
get

Gets a value indicating if this object is busy.

Definition at line 3058 of file Csla/Core/BusinessBase.cs.

◆ IsSelfDirty

virtual bool Csla.Core.BusinessBase.IsSelfDirty
get

Returns true if this object's data has been changed.

When an object's data is changed, CSLA .NET makes note of that change and considers the object to be 'dirty' or changed. This value is used to optimize data updates, since an unchanged object does not need to be updated into the database. All new objects are considered dirty. All objects marked for deletion are considered dirty.

Once an object's data has been saved to the database (inserted or updated) the dirty flag is cleared and the object is considered unchanged. Objects newly loaded from the database are also considered unchanged.

Returns
A value indicating if this object's data has been changed.

Definition at line 246 of file Csla/Core/BusinessBase.cs.

◆ IsSelfValid

virtual bool Csla.Core.BusinessBase.IsSelfValid
get

Returns true if the object is currently valid, false if the object has broken rules or is otherwise invalid.

By default this property relies on the underling BusinessRules object to track whether any business rules are currently broken for this object.

You can override this property to provide more sophisticated implementations of the behavior.

Returns
A value indicating if the object is currently valid.

Definition at line 1215 of file Csla/Core/BusinessBase.cs.

◆ IsValid

virtual bool Csla.Core.BusinessBase.IsValid
get

Returns true if the object and its child objects are currently valid, false if the object or any of its child objects have broken rules or are otherwise invalid.

By default this property relies on the underling BusinessRules object to track whether any business rules are currently broken for this object.

You can override this property to provide more sophisticated implementations of the behavior. For instance, you should always override this method if your object has child objects, since the validity of this object is affected by the validity of all child objects.

Returns
A value indicating if the object is currently valid.

Definition at line 1192 of file Csla/Core/BusinessBase.cs.

◆ Parent

Core.IParent Csla.Core.BusinessBase.Parent
get

Provide access to the parent reference for use in child object code.

This value will be Nothing for root objects.

Definition at line 129 of file Csla/Core/BusinessBase.cs.

◆ UnhandledAsyncException

EventHandler<ErrorEventArgs> Csla.Core.BusinessBase.UnhandledAsyncException
addremove

Event indicating that an exception occurred during the processing of an async operation.

Definition at line 3126 of file Csla/Core/BusinessBase.cs.

◆ ValidationComplete

EventHandler Csla.Core.BusinessBase.ValidationComplete
addremove

Event raised when validation is complete.

Definition at line 1049 of file Csla/Core/BusinessBase.cs.