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.ReadOnlyBase< T > Class Template Reference

This is a base class from which readonly business classes can be derived. More...

Inheritance diagram for Csla.ReadOnlyBase< T >:
Csla.IReadOnlyBase Csla.Rules.IHostRules Csla.Core.INotifyBusy Csla.Security.IAuthorizeReadWrite Csla.Serialization.Mobile.ISerializationNotification Csla.Core.IReadOnlyObject Csla.Core.BindableBase Csla.Validation.ReadOnlyBase< T >

Public Member Functions

override string ToString ()
 Returns a text representation of this object by returning the GetIdValue value in text form. More...
 
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 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...
 
virtual object GetClone ()
 Creates a clone of the object. More...
 
Clone ()
 Creates a clone of the object. More...
 
- Public Member Functions inherited from Csla.Security.IAuthorizeReadWrite
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...
 

Protected Member Functions

virtual object GetIdValue ()
 Override this method to return a unique identifying value for this object. More...
 
 ReadOnlyBase ()
 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 AddBusinessRules ()
 Override this method to add per-type authorization rules for your type's properties. 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_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...
 
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...
 
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...
 
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...
 
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 as a specified type. 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 LoadPropertyConvert< P, F > (PropertyInfo< P > propertyInfo, F newValue)
 Loads a property's managed field with the supplied value calling PropertyHasChanged if the value does change. More...
 
void LoadProperty< P > (PropertyInfo< P > propertyInfo, P newValue)
 Loads a property's managed field with the supplied value calling PropertyHasChanged if the value does change. More...
 
virtual void LoadProperty (IPropertyInfo propertyInfo, object newValue)
 Loads a property's managed field with the supplied value calling PropertyHasChanged if the value does change. More...
 
void LoadPropertyAsync< R > (PropertyInfo< R > property, Task< R > factory)
 Load a property from an async method. More...
 
void MarkBusy ()
 Marks the object as being busy (it is running an async operation). More...
 
void MarkIdle ()
 Marks the object as being not busy (it is not running an async operation). More...
 
void OnBusyChanged (string propertyName, bool busy)
 Raises the BusyChanged event. More...
 
virtual void OnBusyChanged (BusyChangedEventArgs args)
 Raises the BusyChanged event. 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...
 
virtual void OnUnhandledAsyncException (ErrorEventArgs error)
 Raises the UnhandledAsyncException event. More...
 
void OnUnhandledAsyncException (object originalSender, Exception error)
 Raises the UnhandledAsyncException event. 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 OnGetState (SerializationInfo info, StateMode mode)
 Override this method to insert your field values into the MobileFormatter serialzation stream. More...
 
virtual void OnGetChildren (SerializationInfo info, MobileFormatter formatter)
 Override this method to insert your child object references into the MobileFormatter serialzation stream. More...
 
virtual void OnSetState (SerializationInfo info, StateMode mode)
 Override this method to retrieve your field values from 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 PropertyInfo< P > RegisterProperty< P > (Type objectType, PropertyInfo< P > info)
 Indicates that the specified property belongs to the type. More...
 
static PropertyInfo< P > RegisterProperty< P > (PropertyInfo< P > info)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (string propertyName)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (Expression< Func< T, object > > propertyLambdaExpression)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (Expression< Func< T, object > > propertyLambdaExpression, P defaultValue)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (string propertyName, string friendlyName)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (Expression< Func< T, object > > propertyLambdaExpression, string friendlyName)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (string propertyName, string friendlyName, P defaultValue)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (Expression< Func< T, object > > propertyLambdaExpression, string friendlyName, P defaultValue)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (string propertyName, RelationshipTypes relationship)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (Expression< Func< T, object > > propertyLambdaExpression, RelationshipTypes relationship)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (Expression< Func< T, object > > propertyLambdaExpression, string friendlyName, RelationshipTypes relationship)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (string propertyName, string friendlyName, P defaultValue, RelationshipTypes relationship)
 Indicates that the specified property belongs to the business object type. More...
 
static PropertyInfo< P > RegisterProperty< P > (Expression< Func< T, object > > propertyLambdaExpression, string friendlyName, P defaultValue, RelationshipTypes relationship)
 Indicates that the specified property belongs to the business object type. More...
 
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 MethodInfo RegisterMethod (string methodName)
 Registers a method for use in Authorization. More...
 
static MethodInfo RegisterMethod (Expression< Action< T > > methodLambdaExpression)
 Registers the method. More...
 

Properties

BusinessRules BusinessRules [get]
 Provides access to the broken rules functionality. More...
 
