CSLA.NET 6.0.0
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.Core.IUseApplicationContext Csla.IReadOnlyBase Csla.Rules.IHostRules Csla.Core.INotifyBusy Csla.Security.IAuthorizeReadWrite Csla.Serialization.Mobile.ISerializationNotification Csla.Core.IReadOnlyObject Csla.Core.BindableBase

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 type. 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...
 
bool PropertyIsLoading (IPropertyInfo propertyInfo)
 Gets a value indicating whether a lazy loaded property is currently being retrieved. 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 (Csla.Core.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 type. 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 > (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 > (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

ApplicationContext ApplicationContext [getset]
 Gets or sets the current ApplicationContext object. More...
 
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< Csla.Core.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...
 
- Properties inherited from Csla.Core.IUseApplicationContext
ApplicationContext ApplicationContext [getset]
 Gets or sets the current ApplicationContext object. 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 ReadOnlyBase.cs.

Constructor & Destructor Documentation

◆ ReadOnlyBase()

Csla.ReadOnlyBase< T >.ReadOnlyBase ( )
protected

Creates an instance of the type.

Definition at line 105 of file 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.

Reimplemented in Csla.Test.Authorization.ReadOnlyPerson.

Definition at line 207 of file 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 317 of file 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 340 of file 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 362 of file 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 216 of file 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 240 of file 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 259 of file 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 503 of file 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 480 of file 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 491 of file 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 404 of file 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 468 of file 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 443 of file 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 455 of file 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 393 of file 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 62 of file 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 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 1013 of file 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 859 of file 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 880 of file 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 1084 of file 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 806 of file 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 827 of file 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 1036 of file 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 967 of file 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 994 of file 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 1062 of file 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 116 of file 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 898 of file 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 939 of file 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 1218 of file 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 1237 of file 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 1382 of file 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 1335 of file 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 1451 of file 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 1275 of file ReadOnlyBase.cs.

◆ MarkBusy()

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

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

Definition at line 1493 of file 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 1507 of file ReadOnlyBase.cs.

◆ OnBusyChanged() [1/2]

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

Raises the BusyChanged event.

Parameters
argsEvent arguments.

Definition at line 1575 of file 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 1565 of file 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 531 of file 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 1701 of file 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 1723 of file ReadOnlyBase.cs.

◆ OnUnhandledAsyncException() [1/2]

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

Raises the UnhandledAsyncException event.

Parameters
errorError arguments.

Definition at line 1756 of file 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 1769 of file ReadOnlyBase.cs.

◆ PropertyIsLoading()

bool Csla.ReadOnlyBase< T >.PropertyIsLoading ( IPropertyInfo  propertyInfo)
protected

Gets a value indicating whether a lazy loaded property is currently being retrieved.

Parameters
propertyInfoProperty to check.
Returns

Definition at line 914 of file 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 1188 of file 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 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 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 778 of file 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 768 of file 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 735 of file 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 756 of file ReadOnlyBase.cs.

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

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 599 of file ReadOnlyBase.cs.

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

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 682 of file ReadOnlyBase.cs.

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

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 626 of file ReadOnlyBase.cs.

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

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 655 of file ReadOnlyBase.cs.

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

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 713 of file ReadOnlyBase.cs.

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

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 575 of file ReadOnlyBase.cs.

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

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 587 of file ReadOnlyBase.cs.

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

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 669 of file ReadOnlyBase.cs.

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

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 613 of file ReadOnlyBase.cs.

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

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 641 of file ReadOnlyBase.cs.

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

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 698 of file ReadOnlyBase.cs.

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

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 557 of file 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 76 of file ReadOnlyBase.cs.

Property Documentation

◆ ApplicationContext

Gets or sets the current ApplicationContext object.

Definition at line 90 of file ReadOnlyBase.cs.

◆ 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 172 of file ReadOnlyBase.cs.

◆ BusyChanged

BusyChangedEventHandler Csla.ReadOnlyBase< T >.BusyChanged
addremove

Event raised when the IsBusy property value has changed.

Definition at line 1552 of file ReadOnlyBase.cs.

◆ FieldManager

FieldDataManager Csla.ReadOnlyBase< T >.FieldManager
getprotected

Gets the PropertyManager object for this business object.

Definition at line 1466 of file 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 1521 of file 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 1534 of file ReadOnlyBase.cs.

◆ UnhandledAsyncException

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

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

Definition at line 1745 of file ReadOnlyBase.cs.