FieldDataManager FieldManager [get]
 Gets the PropertyManager object for this business object. More...
 
virtual bool IsBusy [get]
 Gets a value indicating whether this object or any of its child objects are running an async operation. More...
 
virtual bool IsSelfBusy [get]
 Gets a value indicating whether this object is running an async operation. More...
 
BusyChangedEventHandler BusyChanged
 Event raised when the IsBusy property value has changed. More...
 
EventHandler< ErrorEventArgsUnhandledAsyncException
 Event raised when an exception occurs on a background thread during an asynchronous operation. 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.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.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...
 

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...
 

Detailed Description

This is a base class from which readonly business classes can be derived.

This base class only supports data retrieve, not updating or deleting. Any business classes derived from this base class should only implement readonly properties.

Template Parameters
TType of the business object.
Type Constraints
T :ReadOnlyBase<T> 

Definition at line 41 of file Csla/ReadOnlyBase.cs.

Constructor & Destructor Documentation

◆ ReadOnlyBase()

Csla.ReadOnlyBase< T >.ReadOnlyBase ( )
protected

Creates an instance of the object.

Definition at line 87 of file Csla/ReadOnlyBase.cs.

Member Function Documentation

◆ AddBusinessRules()

virtual void Csla.ReadOnlyBase< T >.AddBusinessRules ( )
protectedvirtual

Override this method to add per-type authorization rules for your type's properties.

AddSharedAuthorizationRules is automatically called by CSLA .NET when your object should associate per-type authorization roles with its properties.

Definition at line 189 of file Csla/ReadOnlyBase.cs.

◆ CanExecuteMethod() [1/3]

virtual bool Csla.ReadOnlyBase< T >.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 299 of file Csla/ReadOnlyBase.cs.

◆ CanExecuteMethod() [2/3]

bool Csla.ReadOnlyBase< T >.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 322 of file Csla/ReadOnlyBase.cs.

◆ CanExecuteMethod() [3/3]

virtual bool Csla.ReadOnlyBase< T >.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 344 of file Csla/ReadOnlyBase.cs.

◆ CanReadProperty() [1/3]

virtual bool Csla.ReadOnlyBase< T >.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 198 of file Csla/ReadOnlyBase.cs.

◆ CanReadProperty() [2/3]

bool Csla.ReadOnlyBase< T >.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 222 of file Csla/ReadOnlyBase.cs.

◆ CanReadProperty() [3/3]

bool Csla.ReadOnlyBase< T >.CanReadProperty ( string  propertyName)

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

Parameters
propertyNameName of the property to read.

Implements Csla.Core.IReadOnlyObject.

Definition at line 241 of file Csla/ReadOnlyBase.cs.

◆ Child_OnDataPortalException()

virtual void Csla.ReadOnlyBase< T >.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 485 of file Csla/ReadOnlyBase.cs.

◆ Child_OnDataPortalInvoke()

virtual void Csla.ReadOnlyBase< T >.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 462 of file Csla/ReadOnlyBase.cs.

◆ Child_OnDataPortalInvokeComplete()

virtual void Csla.ReadOnlyBase< T >.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 473 of file Csla/ReadOnlyBase.cs.

◆ Clone()

T Csla.ReadOnlyBase< T >.Clone ( )

Creates a clone of the object.

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

Definition at line 386 of file Csla/ReadOnlyBase.cs.

◆ DataPortal_OnDataPortalException()

virtual void Csla.ReadOnlyBase< T >.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 450 of file Csla/ReadOnlyBase.cs.

◆ DataPortal_OnDataPortalInvoke()

virtual void Csla.ReadOnlyBase< T >.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 425 of file Csla/ReadOnlyBase.cs.

◆ DataPortal_OnDataPortalInvokeComplete()

virtual void Csla.ReadOnlyBase< T >.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 437 of file Csla/ReadOnlyBase.cs.

◆ GetClone()

virtual object Csla.ReadOnlyBase< T >.GetClone ( )
virtual

Creates a clone of the object.

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

Definition at line 375 of file Csla/ReadOnlyBase.cs.

◆ GetIdValue()

virtual object Csla.ReadOnlyBase< T >.GetIdValue ( )
protectedvirtual

Override this method to return a unique identifying value for this object.

Definition at line 59 of file Csla/ReadOnlyBase.cs.

◆ GetProperty()

object Csla.ReadOnlyBase< T >.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 1111 of file Csla/ReadOnlyBase.cs.

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

P Csla.ReadOnlyBase< T >.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 1020 of file Csla/ReadOnlyBase.cs.

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

P Csla.ReadOnlyBase< T >.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 874 of file Csla/ReadOnlyBase.cs.

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

P Csla.ReadOnlyBase< T >.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 895 of file Csla/ReadOnlyBase.cs.

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

P Csla.ReadOnlyBase< T >.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 1091 of file Csla/ReadOnlyBase.cs.

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

P Csla.ReadOnlyBase< T >.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 821 of file Csla/ReadOnlyBase.cs.

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

P Csla.ReadOnlyBase< T >.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 842 of file Csla/ReadOnlyBase.cs.

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

P Csla.ReadOnlyBase< T >.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 1043 of file Csla/ReadOnlyBase.cs.

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

P Csla.ReadOnlyBase< T >.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 974 of file Csla/ReadOnlyBase.cs.

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

P Csla.ReadOnlyBase< T >.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 1001 of file Csla/ReadOnlyBase.cs.

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

P Csla.ReadOnlyBase< T >.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 1069 of file Csla/ReadOnlyBase.cs.

◆ Initialize()

virtual void Csla.ReadOnlyBase< T >.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 100 of file Csla/ReadOnlyBase.cs.

◆ LazyGetProperty< P >()

P Csla.ReadOnlyBase< T >.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 913 of file Csla/ReadOnlyBase.cs.

◆ LazyGetPropertyAsync< P >()

P Csla.ReadOnlyBase< T >.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 945 of file Csla/ReadOnlyBase.cs.

◆ LazyReadProperty< P >()

P Csla.ReadOnlyBase< T >.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 1211 of file Csla/ReadOnlyBase.cs.

◆ LazyReadPropertyAsync< P >()

P Csla.ReadOnlyBase< T >.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 1230 of file Csla/ReadOnlyBase.cs.

◆ LoadProperty()

virtual void Csla.ReadOnlyBase< T >.LoadProperty ( IPropertyInfo  propertyInfo,
object  newValue 
)
protectedvirtual

Loads a property's managed field with the supplied value calling PropertyHasChanged if the value does change.

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 1376 of file Csla/ReadOnlyBase.cs.

◆ LoadProperty< P >()

void Csla.ReadOnlyBase< T >.LoadProperty< P > ( PropertyInfo< P >  propertyInfo,
newValue 
)
protected

Loads a property's managed field with the supplied value 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.

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 1329 of file Csla/ReadOnlyBase.cs.

◆ LoadPropertyAsync< R >()

void Csla.ReadOnlyBase< T >.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 1445 of file Csla/ReadOnlyBase.cs.

◆ LoadPropertyConvert< P, F >()

void Csla.ReadOnlyBase< T >.LoadPropertyConvert< P, F > ( PropertyInfo< P >  propertyInfo,
newValue 
)
protected

Loads a property's managed field with the supplied value calling PropertyHasChanged if the value does change.

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 1269 of file Csla/ReadOnlyBase.cs.

◆ MarkBusy()

void Csla.ReadOnlyBase< T >.MarkBusy ( )
protected

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

Definition at line 1485 of file Csla/ReadOnlyBase.cs.

◆ MarkIdle()

void Csla.ReadOnlyBase< T >.MarkIdle ( )
protected

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

Definition at line 1499 of file Csla/ReadOnlyBase.cs.

◆ OnBusyChanged() [1/2]

virtual void Csla.ReadOnlyBase< T >.OnBusyChanged ( BusyChangedEventArgs  args)
protectedvirtual

Raises the BusyChanged event.

Parameters
argsEvent arguments.

Definition at line 1567 of file Csla/ReadOnlyBase.cs.

◆ OnBusyChanged() [2/2]

void Csla.ReadOnlyBase< T >.OnBusyChanged ( string  propertyName,
bool  busy 
)
protected

Raises the BusyChanged event.

Parameters
propertyNameName of the property that has changed.
busyNew busy value.

Definition at line 1557 of file Csla/ReadOnlyBase.cs.

◆ OnDeserialized()

virtual void Csla.ReadOnlyBase< T >.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 513 of file Csla/ReadOnlyBase.cs.

◆ OnGetChildren()

override void Csla.ReadOnlyBase< T >.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 1693 of file Csla/ReadOnlyBase.cs.

◆ OnSetChildren()

override void Csla.ReadOnlyBase< T >.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 1715 of file Csla/ReadOnlyBase.cs.

◆ OnUnhandledAsyncException() [1/2]

virtual void Csla.ReadOnlyBase< T >.OnUnhandledAsyncException ( ErrorEventArgs  error)
protectedvirtual

Raises the UnhandledAsyncException event.

Parameters
errorError arguments.

Definition at line 1748 of file Csla/ReadOnlyBase.cs.

◆ OnUnhandledAsyncException() [2/2]

void Csla.ReadOnlyBase< T >.OnUnhandledAsyncException ( object  originalSender,
Exception  error 
)
protected

Raises the UnhandledAsyncException event.

Parameters
originalSenderOriginal sender of the event.
errorExecption that occurred.

Definition at line 1761 of file Csla/ReadOnlyBase.cs.

◆ ReadProperty()

virtual object Csla.ReadOnlyBase< T >.ReadProperty ( IPropertyInfo  propertyInfo)
protectedvirtual

Gets a property's value as a specified type.

Parameters
propertyInfoPropertyInfo object containing property metadata.

Definition at line 1181 of file Csla/ReadOnlyBase.cs.

◆ ReadProperty< P >()

P Csla.ReadOnlyBase< T >.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 1156 of file Csla/ReadOnlyBase.cs.

◆ ReadPropertyConvert< F, P >()

P Csla.ReadOnlyBase< T >.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 1143 of file Csla/ReadOnlyBase.cs.

◆ RegisterMethod() [1/4]

static MethodInfo Csla.ReadOnlyBase< T >.RegisterMethod ( Expression< Action< T > >  methodLambdaExpression)
staticprotected

Registers the method.

Parameters
methodLambdaExpressionThe method lambda expression.
Returns

Definition at line 793 of file Csla/ReadOnlyBase.cs.

◆ RegisterMethod() [2/4]

static MethodInfo Csla.ReadOnlyBase< T >.RegisterMethod ( string  methodName)
staticprotected

Registers a method for use in Authorization.

Parameters
methodNameMethod name from nameof()
Returns

Definition at line 783 of file Csla/ReadOnlyBase.cs.

◆ RegisterMethod() [3/4]

static Csla.Core.IMemberInfo Csla.ReadOnlyBase< T >.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 750 of file Csla/ReadOnlyBase.cs.

◆ RegisterMethod() [4/4]

static MethodInfo Csla.ReadOnlyBase< T >.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 771 of file Csla/ReadOnlyBase.cs.

◆ RegisterProperty< P >() [1/14]

static PropertyInfo< P > Csla.ReadOnlyBase< T >.RegisterProperty< P > ( Expression< Func< T, object > >  propertyLambdaExpression)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyLambdaExpressionProperty Expression
Returns

Definition at line 581 of file Csla/ReadOnlyBase.cs.

◆ RegisterProperty< P >() [2/14]

static PropertyInfo< P > Csla.ReadOnlyBase< T >.RegisterProperty< P > ( Expression< Func< T, object > >  propertyLambdaExpression,
defaultValue 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyLambdaExpressionProperty Expression
defaultValueDefault Value for the property
Returns

Definition at line 596 of file Csla/ReadOnlyBase.cs.

◆ RegisterProperty< P >() [3/14]

static PropertyInfo< P > Csla.ReadOnlyBase< T >.RegisterProperty< P > ( Expression< Func< T, object > >  propertyLambdaExpression,
RelationshipTypes  relationship 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyLambdaExpressionProperty Expression
relationshipRelationship with property value.
Returns

Definition at line 680 of file Csla/ReadOnlyBase.cs.

◆ RegisterProperty< P >() [4/14]

static PropertyInfo< P > Csla.ReadOnlyBase< T >.RegisterProperty< P > ( Expression< Func< T, object > >  propertyLambdaExpression,
string  friendlyName 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyLambdaExpressionProperty Expression
friendlyNameFriendly description for a property to be used in databinding
Returns

Definition at line 624 of file Csla/ReadOnlyBase.cs.

◆ RegisterProperty< P >() [5/14]

static PropertyInfo< P > Csla.ReadOnlyBase< T >.RegisterProperty< P > ( Expression< Func< T, object > >  propertyLambdaExpression,
string  friendlyName,
defaultValue 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyLambdaExpressionProperty Expression
friendlyNameFriendly description for a property to be used in databinding
defaultValueDefault Value for the property
Returns

Definition at line 653 of file Csla/ReadOnlyBase.cs.

◆ RegisterProperty< P >() [6/14]

static PropertyInfo< P > Csla.ReadOnlyBase< T >.RegisterProperty< P > ( Expression< Func< T, object > >  propertyLambdaExpression,
string  friendlyName,
defaultValue,
RelationshipTypes  relationship 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyLambdaExpressionProperty Expression
friendlyNameFriendly description for a property to be used in databinding
defaultValueDefault Value for the property
relationshipRelationship with property value.
Returns

Definition at line 728 of file Csla/ReadOnlyBase.cs.

◆ RegisterProperty< P >() [7/14]

static PropertyInfo< P > Csla.ReadOnlyBase< T >.RegisterProperty< P > ( Expression< Func< T, object > >  propertyLambdaExpression,
string  friendlyName,
RelationshipTypes  relationship 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyLambdaExpressionProperty Expression
friendlyNameFriendly description for a property to be used in databinding
relationshipRelationship with property value.
Returns

Definition at line 696 of file Csla/ReadOnlyBase.cs.

◆ RegisterProperty< P >() [8/14]

static PropertyInfo< P > Csla.ReadOnlyBase< T >.RegisterProperty< P > ( PropertyInfo< P >  info)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property.
Parameters
infoPropertyInfo object for the property.
Returns
The provided IPropertyInfo object.

Definition at line 557 of file Csla/ReadOnlyBase.cs.

◆ RegisterProperty< P >() [9/14]

static PropertyInfo< P > Csla.ReadOnlyBase< T >.RegisterProperty< P > ( string  propertyName)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyNameProperty name from nameof()
Returns

Definition at line 569 of file Csla/ReadOnlyBase.cs.

◆ RegisterProperty< P >() [10/14]

static PropertyInfo< P > Csla.ReadOnlyBase< T >.RegisterProperty< P > ( string  propertyName,
RelationshipTypes  relationship 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyNameProperty name from nameof()
relationshipRelationship with property value.
Returns

Definition at line 667 of file Csla/ReadOnlyBase.cs.

◆ RegisterProperty< P >() [11/14]

static PropertyInfo< P > Csla.ReadOnlyBase< T >.RegisterProperty< P > ( string  propertyName,
string  friendlyName 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyNameProperty name from nameof()
friendlyNameFriendly description for a property to be used in databinding
Returns

Definition at line 611 of file Csla/ReadOnlyBase.cs.

◆ RegisterProperty< P >() [12/14]

static PropertyInfo< P > Csla.ReadOnlyBase< T >.RegisterProperty< P > ( string  propertyName,
string  friendlyName,
defaultValue 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyNameProperty name from nameof()
friendlyNameFriendly description for a property to be used in databinding
defaultValueDefault Value for the property
Returns

Definition at line 639 of file Csla/ReadOnlyBase.cs.

◆ RegisterProperty< P >() [13/14]

static PropertyInfo< P > Csla.ReadOnlyBase< T >.RegisterProperty< P > ( string  propertyName,
string  friendlyName,
defaultValue,
RelationshipTypes  relationship 
)
staticprotected

Indicates that the specified property belongs to the business object type.

Template Parameters
PType of property
Parameters
propertyNameProperty name from nameof()
friendlyNameFriendly description for a property to be used in databinding
defaultValueDefault Value for the property
relationshipRelationship with property value.
Returns

Definition at line 713 of file Csla/ReadOnlyBase.cs.

◆ RegisterProperty< P >() [14/14]

static PropertyInfo< P > Csla.ReadOnlyBase< T >.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 539 of file Csla/ReadOnlyBase.cs.

◆ ToString()

override string Csla.ReadOnlyBase< T >.ToString ( )

Returns a text representation of this object by returning the GetIdValue value in text form.

Definition at line 73 of file Csla/ReadOnlyBase.cs.

Property Documentation

◆ BusinessRules

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 156 of file Csla/ReadOnlyBase.cs.

◆ BusyChanged

BusyChangedEventHandler Csla.ReadOnlyBase< T >.BusyChanged
addremove

Event raised when the IsBusy property value has changed.

Definition at line 1544 of file Csla/ReadOnlyBase.cs.

◆ FieldManager

FieldDataManager Csla.ReadOnlyBase< T >.FieldManager
getprotected

Gets the PropertyManager object for this business object.

Definition at line 1460 of file Csla/ReadOnlyBase.cs.

◆ IsBusy

virtual bool Csla.ReadOnlyBase< T >.IsBusy
get

Gets a value indicating whether this object or any of its child objects are running an async operation.

Definition at line 1513 of file Csla/ReadOnlyBase.cs.

◆ IsSelfBusy

virtual bool Csla.ReadOnlyBase< T >.IsSelfBusy
get

Gets a value indicating whether this object is running an async operation.

Definition at line 1526 of file Csla/ReadOnlyBase.cs.

◆ UnhandledAsyncException

EventHandler<ErrorEventArgs> Csla.ReadOnlyBase< T >.UnhandledAsyncException
addremove

Event raised when an exception occurs on a background thread during an asynchronous operation.

Definition at line 1737 of file Csla/ReadOnlyBase.cs.