Csla This is the base class from which most business objects will be derived. This class is the core of the CSLA .NET framework. To create a business object, inherit from this class. Please refer to 'Expert C# 2005 Business Objects' for full details on the use of this base class to create business objects. Type of the business object being defined. Override this method to return a unique identifying value for this object. If you can not provide a unique identifying value, it is best if you can generate such a unique value (even temporarily). If you can not do that, then return and then manually override the , and methods in your business object. Compares this object for equality with another object, using the results of to determine equality. The object to be compared. Returns a hash code value for this object, based on the results of . Returns a text representation of this object by returning the value in text form. Creates a clone of the object. A new object containing the exact data of the original object. Saves the object to the database. Calling this method starts the save operation, causing the object to be inserted, updated or deleted within the database based on the object's current state. If is the object will be deleted. Otherwise, if is the object will be inserted. Otherwise the object's data will be updated in the database. All this is contingent on . If this value is , no data operation occurs. It is also contingent on . If this value is an exception will be thrown to indicate that the UI attempted to save an invalid object. It is important to note that this method returns a new version of the business object that contains any data updated during the save operation. You MUST update all object references to use this new version of the business object in order to have access to the correct object data. You can override this method to add your own custom behaviors to the save operation. For instance, you may add some security checks to make sure the user can save the object. If all security checks pass, you would then invoke the base Save method via base.Save(). A new object containing the saved values. Saves the object to the database, forcing IsNew to and IsDirty to True. If , triggers overriding IsNew and IsDirty. If then it is the same as calling Save(). A new object containing the saved values. This overload is designed for use in web applications when implementing the Update method in your data wrapper object. Event raised when an object has been saved. Raises the Saved event, indicating that the object has been saved, and providing a reference to the new object instance. The new object instance. This is the base class from which most business collections or lists will be derived. Type of the business object being defined. Type of the child objects contained in the list. Creates an instance of the object. Override this method to set up event handlers so user code in a partial class can respond to events raised by generated code. Gets a value indicating whether this object's data has been changed. Gets a value indicating whether this object is currently in a valid state (has no broken validation rules). Starts a nested edit on the object. When this method is called the object takes a snapshot of its current state (the values of its variables). This snapshot can be restored by calling or committed by calling . This is a nested operation. Each call to BeginEdit adds a new snapshot of the object's state to a stack. You should ensure that for each call to BeginEdit there is a corresponding call to either CancelEdit or ApplyEdit to remove that snapshot from the stack. See Chapters 2 and 3 for details on n-level undo and state stacking. This method triggers the copying of all child object states. Cancels the current edit process, restoring the object's state to its previous values. Calling this method causes the most recently taken snapshot of the object's state to be restored. This resets the object's values to the point of the last call. This method triggers an undo in all child objects. Commits the current edit process. Calling this method causes the most recently taken snapshot of the object's state to be discarded, thus committing any changes made to the object's state since the last call. This method triggers an in all child objects. Override this method to be notified when a child object's method has completed. The child object that was edited. A collection containing all child objects marked for deletion. Returns if the internal deleted list contains the specified child object. Child object to check. This method is called by a child object when it wants to be removed from the collection. The child object to remove. This method is called by a child object when it wants to be removed from the collection. The child object to remove. Sets the edit level of the child object as it is added. Index of the item to insert. Item to insert. Marks the child object for deletion and moves it to the collection of deleted objects. Index of the item to remove. Clears the collection, moving all active items to the deleted list. Replaces the item at the specified index with the specified item, first moving the original item to the deleted list. The zero-based index of the item to replace. The new value for the item at the specified index. The value can be null for reference types. Returns the current edit level of the object. Indicates whether this collection object is a child object. True if this is a child object. Marks the object as being a child object. By default all business objects are 'parent' objects. This means that they can be directly retrieved and updated into the database. We often also need child objects. These are objects which are contained within other objects. For instance, a parent Invoice object will contain child LineItem objects. To create a child object, the MarkAsChild method must be called as the object is created. Please see Chapter 7 for details on the use of the MarkAsChild method. Creates a clone of the object. A new object containing the exact data of the original object. Creates a clone of the object. A new object containing the exact data of the original object. This method is called on a newly deserialized object after deserialization is complete. Saves the object to the database. Calling this method starts the save operation, causing the all child objects to be inserted, updated or deleted within the database based on the each object's current state. All this is contingent on . If this value is , no data operation occurs. It is also contingent on . If this value is an exception will be thrown to indicate that the UI attempted to save an invalid object. It is important to note that this method returns a new version of the business collection that contains any data updated during the save operation. You MUST update all object references to use this new version of the business collection in order to have access to the correct object data. You can override this method to add your own custom behaviors to the save operation. For instance, you may add some security checks to make sure the user can save the object. If all security checks pass, you would then invoke the base Save method via MyBase.Save(). A new object containing the saved values. Override this method to load a new business object with default values from the database. Override this method to allow retrieval of an existing business object based on data in the database. An object containing criteria values to identify the object. Override this method to allow update of a business object. Override this method to allow immediate deletion of a business object. An object containing criteria values to identify the object. Called by the server-side DataPortal prior to calling the requested DataPortal_xyz method. The DataPortalContext object passed to the DataPortal. Called by the server-side DataPortal after calling the requested DataPortal_xyz method. The DataPortalContext object passed to the DataPortal. Called by the server-side DataPortal if an exception occurs during data access. The DataPortalContext object passed to the DataPortal. The Exception thrown during data access. Event raised when an object has been saved. Raises the event, indicating that the object has been saved, and providing a reference to the new object instance. The new object instance. This is the base class from which command objects will be derived. Command objects allow the execution of arbitrary server-side functionality. Most often, this involves the invocation of a stored procedure in the database, but can involve any other type of stateless, atomic call to the server instead. To implement a command object, inherit from CommandBase and override the DataPortal_Execute method. In this method you can implement any server-side code as required. To pass data to/from the server, use instance variables within the command object itself. The command object is instantiated on the client, and is passed by value to the server where the DataPortal_Execute method is invoked. The command object is then returned to the client by value. Creates an instance of the object. Override this method to set up event handlers so user code in a partial class can respond to events raised by generated code. Override this method to implement any server-side code that is to be run when the command is executed. Called by the server-side DataPortal prior to calling the requested DataPortal_xyz method. The DataPortalContext object passed to the DataPortal. Called by the server-side DataPortal after calling the requested DataPortal_xyz method. The DataPortalContext object passed to the DataPortal. Called by the server-side DataPortal if an exception occurs during server-side processing. The DataPortalContext object passed to the DataPortal. The Exception thrown during processing. This class implements INotifyPropertyChanged in a serialization-safe manner. Creates an instance of the object. Implements a serialization-safe PropertyChanged event. Call this method to raise the PropertyChanged event for all object properties. This method is for backward compatibility with CSLA .NET 1.x. Call this method to raise the PropertyChanged event for all object properties. This method is automatically called by MarkDirty. It actually raises PropertyChanged for an empty string, which tells data binding to refresh all properties. Call this method to raise the PropertyChanged event for a specific property. Name of the property that has changed. This method may be called by properties in the business class to indicate the change in a specific property. This is the non-generic base class from which most business objects will be derived. See Chapter 3 for details. Creates an instance of the object. Override this method to set up event handlers so user code in a partial class can respond to events raised by generated code. Returns if this is a new object, if it is a pre-existing object. An object is considered to be new if its primary identifying (key) value doesn't correspond to data in the database. In other words, if the data values in this particular object have not yet been saved to the database the object is considered to be new. Likewise, if the object's data has been deleted from the database then the object is considered to be new. A value indicating if this object is new. Returns if this object is marked for deletion. CSLA .NET supports both immediate and deferred deletion of objects. This property is part of the support for deferred deletion, where an object can be marked for deletion, but isn't actually deleted until the object is saved to the database. This property indicates whether or not the current object has been marked for deletion. If it is , the object will be deleted when it is saved to the database, otherwise it will be inserted or updated by the save operation. A value indicating if this object is marked for deletion. Returns if this object's data has been changed. When an object's data is changed, CSLA .NET makes note of that change and considers the object to be 'dirty' or changed. This value is used to optimize data updates, since an unchanged object does not need to be updated into the database. All new objects are considered dirty. All objects marked for deletion are considered dirty. Once an object's data has been saved to the database (inserted or updated) the dirty flag is cleared and the object is considered unchanged. Objects newly loaded from the database are also considered unchanged. A value indicating if this object's data has been changed. Marks the object as being a new object. This also marks the object as being dirty and ensures that it is not marked for deletion. Newly created objects are marked new by default. You should call this method in the implementation of DataPortal_Update when the object is deleted (due to being marked for deletion) to indicate that the object no longer reflects data in the database. If you override this method, make sure to call the base implementation after executing your new code. Marks the object as being an old (not new) object. This also marks the object as being unchanged (not dirty). You should call this method in the implementation of DataPortal_Fetch to indicate that an existing object has been successfully retrieved from the database. You should call this method in the implementation of DataPortal_Update to indicate that a new object has been successfully inserted into the database. If you override this method, make sure to call the base implementation after executing your new code. Marks an object for deletion. This also marks the object as being dirty. You should call this method in your business logic in the case that you want to have the object deleted when it is saved to the database. Marks an object as being dirty, or changed. You should call this method in your business logic any time the object's internal data changes. Any time any instance variable changes within the object, this method should be called to tell CSLA .NET that the object's data has been changed. Marking an object as dirty does two things. First it ensures that CSLA .NET will properly save the object as appropriate. Second, it causes CSLA .NET to tell Windows Forms data binding that the object's data has changed so any bound controls will update to reflect the new values. Marks an object as being dirty, or changed. to supress the PropertyChanged event that is otherwise raised to indicate that the object's state has changed. Performs processing required when the current property has changed. This method calls CheckRules(propertyName), MarkDirty and OnPropertyChanged(propertyName). MarkDirty is called such that no event is raised for IsDirty, so only the specific property changed event for the current property is raised. This implementation uses System.Diagnostics.StackTrace to determine the name of the current property, and so must be called directly from the property to be checked. Performs processing required when a property has changed. Name of the property that has changed. This method calls CheckRules(propertyName), MarkDirty and OnPropertyChanged(propertyName). MarkDirty is called such that no event is raised for IsDirty, so only the specific property changed event for the current property is raised. Forces the object's IsDirty flag to . This method is normally called automatically and is not intended to be called manually. Returns if this object is both dirty and valid. An object is considered dirty (changed) if returns . It is considered valid if IsValid returns . The IsSavable property is a combination of these two properties. A value indicating if this object is both dirty and valid. Override this method to add authorization rules for your object's properties. AddInstanceAuthorizationRules is automatically called by CSLA .NET when your object should associate per-instance authorization roles with its properties. Override this method to add per-type authorization rules for your type's properties. AddAuthorizationRules is automatically called by CSLA .NET when your object should associate per-type authorization roles with its properties. Provides access to the AuthorizationRules object for this object. Use this object to add a list of allowed and denied roles for reading and writing properties of the object. Typically these values are added once when the business object is instantiated. Returns if the user is allowed to read the calling property. if read is allowed. Indicates whether a negative result should cause an exception. Returns if the user is allowed to read the calling property. if read is allowed. Name of the property to read. Indicates whether a negative result should cause an exception. Returns if the user is allowed to read the calling property. if read is allowed. Returns if the user is allowed to read the specified property. Name of the property to read. if read is allowed. If a list of allowed roles is provided then only users in those roles can read. If no list of allowed roles is provided then the list of denied roles is checked. If a list of denied roles is provided then users in the denied roles are denied read access. All other users are allowed. If neither a list of allowed nor denied roles is provided then all users will have read access. Returns if the user is allowed to write the calling property. if write is allowed. Indicates whether a negative result should cause an exception. Returns if the user is allowed to write the calling property. if write is allowed. Name of the property to write. Indicates whether a negative result should cause an exception. Returns if the user is allowed to write the calling property. if write is allowed. Returns if the user is allowed to write the specified property. Name of the property to write. if write is allowed. If a list of allowed roles is provided then only users in those roles can write. If no list of allowed roles is provided then the list of denied roles is checked. If a list of denied roles is provided then users in the denied roles are denied write access. All other users are allowed. If neither a list of allowed nor denied roles is provided then all users will have write access. Provide access to the parent reference for use in child object code. This value will be Nothing for root objects. Used by BusinessListBase as a child object is created to tell the child object about its parent. A reference to the parent collection object. Allow data binding to start a nested edit on the object. Data binding may call this method many times. Only the first call should be honored, so we have extra code to detect this and do nothing for subsquent calls. Allow data binding to cancel the current edit. Data binding may call this method many times. Only the first call to either IEditableObject.CancelEdit or IEditableObject.EndEdit should be honored. We include extra code to detect this and do nothing for subsequent calls. Allow data binding to apply the current edit. Data binding may call this method many times. Only the first call to either IEditableObject.EndEdit or IEditableObject.CancelEdit should be honored. We include extra code to detect this and do nothing for subsequent calls. Starts a nested edit on the object. When this method is called the object takes a snapshot of its current state (the values of its variables). This snapshot can be restored by calling CancelEdit or committed by calling ApplyEdit. This is a nested operation. Each call to BeginEdit adds a new snapshot of the object's state to a stack. You should ensure that for each call to BeginEdit there is a corresponding call to either CancelEdit or ApplyEdit to remove that snapshot from the stack. See Chapters 2 and 3 for details on n-level undo and state stacking. Cancels the current edit process, restoring the object's state to its previous values. Calling this method causes the most recently taken snapshot of the object's state to be restored. This resets the object's values to the point of the last BeginEdit call. Called when an undo operation has completed. This method resets the object as a result of deserialization and raises PropertyChanged events to notify data binding that the object has changed. Commits the current edit process. Calling this method causes the most recently taken snapshot of the object's state to be discarded, thus committing any changes made to the object's state since the last BeginEdit call. Notifies the parent object (if any) that this child object's edits have been accepted. Returns if this is a child (non-root) object. Marks the object as being a child object. Marks the object for deletion. The object will be deleted as part of the next save operation. CSLA .NET supports both immediate and deferred deletion of objects. This method is part of the support for deferred deletion, where an object can be marked for deletion, but isn't actually deleted until the object is saved to the database. This method is called by the UI developer to mark the object for deletion. To 'undelete' an object, use n-level undo as discussed in Chapters 2 and 3. Called by a parent object to mark the child for deferred deletion. Gets or sets the current edit level of the object. Allow the collection object to use the edit level as needed. Creates a clone of the object. A new object containing the exact data of the original object. 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 validation rules with your object's properties. Override this method in your business class to be notified when you need to set up business rules. This method is automatically called by CSLA .NET when your object should associate per-instance validation rules with its properties. Override this method in your business class to be notified when you need to set up shared business rules. This method is automatically called by CSLA .NET when your object should associate per-type validation rules with its properties. Returns if the object is currently valid, if the object has broken rules or is otherwise invalid. By default this property relies on the underling ValidationRules object to track whether any business rules are currently broken for this object. You can override this property to provide more sophisticated implementations of the behavior. For instance, you should always override this method if your object has child objects, since the validity of this object is affected by the validity of all child objects. A value indicating if the object is currently valid. Provides access to the readonly collection of broken business rules for this object. A Csla.Validation.RulesCollection object. Override this method to load a new business object with default values from the database. Normally you will overload this method to accept a strongly-typed criteria parameter, rather than overriding the method with a loosely-typed criteria parameter. Override this method to allow retrieval of an existing business object based on data in the database. Normally you will overload this method to accept a strongly-typed criteria parameter, rather than overriding the method with a loosely-typed criteria parameter. An object containing criteria values to identify the object. Override this method to allow insertion of a business object. Override this method to allow update of a business object. Override this method to allow deferred deletion of a business object. Override this method to allow immediate deletion of a business object. An object containing criteria values to identify the object. Called by the server-side DataPortal prior to calling the requested DataPortal_XYZ method. The DataPortalContext object passed to the DataPortal. Called by the server-side DataPortal after calling the requested DataPortal_XYZ method. The DataPortalContext object passed to the DataPortal. Called by the server-side DataPortal if an exception occurs during data access. The DataPortalContext object passed to the DataPortal. The Exception thrown during data access. This method is called on a newly deserialized object after deserialization is complete. Serialization context object. Extends BindingList of T by adding extra events. Type of item contained in list. Implements a serialization-safe RemovingItem event. Raise the RemovingItem event. A reference to the item that is being removed. Remove the item at the specified index. The zero-based index of the item to remove. Defines the common methods required by all editable CSLA single objects. It is strongly recommended that the implementations of the methods in this interface be made Private so as to not clutter up the native interface of the collection objects. Returns if this object's data has been changed. When an object's data is changed, CSLA .NET makes note of that change and considers the object to be 'dirty' or changed. This value is used to optimize data updates, since an unchanged object does not need to be updated into the database. All new objects are considered dirty. All objects marked for deletion are considered dirty. Once an object's data has been saved to the database (inserted or updated) the dirty flag is cleared and the object is considered unchanged. Objects newly loaded from the database are also considered unchanged. A value indicating if this object's data has been changed. Returns if the object is currently valid, if the object has broken rules or is otherwise invalid. By default this property relies on the underling ValidationRules object to track whether any business rules are currently broken for this object. You can override this property to provide more sophisticated implementations of the behavior. For instance, you should always override this method if your object has child objects, since the validity of this object is affected by the validity of all child objects. A value indicating if the object is currently valid. Returns if this object is marked for deletion. CSLA .NET supports both immediate and deferred deletion of objects. This property is part of the support for deferred deletion, where an object can be marked for deletion, but isn't actually deleted until the object is saved to the database. This property indicates whether or not the current object has been marked for deletion. If it is , the object will be deleted when it is saved to the database, otherwise it will be inserted or updated by the save operation. A value indicating if this object is marked for deletion. Returns if this is a new object, if it is a pre-existing object. An object is considered to be new if its primary identifying (key) value doesn't correspond to data in the database. In other words, if the data values in this particular object have not yet been saved to the database the object is considered to be new. Likewise, if the object's data has been deleted from the database then the object is considered to be new. A value indicating if this object is new. Returns if this object is both dirty and valid. An object is considered dirty (changed) if returns . It is considered valid if IsValid returns . The IsSavable property is a combination of these two properties. A value indicating if this object is both dirty and valid. For internal use only!! Altering this value will almost certainly break your code. This property is for use by the parent collection only! Gets the current edit level of the object. Called by a parent object to mark the child for deferred deletion. Used by BusinessListBase as a child object is created to tell the child object about its parent. A reference to the parent collection object. Marks the object for deletion. The object will be deleted as part of the next save operation. Extends by adding extra events. Event indicating that an item is being removed from the list. Defines the interface that must be implemented by any business object that contains child objects. This method is called by a child object when it wants to be removed from the collection. The child object to remove. Override this method to be notified when a child object's method has completed. The child object that was edited. Implement this interface in a collection to report a total row count to , where that row count is different from the collection's normal Count property value. This interface is used to provide paging support for web data binding through . You should implement this interface in your business collection class, along with windowed data loading, to provide efficient paging support. The total number of rows of available data. Specifies that the object can save itself. Saves the object to the database. A new object containing the saved values. Event raised when an object has been saved. Defines the methods required to participate in n-level undo within the CSLA .NET framework. This interface is used by Csla.Core.UndoableBase to initiate begin, cancel and apply edit operations. Copies the state of the object and places the copy onto the state stack. Restores the object's state to the most recently copied values from the state stack. Restores the state of the object to its previous value by taking the data out of the stack and restoring it into the fields of the object. Accepts any changes made to the object since the last state copy was made. The most recent state copy is removed from the state stack and discarded, thus committing any changes made to the object's state. This is the core interface implemented by all CSLA .NET base classes. This interface is implemented by all Command objects. Defines the common methods required by all editable CSLA collection objects. It is strongly recommended that the implementations of the methods in this interface be made Private so as to not clutter up the native interface of the collection objects. Removes the specified child from the parent collection. Child object to be removed. Interface implemented by all read-only collection classes. Specifies that the object is a readonly business object. Returns if the user is allowed to read the calling property. Name of the property to read. Clones an object by using the . The object to clone. The object to be cloned must be serializable. A readonly version of BindingList(Of T) Type of item contained in the list. This is a subclass of BindingList(Of T) that implements a readonly list, preventing adding and removing of items from the list. Use the IsReadOnly property to unlock the list for loading/unloading data. Gets or sets a value indicating whether the list is readonly. Subclasses can set this value to unlock the collection in order to alter the collection's data. True indicates that the list is readonly. Creates an instance of the object. Prevents clearing the collection. Prevents insertion of items into the collection. Prevents insertion of items into the collection. Index at which to insert the item. Item to insert. Removes the item at the specified index if the collection is not in readonly mode. Index of the item to remove. Replaces the item at the specified index with the specified item if the collection is not in readonly mode. Index of the item to replace. New item for the list. Contains event data for the RemovingItem event. Gets a reference to the item that was removed from the list. Create an instance of the object. A reference to the item that was removed from the list. Event arguments containing a reference to the new object that was returned as a result of the Save() operation. Gets the object that was returned as a result of the Save() operation. Creates an instance of the object. The object that was returned as a result of the Save() operation. Implements n-level undo capabilities as described in Chapters 2 and 3. Creates an instance of the object. Returns the current edit level of the object. This method is invoked after the CopyState operation is complete. Copies the state of the object and places the copy onto the state stack. This method is invoked after the UndoChanges operation is complete. Restores the object's state to the most recently copied values from the state stack. Restores the state of the object to its previous value by taking the data out of the stack and restoring it into the fields of the object. This method is invoked after the AcceptChanges operation is complete. Accepts any changes made to the object since the last state copy was made. The most recent state copy is removed from the state stack and discarded, thus committing any changes made to the object's state. Provides consistent context information between the client and server DataPortal objects. Get or set the current object representing the user's identity. This is discussed in Chapter 5. When running under IIS the HttpContext.Current.User value is used, otherwise the current Thread.CurrentPrincipal value is used. Returns the application-specific context data that is local to the current AppDomain. The return value is a HybridDictionary. If one does not already exist, and empty one is created and returned. Note that data in this context is NOT transferred to and from the client and server. Returns the application-specific context data provided by the client. The return value is a HybridDictionary. If one does not already exist, and empty one is created and returned. Note that data in this context is transferred from the client to the server. No data is transferred from the server to the client. This property is thread safe in a Windows client setting and on an application server. It is not guaranteed to be thread safe within the context of an ASP.NET client setting (i.e. in your ASP.NET UI). Returns the application-specific context data shared on both client and server. The return value is a HybridDictionary. If one does not already exist, and empty one is created and returned. Note that data in this context is transferred to and from the client and server. Any objects or data in this context will be transferred bi-directionally across the network. Clears all context collections. Returns the authentication type being used by the CSLA .NET framework. This value is read from the application configuration file with the key value "CslaAuthentication". The value "Windows" indicates CSLA .NET should use Windows integrated (or AD) security. Any other value indicates the use of custom security derived from BusinessPrincipalBase. Returns the channel or network protocol for the DataPortal server. Fully qualified assembly/type name of the proxy class. This value is read from the application configuration file with the key value "CslaDataPortalProxy". The proxy class must implement Csla.Server.IDataPortalServer. The value "Local" is a shortcut to running the DataPortal "server" in the client process. Other built-in values include: Csla,Csla.DataPortalClient.RemotingProxy Use .NET Remoting to communicate with the server Csla,Csla.DataPortalClient.EnterpriseServicesProxy Use Enterprise Services (DCOM) to communicate with the server Csla,Csla.DataPortalClient.WebServicesProxy Use Web Services (asmx) to communicate with the server Each proxy type does require that the DataPortal server be hosted using the appropriate technology. For instance, Web Services and Remoting should be hosted in IIS, while Enterprise Services must be hosted in COM+. Returns the URL for the DataPortal server. This value is read from the application configuration file with the key value "CslaDataPortalUrl". Enum representing the locations code can execute. The code is executing on the client. The code is executing on the application server. Returns a value indicating whether the application code is currently executing on the client or server. This is the client-side DataPortal as described in Chapter 4. Raised by DataPortal prior to calling the requested server-side DataPortal method. Raised by DataPortal after the requested server-side DataPortal method call is complete. Called by a factory method in a business class to create a new object, which is loaded with default values from the database. Specific type of the business object. Object-specific criteria. A new object, populated with default values. Called by a factory method in a business class to create a new object, which is loaded with default values from the database. Specific type of the business object. A new object, populated with default values. Called by a factory method in a business class to create a new object, which is loaded with default values from the database. Object-specific criteria. A new object, populated with default values. Called by a factory method in a business class to retrieve an object, which is loaded with values from the database. Specific type of the business object. Object-specific criteria. An object populated with values from the database. Called by a factory method in a business class to retrieve an object, which is loaded with values from the database. Specific type of the business object. An object populated with values from the database. Called by a factory method in a business class to retrieve an object, which is loaded with values from the database. Object-specific criteria. An object populated with values from the database. Called to execute a Command object on the server. To be a Command object, the object must inherit from CommandBase. Note that this method returns a reference to the updated business object. If the server-side DataPortal is running remotely, this will be a new and different object from the original, and all object references MUST be updated to use this new object. On the server, the Command object's DataPortal_Execute() method will be invoked. Write any server-side code in that method. Specific type of the Command object. A reference to the Command object to be executed. A reference to the updated Command object. Called to execute a Command object on the server. Note that this method returns a reference to the updated business object. If the server-side DataPortal is running remotely, this will be a new and different object from the original, and all object references MUST be updated to use this new object. On the server, the Command object's DataPortal_Execute() method will be invoked. Write any server-side code in that method. A reference to the Command object to be executed. A reference to the updated Command object. Called by the business object's Save() method to insert, update or delete an object in the database. Note that this method returns a reference to the updated business object. If the server-side DataPortal is running remotely, this will be a new and different object from the original, and all object references MUST be updated to use this new object. Specific type of the business object. A reference to the business object to be updated. A reference to the updated business object. Called by the business object's Save() method to insert, update or delete an object in the database. Note that this method returns a reference to the updated business object. If the server-side DataPortal is running remotely, this will be a new and different object from the original, and all object references MUST be updated to use this new object. A reference to the business object to be updated. A reference to the updated business object. Called by a Shared (static in C#) method in the business class to cause immediate deletion of a specific object from the database. Object-specific criteria. Implements a data portal proxy to relay data portal calls to an application server hosted in COM+. Override this method to return a reference to the server-side COM+ (ServicedComponent) object implementing the data portal server functionality. Called by to create a new business object. Type of business object to create. Criteria object describing business object. object passed to the server. Called by to load an existing business object. Type of business object to retrieve. Criteria object describing business object. object passed to the server. Called by to update a business object. The business object to update. object passed to the server. Called by to delete a business object. Criteria object describing business object. object passed to the server. Get a value indicating whether this proxy will invoke a remote data portal server, or run the "server-side" data portal in the caller's process and AppDomain. Interface implemented by client-side data portal proxy objects. Get a value indicating whether this proxy will invoke a remote data portal server, or run the "server-side" data portal in the caller's process and AppDomain. Implements a data portal proxy to relay data portal calls to an application server hosted locally in the client process and AppDomain. Called by to create a new business object. Type of business object to create. Criteria object describing business object. object passed to the server. Called by to load an existing business object. Type of business object to retrieve. Criteria object describing business object. object passed to the server. Called by to update a business object. The business object to update. object passed to the server. Called by to delete a business object. Criteria object describing business object. object passed to the server. Get a value indicating whether this proxy will invoke a remote data portal server, or run the "server-side" data portal in the caller's process and AppDomain. Implements a data portal proxy to relay data portal calls to a remote application server by using the .NET Remoting technology. Configure .NET Remoting to use a binary serialization technology even when using the HTTP channel. Also ensures that the user's Windows credentials are passed to the server appropriately. Called by to create a new business object. Type of business object to create. Criteria object describing business object. object passed to the server. Called by to load an existing business object. Type of business object to retrieve. Criteria object describing business object. object passed to the server. Called by to update a business object. The business object to update. object passed to the server. Called by to delete a business object. Criteria object describing business object. object passed to the server. Get a value indicating whether this proxy will invoke a remote data portal server, or run the "server-side" data portal in the caller's process and AppDomain. Implements a data portal proxy to relay data portal calls to a remote application server by using Web services. Called by to create a new business object. Type of business object to create. Criteria object describing business object. object passed to the server. Called by to load an existing business object. Type of business object to retrieve. Criteria object describing business object. object passed to the server. Called by to update a business object. The business object to update. object passed to the server. Called by to delete a business object. Criteria object describing business object. object passed to the server. Get a value indicating whether this proxy will invoke a remote data portal server, or run the "server-side" data portal in the caller's process and AppDomain. Base type from which Criteria classes can be derived in a business class. Type of the business object to be instantiated by the server-side DataPortal. Initializes CriteriaBase with the type of business object to be created by the DataPortal. The type of the business object the data portal should create. Provides information about the DataPortal call. The DataPortalContext object passed to the server-side DataPortal. Creates an instance of the object. Data portal context object. This exception is returned for any errors occuring during the server-side DataPortal invocation. Returns a reference to the business object from the server-side DataPortal. Remember that this object may be in an invalid or undefined state. This is the business object (and any child objects) as it existed when the exception occured on the server. Thus the object state may have been altered by the server and may no longer reflect data in the database. Gets the original server-side exception. An exception object. When an exception occurs in business code behind the data portal, it is wrapped in a , which is then wrapped in a . This property unwraps and returns the original exception thrown by the business code on the server. Get the combined stack trace from the server and client. Creates an instance of the object. Text describing the exception. The business object as it was at the time of the exception. Creates an instance of the object. Text describing the exception. Inner exception. The business object as it was at the time of the exception. Creates an instance of the object for serialization. Serialiation info object. Serialization context object. Serializes the object. Serialiation info object. Serialization context object. Exposes server-side DataPortal functionality through Enterprise Services. Set up event handler to deal with serialization issue as discussed in Chapter 4. Create a new business object. Type of business object to create. Criteria object describing business object. object passed to the server. Get an existing business object. Type of business object to retrieve. Criteria object describing business object. object passed to the server. Update a business object. Business object to update. object passed to the server. Delete a business object. Criteria object describing business object. object passed to the server. Exposes server-side DataPortal functionality through .NET Remoting. Create a new business object. Type of business object to create. Criteria object describing business object. object passed to the server. Get an existing business object. Type of business object to retrieve. Criteria object describing business object. object passed to the server. Update a business object. Business object to update. object passed to the server. Delete a business object. Criteria object describing business object. object passed to the server. Exposes server-side DataPortal functionality through Web Services (asmx). Request message for creating a new business object. Type of business object to create. Criteria object describing business object. Data portal context from client. Request message for retrieving an existing business object. Type of business object to create. Criteria object describing business object. Data portal context from client. Request message for updating a business object. Business object to be updated. Data portal context from client. Request message for deleting a business object. Criteria object describing business object. Data portal context from client. Create a new business object. Byte stream containing . Byte stream containing resulting object data. Get an existing business object. Byte stream containing . Byte stream containing resulting object data. Update a business object. Byte stream containing . Byte stream containing resulting object data. Delete a business object. Byte stream containing . Byte stream containing resulting object data. This exception is returned from the CallMethod method in the server-side DataPortal and contains the exception thrown by the underlying business object method that was being invoked. Get the stack trace from the original exception. Creates an instance of the object. Message text describing the exception. Inner exception object. Creates an instance of the object for deserialization. Serialization info. Serialiation context. Serializes the object. Serialization info. Serialization context. Implements the server-side DataPortal message router as discussed in Chapter 4. Create a new business object. Type of business object to create. Criteria object describing business object. object passed to the server. Get an existing business object. Type of business object to retrieve. Criteria object describing business object. object passed to the server. Update a business object. Business object to update. object passed to the server. Delete a business object. Criteria object describing business object. object passed to the server. Provides consistent context information between the client and server DataPortal objects. The current principal object if CSLA security is being used. Returns if the server-side DataPortal is running on a remote server via remoting. The culture setting on the client workstation. The culture setting on the client workstation. Creates a new DataPortalContext object. The current Principal object. Indicates whether the DataPortal is remote. This exception is returned from the server-side DataPortal and contains the exception and context data from the server. Returns the DataPortalResult object from the server. Get the server-side stack trace from the original exception. Creates an instance of the object. Text describing the exception. Inner exception. The data portal result object. Creates an instance of the object for serialization. Serialiation info object. Serialization context object. Serializes the object. Serialiation info object. Serialization context object. Returns data from the server-side DataPortal to the client-side DataPortal. Intended for internal CSLA .NET use only. The business object being returned from the server. The global context being returned from the server. Creates an instance of the object. Creates an instance of the object. Object to return as part of the result. Interface implemented by server-side data portal components. Create a new business object. Type of business object to create. Criteria object describing business object. object passed to the server. Get an existing business object. Type of business object to retrieve. Criteria object describing business object. object passed to the server. Update a business object. Business object to update. object passed to the server. Delete a business object. Criteria object describing business object. object passed to the server. Implements the server-side Serviced DataPortal described in Chapter 4. Wraps a Create call in a ServicedComponent. This method delegates to SimpleDataPortal but wraps that call within a COM+ transaction to provide transactional support. A Type object indicating the type of business object to be created. A custom criteria object providing any extra information that may be required to properly create the object. Context data from the client. A populated business object. Wraps a Fetch call in a ServicedComponent. This method delegates to SimpleDataPortal but wraps that call within a COM+ transaction to provide transactional support. Type of business object to retrieve. Object-specific criteria. Object containing context data from client. A populated business object. Wraps an Update call in a ServicedComponent. This method delegates to SimpleDataPortal but wraps that call within a COM+ transaction to provide transactional support. A reference to the object being updated. Context data from the client. A reference to the newly updated object. Wraps a Delete call in a ServicedComponent. This method delegates to SimpleDataPortal but wraps that call within a COM+ transaction to provide transactional support. Object-specific criteria. Context data from the client. Implements the server-side DataPortal as discussed in Chapter 4. Create a new business object. Type of business object to create. Criteria object describing business object. object passed to the server. Get an existing business object. Type of business object to retrieve. Criteria object describing business object. object passed to the server. Update a business object. Business object to update. object passed to the server. Delete a business object. Criteria object describing business object. object passed to the server. Implements the server-side Serviced DataPortal described in Chapter 4. Wraps a Create call in a TransactionScope This method delegates to SimpleDataPortal but wraps that call within a TransactionScope to provide transactional support via System.Transactions. A Type object indicating the type of business object to be created. A custom criteria object providing any extra information that may be required to properly create the object. Context data from the client. A populated business object. Called by the client-side DataProtal to retrieve an object. This method delegates to SimpleDataPortal but wraps that call within a TransactionScope to provide transactional support via System.Transactions. Type of business object to retrieve. Object-specific criteria. Object containing context data from client. A populated business object. Called by the client-side DataPortal to update an object. This method delegates to SimpleDataPortal but wraps that call within a TransactionScope to provide transactional support via System.Transactions. A reference to the object being updated. Context data from the client. A reference to the newly updated object. Called by the client-side DataPortal to delete an object. This method delegates to SimpleDataPortal but wraps that call within a TransactionScope to provide transactional support via System.Transactions. Object-specific criteria. Context data from the client. Gets a reference to the DataPortal_Create method for the specified business object type. Type of the business object. Criteria parameter value. If the criteria parameter value is an integer, that is a special flag indicating that the parameter should be considered missing (not Nothing/null - just not there). Gets a reference to the DataPortal_Fetch method for the specified business object type. Type of the business object. Criteria parameter value. If the criteria parameter value is an integer, that is a special flag indicating that the parameter should be considered missing (not Nothing/null - just not there). Uses reflection to dynamically invoke a method if that method is implemented on the target object. Uses reflection to dynamically invoke a method, throwing an exception if it is not implemented on the target object. Uses reflection to dynamically invoke a method, throwing an exception if it is not implemented on the target object. Uses reflection to locate a matching method on the target object. Returns a business object type based on the supplied criteria object. Returns information about the specified method, even if the parameter types are generic and are located in an abstract generic base class. Returns information about the specified method, finding the method based purely on the method name and number of parameters. Marks a DataPortal_XYZ method to be run on the client even if the server-side DataPortal is configured for remote use. Marks a DataPortal_XYZ method to run within the specified transactional context. Each business object method may be marked with this attribute to indicate which type of transactional technology should be used by the server-side DataPortal. The possible options are listed in the TransactionalTypes enum. If the Transactional attribute is not applied to a DataPortal_XYZ method then the Manual option is assumed. If the Transactional attribute is applied with no explicit choice for transactionType then the EnterpriseServices option is assumed. Both the EnterpriseServices and TransactionScope options provide 2-phase distributed transactional support. Marks a method to run within a COM+ transactional context. Marks a method to run within the specified type of transactional context. Specifies the transactional context within which the method should run. Gets the type of transaction requested by the business object method. Provides a list of possible transactional technologies to be used by the server-side DataPortal. Causes the server-side DataPortal to use Enterprise Services (COM+) transactions. Causes the server-side DataPortal to use System.Transactions TransactionScope style transactions. Causes the server-side DataPortal to use no explicit transactional technology. This option allows the business developer to implement their own transactions. Common options include ADO.NET transactions and System.Transactions TransactionScope. Map data from a source into a target object by copying public property values. Copies values from the source into the properties of the target. A name/value dictionary containing the source values. An object with properties to be set from the dictionary. The key names in the dictionary must match the property names on the target object. Target properties may not be readonly or indexed. Copies values from the source into the properties of the target. A name/value dictionary containing the source values. An object with properties to be set from the dictionary. A list of property names to ignore. These properties will not be set on the target object. The key names in the dictionary must match the property names on the target object. Target properties may not be readonly or indexed. Copies values from the source into the properties of the target. A name/value dictionary containing the source values. An object with properties to be set from the dictionary. A list of property names to ignore. These properties will not be set on the target object. If , any exceptions will be supressed. The key names in the dictionary must match the property names on the target object. Target properties may not be readonly or indexed. Copies values from the source into the properties of the target. An object containing the source values. An object with properties to be set from the dictionary. The property names and types of the source object must match the property names and types on the target object. Source properties may not be indexed. Target properties may not be readonly or indexed. Copies values from the source into the properties of the target. An object containing the source values. An object with properties to be set from the dictionary. A list of property names to ignore. These properties will not be set on the target object. The property names and types of the source object must match the property names and types on the target object. Source properties may not be indexed. Target properties may not be readonly or indexed. Copies values from the source into the properties of the target. An object containing the source values. An object with properties to be set from the dictionary. A list of property names to ignore. These properties will not be set on the target object. If , any exceptions will be supressed. The property names and types of the source object must match the property names and types on the target object. Source properties may not be indexed. Target properties may not be readonly or indexed. Properties to copy are determined based on the source object. Any properties on the source object marked with the equal to false are ignored. Sets an object's property with the specified value, coercing that value to the appropriate type if possible. Object containing the property to set. Name of the property to set. Value to set into the property. An ObjectAdapter is used to convert data in an object or collection into a DataTable. Fills the DataSet with data from an object or collection. The name of the DataTable being filled is will be the class name of the object acting as the data source. The DataTable will be inserted if it doesn't already exist in the DataSet. A reference to the DataSet to be filled. A reference to the object or collection acting as a data source. Fills the DataSet with data from an object or collection. The name of the DataTable being filled is specified as a parameter. The DataTable will be inserted if it doesn't already exist in the DataSet. A reference to the DataSet to be filled. A reference to the object or collection acting as a data source. Fills a DataTable with data values from an object or collection. A reference to the DataTable to be filled. A reference to the object or collection acting as a data source. This is a DataReader that 'fixes' any null values before they are returned to our business code. Get a reference to the underlying data reader object that actually contains the data from the data source. Initializes the SafeDataReader object to use data from the provided DataReader object. The source DataReader object containing the data. Gets a string value from the datareader. Returns empty string for null. Name of the column containing the value. Gets a string value from the datareader. Returns empty string for null. Ordinal column position of the value. Gets a value of type from the datareader. Name of the column containing the value. Gets a value of type from the datareader. Ordinal column position of the value. Gets an integer from the datareader. Returns 0 for null. Name of the column containing the value. Gets an integer from the datareader. Returns 0 for null. Ordinal column position of the value. Gets a double from the datareader. Returns 0 for null. Name of the column containing the value. Gets a double from the datareader. Returns 0 for null. Ordinal column position of the value. Gets a from the datareader. A null is converted into min possible date See Chapter 5 for more details on the SmartDate class. Name of the column containing the value. Gets a from the datareader. A null is converted into the min possible date See Chapter 5 for more details on the SmartDate class. Ordinal column position of the value. Gets a from the datareader. A null is converted into either the min or max possible date depending on the MinIsEmpty parameter. See Chapter 5 for more details on the SmartDate class. Name of the column containing the value. A flag indicating whether the min or max value of a data means an empty date. Gets a from the datareader. Ordinal column position of the value. A flag indicating whether the min or max value of a data means an empty date. Gets a Guid value from the datareader. Returns Guid.Empty for null. Name of the column containing the value. Gets a Guid value from the datareader. Returns Guid.Empty for null. Ordinal column position of the value. Reads the next row of data from the datareader. Moves to the next result set in the datareader. Closes the datareader. Returns the depth property value from the datareader. Returns the FieldCount property from the datareader. Gets a boolean value from the datareader. Returns for null. Name of the column containing the value. Gets a boolean value from the datareader. Returns for null. Ordinal column position of the value. Gets a byte value from the datareader. Returns 0 for null. Name of the column containing the value. Gets a byte value from the datareader. Returns 0 for null. Ordinal column position of the value. Invokes the GetBytes method of the underlying datareader. Returns 0 for null. Name of the column containing the value. Array containing the data. Offset position within the buffer. Offset position within the field. Length of data to read. Invokes the GetBytes method of the underlying datareader. Returns 0 for null. Ordinal column position of the value. Array containing the data. Offset position within the buffer. Offset position within the field. Length of data to read. Gets a char value from the datareader. Returns Char.MinValue for null. Name of the column containing the value. Gets a char value from the datareader. Returns Char.MinValue for null. Ordinal column position of the value. Invokes the GetChars method of the underlying datareader. Returns 0 for null. Name of the column containing the value. Array containing the data. Offset position within the buffer. Offset position within the field. Length of data to read. Invokes the GetChars method of the underlying datareader. Returns 0 for null. Ordinal column position of the value. Array containing the data. Offset position within the buffer. Offset position within the field. Length of data to read. Invokes the GetData method of the underlying datareader. Name of the column containing the value. Invokes the GetData method of the underlying datareader. Ordinal column position of the value. Invokes the GetDataTypeName method of the underlying datareader. Name of the column containing the value. Invokes the GetDataTypeName method of the underlying datareader. Ordinal column position of the value. Gets a date value from the datareader. Returns DateTime.MinValue for null. Name of the column containing the value. Gets a date value from the datareader. Returns DateTime.MinValue for null. Ordinal column position of the value. Gets a decimal value from the datareader. Returns 0 for null. Name of the column containing the value. Gets a decimal value from the datareader. Returns 0 for null. Ordinal column position of the value. Invokes the GetFieldType method of the underlying datareader. Name of the column containing the value. Invokes the GetFieldType method of the underlying datareader. Ordinal column position of the value. Gets a Single value from the datareader. Returns 0 for null. Name of the column containing the value. Gets a Single value from the datareader. Returns 0 for null. Ordinal column position of the value. Gets a Short value from the datareader. Returns 0 for null. Name of the column containing the value. Gets a Short value from the datareader. Returns 0 for null. Ordinal column position of the value. Gets a Long value from the datareader. Returns 0 for null. Name of the column containing the value. Gets a Long value from the datareader. Returns 0 for null. Ordinal column position of the value. Invokes the GetName method of the underlying datareader. Ordinal column position of the value. Gets an ordinal value from the datareader. Name of the column containing the value. Invokes the GetSchemaTable method of the underlying datareader. Invokes the GetValues method of the underlying datareader. An array of System.Object to copy the values into. Returns the IsClosed property value from the datareader. Invokes the IsDBNull method of the underlying datareader. Ordinal column position of the value. Returns a value from the datareader. Name of the column containing the value. Returns a value from the datareader. Ordinal column position of the value. Returns the RecordsAffected property value from the underlying datareader. Disposes the object. True if called by the public Dispose method. Disposes the object. Object finalizer. This is the base class from which collections of editable root business objects should be derived. Type of editable root object to contain within the collection. Your subclass should implement a factory method and should override or overload DataPortal_Fetch() to implement data retrieval. Saving (inserts or updates) of items in the collection should be handled through the SaveItem() method on the collection. Removing an item from the collection through Remove() or RemoveAt() causes immediate deletion of the object, by calling the object's Delete() and Save() methods. Saves the specified item in the list. Reference to the item to be saved. This method properly saves the child item, by making sure the item in the collection is properly replaced by the result of the Save() method call. Saves the specified item in the list. Index of the item to be saved. This method properly saves the child item, by making sure the item in the collection is properly replaced by the result of the Save() method call. Gives the new object a parent reference to this list. Index at which to insert the item. Item to insert. Removes an item from the list. Index of the item to be removed. This method is called on a newly deserialized object after deserialization is complete. Serialization context object. Override this method to allow retrieval of an existing business object based on data in the database. An object containing criteria values to identify the object. Called by the server-side DataPortal prior to calling the requested DataPortal_xyz method. The DataPortalContext object passed to the DataPortal. Called by the server-side DataPortal after calling the requested DataPortal_xyz method. The DataPortalContext object passed to the DataPortal. Called by the server-side DataPortal if an exception occurs during data access. The DataPortalContext object passed to the DataPortal. The Exception thrown during data access. Provides a filtered view into an existing IList(Of T). The type of the objects contained in the original list. Gets an enumerator object. Implemented by IList source object. Property on which to build the index. Implemented by IList source object. Implemented by IList source object. Implemented by IList source object. Implemented by IList source object. Sorts the list if the original list supports sorting. Property on which to sort. Direction of the sort. Finds an item in the view Name of the property to search Value to find Implemented by IList source object. Key value for which to search. Property to search for the key value. Returns True if the view is currently sorted. Raised to indicate that the list's data has changed. This event is raised if the underling IList object's data changes (assuming the underling IList also implements the IBindingList interface). It is also raised if the filter is changed to indicate that the view's data has changed. Raises the ListChanged event. Parameter for the event. Implemented by IList source object. Property for which the index should be removed. Removes any sort currently applied to the view. Returns the direction of the current sort. Returns the PropertyDescriptor of the current sort. Returns True since this object does raise the ListChanged event. Implemented by IList source object. Returns True. Sorting is supported. Copies the contents of the list to an array. Array to receive the data. Starting array index. Gets the number of items in the list. Adds an item to the list. Item to be added. Clears the list. Determines whether the specified item is contained in the list. Item to find. if the item is contained in the list. Gets the 0-based index of an item in the list. The item to find. 0-based index of the item in the list. Inserts an item into the list. Index at which to insert the item. Item to insert. Gets a value indicating whether the list is read-only. Removes an item from the list. Item to remove. if the remove succeeds. Removes an item from the list. Index of item to be removed. Gets or sets the item at the specified index. Index of the item. Item at the specified index. Creates a new view based on the provided IList object. The IList (collection) containing the data. Creates a new view based on the provided IList object. The IList (collection) containing the data. Delegate pointer to a method that implements the filter behavior. Gets or sets the filter provider method. Delegate pointer to a method that implements the filter behavior. Delegate pointer to a method that implements the filter behavior. If this value is set to Nothing (null in C#) then the default filter provider, will be used. The property on which the items will be filtered. A descriptor for the property on which the items in the collection will be filtered. Returns True if the view is currently filtered. Applies a filter to the view. The text name of the property on which to filter. The filter criteria. Applies a filter to the view. A PropertyDescriptor for the property on which to filter. The filter criteria. Removes the filter from the list, so the view reflects the state of the original list. Defines the method signature for a filter provider method used by FilteredBindingList. The object to be filtered. The filter criteria. if the item matches the filter. This is the base class from which readonly name/value collections should be derived. Type of the key values. Type of the values. Returns the value corresponding to the specified key. Key value for which to retrieve a value. Returns the key corresponding to the first occurance of the specified value in the list. Value for which to retrieve the key. Gets a value indicating whether the list contains the specified key. Key value for which to search. Gets a value indicating whether the list contains the specified value. Value for which to search. Creates an instance of the object. Override this method to set up event handlers so user code in a partial class can respond to events raised by generated code. Contains a key and value pair. The Key or Name value. The Value corresponding to the key/name. Creates an instance of the object. The key. The value. Creates a clone of the object. A new object containing the exact data of the original object. Creates a clone of the object. Default Criteria for retrieving simple name/value lists. This criteria merely specifies the type of collection to be retrieved. That type information is used by the DataPortal to create the correct type of collection object during data retrieval. Creates an instance of the object. The of the business collection class. Override this method to allow retrieval of an existing business object based on data in the database. An object containing criteria values to identify the object. Called by the server-side DataPortal prior to calling the requested DataPortal_XYZ method. The DataPortalContext object passed to the DataPortal. Called by the server-side DataPortal after calling the requested DataPortal_XYZ method. The DataPortalContext object passed to the DataPortal. Called by the server-side DataPortal if an exception occurs during data access. The DataPortalContext object passed to the DataPortal. The Exception thrown during data access. Marks a field to indicate that the value should not be copied as part of the undo process. Marking a variable with this attribute will cause the n-level undo process to ignore that variable's value. The value will not be included in a snapshot when BeginEdit is called, nor will it be restored when CancelEdit is called. A strongly-typed resource class, for looking up localized strings, etc. Returns the cached ResourceManager instance used by this class. Overrides the current thread's CurrentUICulture property for all resource lookups using this strongly typed resource class. Looks up a localized string similar to Principal must be of type BusinessPrincipal, not. Looks up a localized string similar to Changing an element is an invalid operation. Looks up a localized string similar to Can not directly mark a child object for deletion - use its parent collection. Looks up a localized string similar to Clear is an invalid operation. Looks up a localized string similar to Invalid operation - create not allowed. Looks up a localized string similar to Invalid operation - delete not allowed. Looks up a localized string similar to Error reading value:. Looks up a localized string similar to Invalid operation - execute not allowed. Looks up a localized string similar to failed. Looks up a localized string similar to failed on the server. Looks up a localized string similar to Invalid operation - fetch not allowed. Looks up a localized string similar to GetIdValue must not return Nothing. Looks up a localized string similar to Insert is an invalid operation. Looks up a localized string similar to Invalid operation - insert not allowed. Looks up a localized string similar to Invalid rule method (instance methods of the target object not allowed). Looks up a localized string similar to {0} can not exceed {1}. Looks up a localized string similar to method call failed. Looks up a localized string similar to not implemented. Looks up a localized string similar to {0} can not be less than {1}. Looks up a localized string similar to ApplyEdit is not valid on a child object. Looks up a localized string similar to BeginEdit is not valid on a child object. Looks up a localized string similar to CancelEdit is not valid on a child object. Looks up a localized string similar to Invalid for root objects - use Delete instead. Looks up a localized string similar to No principal object should be passed to DataPortal when using Windows integrated security. Looks up a localized string similar to Can not directly save a child object. Looks up a localized string similar to Object is still being edited and can not be saved. Looks up a localized string similar to Object is not valid and can not be saved. Looks up a localized string similar to No such value exists:. Looks up a localized string similar to Argument must not be Nothing. Looks up a localized string similar to Parent value can only be set for child objects. Looks up a localized string similar to Type parameter must be a primitive type. Looks up a localized string similar to Property copy failed. Looks up a localized string similar to Property get not allowed. Looks up a localized string similar to Property set not allowed. Looks up a localized string similar to {0} does not match regular expression. Looks up a localized string similar to Remove is an invalid operation. Looks up a localized string similar to t. Looks up a localized string similar to today. Looks up a localized string similar to tom. Looks up a localized string similar to tomorrow. Looks up a localized string similar to y. Looks up a localized string similar to yesterday. Looks up a localized string similar to {0} can not exceed {1} characters. Looks up a localized string similar to {0} required. Looks up a localized string similar to String value can not be converted to a date. Looks up a localized string similar to Failed to load type '{0}'. Looks up a localized string similar to Invalid operation - update not allowed. Looks up a localized string similar to Value is not a SmartDate. 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. Type of the business object. Override this method to return a unique identifying vlaue for this object. If you can not provide a unique identifying value, it is best if you can generate such a unique value (even temporarily). If you can not do that, then return and then manually override the , and methods in your business object. Compares this object for equality with another object, using the results of to determine equality. The object to be compared. Returns a hash code value for this object, based on the results of . Returns a text representation of this object by returning the value in text form. Creates an instance of the object. Override this method to set up event handlers so user code in a partial class can respond to events raised by generated code. Override this method to add authorization rules for your object's properties. 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. Provides access to the AuthorizationRules object for this object. Use this object to add a list of allowed and denied roles for reading and writing properties of the object. Typically these values are added once when the business object is instantiated. Returns if the user is allowed to read the calling property. if read is allowed. Indicates whether a negative result should cause an exception. Returns if the user is allowed to read the calling property. if read is allowed. Name of the property to read. Indicates whether a negative result should cause an exception. Returns if the user is allowed to read the calling property. if read is allowed. Returns if the user is allowed to read the specified property. Name of the property to read. if read is allowed. If a list of allowed roles is provided then only users in those roles can read. If no list of allowed roles is provided then the list of denied roles is checked. If a list of denied roles is provided then users in the denied roles are denied read access. All other users are allowed. If neither a list of allowed nor denied roles is provided then all users will have read access. Creates a clone of the object. A new object containing the exact data of the original object. Creates a clone of the object. A new object containing the exact data of the original object. Override this method to allow retrieval of an existing business object based on data in the database. An object containing criteria values to identify the object. Called by the server-side DataPortal prior to calling the requested DataPortal_xyz method. The DataPortalContext object passed to the DataPortal. Called by the server-side DataPortal after calling the requested DataPortal_xyz method. The DataPortalContext object passed to the DataPortal. Called by the server-side DataPortal if an exception occurs during data access. The DataPortalContext object passed to the DataPortal. The Exception thrown during data access. This method is called on a newly deserialized object after deserialization is complete. Serialization context object. This is the base class from which readonly collections of readonly objects should be derived. Type of the list class. Type of child objects contained in the list. Creates an instance of the object. Override this method to set up event handlers so user code in a partial class can respond to events raised by generated code. Creates a clone of the object. A new object containing the exact data of the original object. Creates a clone of the object. A new object containing the exact data of the original object. Override this method to allow retrieval of an existing business object based on data in the database. An object containing criteria values to identify the object. Called by the server-side DataPortal prior to calling the requested DataPortal_xyz method. The DataPortalContext object passed to the DataPortal. Called by the server-side DataPortal after calling the requested DataPortal_xyz method. The DataPortalContext object passed to the DataPortal. Called by the server-side DataPortal if an exception occurs during data access. The DataPortalContext object passed to the DataPortal. The Exception thrown during data access. The access types supported by authorization as discussed in Chapter 3. Roles allowed to read property. Roles denied read access to property. Roles allowed to set property. Roles denied write access to property. Maintains a list of allowed and denied user roles for each property. Creates an instance of the object, initializing it with the business object type. Type of the business object to which the rules apply. Specify the roles allowed to read a given property. Name of the property. List of roles granted read access. This method may be called multiple times, with the roles in each call being added to the end of the list of allowed roles. In other words, each call is cumulative, adding more roles to the list. Specify the roles denied read access to a given property. Name of the property. List of roles denied read access. This method may be called multiple times, with the roles in each call being added to the end of the list of denied roles. In other words, each call is cumulative, adding more roles to the list. Specify the roles allowed to write a given property. Name of the property. List of roles granted write access. This method may be called multiple times, with the roles in each call being added to the end of the list of allowed roles. In other words, each call is cumulative, adding more roles to the list. Specify the roles denied write access to a given property. Name of the property. List of roles denied write access. This method may be called multiple times, with the roles in each call being added to the end of the list of denied roles. In other words, each call is cumulative, adding more roles to the list. Specify the roles allowed to read a given property. Name of the property. List of roles granted read access. This method may be called multiple times, with the roles in each call being added to the end of the list of allowed roles. In other words, each call is cumulative, adding more roles to the list. Specify the roles denied read access to a given property. Name of the property. List of roles denied read access. This method may be called multiple times, with the roles in each call being added to the end of the list of denied roles. In other words, each call is cumulative, adding more roles to the list. Specify the roles allowed to write a given property. Name of the property. List of roles granted write access. This method may be called multiple times, with the roles in each call being added to the end of the list of allowed roles. In other words, each call is cumulative, adding more roles to the list. Specify the roles denied write access to a given property. Name of the property. List of roles denied write access. This method may be called multiple times, with the roles in each call being added to the end of the list of denied roles. In other words, each call is cumulative, adding more roles to the list. Indicates whether the property has a list of roles granted read access. Name of the property. Indicates whether the current user as defined by is explicitly allowed to read the property. Name of the property. Indicates whether the property has a list of roles denied read access. Name of the property. Indicates whether the current user as defined by is explicitly denied read access to the property. Name of the property. Indicates whether the property has a list of roles granted write access. Name of the property. Indicates whether the current user as defined by is explicitly allowed to set the property. Name of the property. Indicates whether the property has a list of roles denied write access. Name of the property. Indicates whether the current user as defined by is explicitly denied write access to the property. Name of the property. Maintains authorization roles for a business object or business object type. Base class from which custom principal objects should inherit to operate properly with the data portal. Returns the user's identity object. Returns a value indicating whether the user is in a given role. Name of the role. Creates an instance of the object. Identity object for the user. Defines the authorization interface through which an object can indicate which properties the current user can read and write. Returns if the user is allowed to write the to the specified property. if write is allowed. Name of the property to read. Returns if the user is allowed to read the specified property. if read is allowed. Name of the property to read. Maintains a list of allowed and denied user roles for a specific property. Returns a List(Of string) containing the list of roles allowed read access. Returns a List(Of string) containing the list of roles denied read access. Returns a List(Of string) containing the list of roles allowed write access. Returns a List(Of string) containing the list of roles denied write access. Returns if the user is in a role explicitly allowed read access. A representing the user. if the user is allowed read access. Returns if the user is in a role explicitly denied read access. A representing the user. if the user is denied read access. Returns if the user is in a role explicitly allowed write access. A representing the user. if the user is allowed write access. Returns if the user is in a role explicitly denied write access. A representing the user. if the user is denied write access. Maintains a list of all the per-type objects loaded in memory. Gets the for the specified object type, optionally creating a new instance of the object if necessary. Type of business object for which the rules apply. Indicates whether to create a new instance of the object if one doesn't exist. Gets a value indicating whether a set of rules have been created for a given . Type of business object for which the rules apply. if rules exist for the type. Provides a date data type that understands the concept of an empty date value. See Chapter 5 for a full discussion of the need for this data type and the design choices behind it. Indicates the empty value of a SmartDate. Indicates that an empty SmartDate is the smallest date. Indicates that an empty SmartDate is the largest date. Creates a new SmartDate object. Indicates whether an empty date is the min or max date value. Creates a new SmartDate object. Indicates whether an empty date is the min or max date value. Creates a new SmartDate object. The SmartDate created will use the min possible date to represent an empty date. The initial value of the object. Creates a new SmartDate object. The initial value of the object. Indicates whether an empty date is the min or max date value. Creates a new SmartDate object. The initial value of the object. Indicates whether an empty date is the min or max date value. Creates a new SmartDate object. The SmartDate created will use the min possible date to represent an empty date. The initial value of the object (as text). Creates a new SmartDate object. The initial value of the object (as text). Indicates whether an empty date is the min or max date value. Creates a new SmartDate object. The initial value of the object (as text). Indicates whether an empty date is the min or max date value. Sets the global default format string used by all new SmartDate values going forward. The default global format string is "d" unless this method is called to change that value. Existing SmartDate values are unaffected by this method, only SmartDate values created after calling this method are affected. The format string should follow the requirements for the .NET System.String.Format statement. Gets or sets the format string used to format a date value when it is returned as text. The format string should follow the requirements for the .NET System.String.Format statement. A format string. Gets or sets the date value. This property can be used to set the date value by passing a text representation of the date. Any text date representation that can be parsed by the .NET runtime is valid. When the date value is retrieved via this property, the text is formatted by using the format specified by the property. The default is the short date format (d). Gets or sets the date value. Returns a text representation of the date value. Returns a text representation of the date value. A standard .NET format string. Compares this object to another for equality. Object to compare for equality. Returns a hash code for this object. Gets a database-friendly version of the date value. If the SmartDate contains an empty date, this returns . Otherwise the actual date value is returned as type Date. This property is very useful when setting parameter values for a Command object, since it automatically stores null values into the database for empty date values. When you also use the SafeDataReader and its GetSmartDate method, you can easily read a null value from the database back into a SmartDate object so it remains considered as an empty date value. Gets a value indicating whether this object contains an empty date. Gets a value indicating whether an empty date is the min or max possible date value. Whether an empty date is considered to be the smallest or largest possible date is only important for comparison operations. This allows you to compare an empty date with a real date and get a meaningful result. Converts a string value into a SmartDate. String containing the date value. A new SmartDate containing the date value. EmptyIsMin will default to . Converts a string value into a SmartDate. String containing the date value. Indicates whether an empty date is the min or max date value. A new SmartDate containing the date value. Converts a text date representation into a Date value. An empty string is assumed to represent an empty date. An empty date is returned as the MinValue of the Date datatype. The text representation of the date. A Date value. Converts a text date representation into a Date value. An empty string is assumed to represent an empty date. An empty date is returned as the MinValue or MaxValue of the Date datatype depending on the EmptyIsMin parameter. The text representation of the date. Indicates whether an empty date is the min or max date value. A Date value. Converts a text date representation into a Date value. An empty string is assumed to represent an empty date. An empty date is returned as the MinValue or MaxValue of the Date datatype depending on the EmptyIsMin parameter. The text representation of the date. Indicates whether an empty date is the min or max date value. A Date value. Converts a date value into a text representation. The date is considered empty if it matches the min value for the Date datatype. If the date is empty, this method returns an empty string. Otherwise it returns the date value formatted based on the FormatString parameter. The date value to convert. The format string used to format the date into text. Text representation of the date value. Converts a date value into a text representation. Whether the date value is considered empty is determined by the EmptyIsMin parameter value. If the date is empty, this method returns an empty string. Otherwise it returns the date value formatted based on the FormatString parameter. The date value to convert. The format string used to format the date into text. Indicates whether an empty date is the min or max date value. Text representation of the date value. Converts a date value into a text representation. Whether the date value is considered empty is determined by the EmptyIsMin parameter value. If the date is empty, this method returns an empty string. Otherwise it returns the date value formatted based on the FormatString parameter. The date value to convert. The format string used to format the date into text. Indicates whether an empty date is the min or max date value. Text representation of the date value. Compares one SmartDate to another. This method works the same as the DateTime.CompareTo method on the Date datetype, with the exception that it understands the concept of empty date values. The date to which we are being compared. A value indicating if the comparison date is less than, equal to or greater than this date. Compares one SmartDate to another. This method works the same as the DateTime.CompareTo method on the Date datetype, with the exception that it understands the concept of empty date values. The date to which we are being compared. A value indicating if the comparison date is less than, equal to or greater than this date. Compares a SmartDate to a text date value. The date to which we are being compared. A value indicating if the comparison date is less than, equal to or greater than this date. Compares a SmartDate to a date value. The date to which we are being compared. A value indicating if the comparison date is less than, equal to or greater than this date. Adds a TimeSpan onto the object. Span to add to the date. Subtracts a TimeSpan from the object. Span to subtract from the date. Subtracts a DateTime from the object. Date to subtract from the date. Equality operator First object Second object Inequality operator First object Second object Equality operator First object Second object Inequality operator First object Second object Equality operator First object Second object Inequality operator First object Second object Addition operator Original date/time Span to add Subtraction operator Original date/time Span to subtract Subtraction operator Original date/time Second date/time Greater than operator First object Second object Less than operator First object Second object Greater than operator First object Second object Less than operator First object Second object Greater than operator First object Second object Less than operator First object Second object Greater than or equals operator First object Second object Less than or equals operator First object Second object Greater than or equals operator First object Second object Less than or equals operator First object Second object Greater than or equals operator First object Second object Less than or equals operator First object Second object Provides a sorted view into an existing IList(Of T). Type of child object contained by the original list or collection. Returns an enumerator for the list, honoring any sort that is active at the time. Implemented by IList source object. Property on which to build the index. Implemented by IList source object. Implemented by IList source object. Implemented by IList source object. Implemented by IList source object. Applies a sort to the view. The text name of the property on which to sort. The direction to sort the data. Applies a sort to the view. A PropertyDescriptor for the property on which to sort. The direction to sort the data. Finds an item in the view Name of the property to search Value to find Implemented by IList source object. Key value for which to search. Property to search for the key value. Gets a value indicating whether the view is currently sorted. Raised to indicate that the list's data has changed. This event is raised if the underling IList object's data changes (assuming the underling IList also implements the IBindingList interface). It is also raised if the sort property or direction is changed to indicate that the view's data has changed. See Chapter 5 for details. Raises the event. Event arguments. Implemented by IList source object. Property for which the index should be removed. Removes any sort currently applied to the view. Returns the direction of the current sort. Returns the PropertyDescriptor of the current sort. Returns since this object does raise the ListChanged event. Implemented by IList source object. Returns . Sorting is supported. Implemented by IList source object. Array to receive the data. Starting array index. Implemented by IList source object. Implemented by IList source object. Item to add to the list. Implemented by IList source object. Implemented by IList source object. Item for which to search. Implemented by IList source object. Item for which to search. Implemented by IList source object. Index at which to insert the item. Item to insert. Implemented by IList source object. Implemented by IList source object. Item to be removed. Removes the child object at the specified index in the list, resorting the display as needed. The index of the object to remove. See Chapter 5 for details on how and why the list is altered during the remove process. Gets the child item at the specified index in the list, honoring the sort order of the items. The index of the item in the sorted list. Creates a new view based on the provided IList object. The IList (collection) containing the data. Contains utility methods used by the CSLA .NET framework. Determines whether the specified value can be converted to a valid number. Allows late bound invocation of properties and methods. Object implementing the property or method. Name of the property or method. Specifies how to invoke the property or method. List of arguments to pass to the method. The result of the property or method invocation. Returns a property's type, dealing with Nullable(Of T) if necessary. Type of the property as returned by reflection. Returns the type of child object contained in a collection or list. Type of the list. Valid options for calling a property or method via the method. Gets a value from a property. Sets a value into a property. Invokes a method. Sets a value into a property. Stores details about a specific broken business rule. Provides access to the name of the broken rule. The name of the rule. Provides access to the description of the broken rule. The description of the rule. Provides access to the property affected by the broken rule. The property affected by the rule. Gets the severity of the broken rule. A collection of currently broken rules. This collection is readonly and can be safely made available to code outside the business object such as the UI. This allows external code, such as a UI, to display the list of broken rules to the user. Gets the number of broken rules in the collection that have a severity of Error. An integer value. Gets the number of broken rules in the collection that have a severity of Warning. An integer value. Gets the number of broken rules in the collection that have a severity of Information. An integer value. Returns the first object corresponding to the specified property. Code in a business object or UI can also use this value to retrieve the first broken rule in that corresponds to a specfic property on the object. The name of the property affected by the rule. The first BrokenRule object corresponding to the specified property, or null if there are no rules defined for the property. Returns the first object corresponding to the specified property. Code in a business object or UI can also use this value to retrieve the first broken rule in that corresponds to a specfic property. The name of the property affected by the rule. The first BrokenRule object corresponding to the specified property, or Nothing (null in C#) if there are no rules defined for the property. Returns the first object corresponding to the specified property and severity. The name of the property affected by the rule. The severity of broken rule to return. The first BrokenRule object corresponding to the specified property, or Nothing (null in C#) if there are no rules defined for the property. Returns the text of all broken rule descriptions, each separated by a . The text of all broken rule descriptions. Returns the text of all broken rule descriptions, each separated by a . The severity of rules to include in the result. The text of all broken rule descriptions matching the specified severtiy. Returns a string array containing all broken rule descriptions. The text of all broken rule descriptions matching the specified severtiy. Returns a string array containing all broken rule descriptions. The severity of rules to include in the result. The text of all broken rule descriptions matching the specified severtiy. Implements common business rules. Rule ensuring a string value contains one or more characters. Object containing the data to validate Arguments parameter specifying the name of the string property to validate if the rule is broken This implementation uses late binding, and will only work against string property values. Rule ensuring a string value doesn't exceed a specified length. Object containing the data to validate Arguments parameter specifying the name of the string property to validate if the rule is broken This implementation uses late binding, and will only work against string property values. Custom object required by the rule method. Get the max length for the string. Create a new object. Name of the property to validate. Max length of characters allowed. Return a string representation of the object. Rule ensuring an integer value doesn't exceed a specified value. Object containing the data to validate. Arguments parameter specifying the name of the property to validate. if the rule is broken. Custom object required by the rule method. Get the max value for the property. Create a new object. Name of the property. Maximum allowed value for the property. Return a string representation of the object. Rule ensuring an integer value doesn't go below a specified value. Object containing the data to validate. Arguments parameter specifying the name of the property to validate. if the rule is broken. Custom object required by the rule method. Get the min value for the property. Create a new object. Name of the property. Minimum allowed value for the property. Return a string representation of the object. Rule ensuring that a numeric value doesn't exceed a specified maximum. Type of the property to validate. Object containing value to validate. Arguments variable specifying the name of the property to validate, along with the max allowed value. Custom object required by the rule method. Type of the property to validate. Get the max value for the property. Create a new object. Name of the property. Maximum allowed value for the property. Returns a string representation of the object. Rule ensuring that a numeric value doesn't exceed a specified minimum. Type of the property to validate. Object containing value to validate. Arguments variable specifying the name of the property to validate, along with the min allowed value. Custom object required by the rule method. Type of the property to validate. Get the min value for the property. Create a new object. Name of the property. Minimum allowed value for the property. Returns a string representation of the object. Rule that checks to make sure a value matches a given regex pattern. Object containing the data to validate RegExRuleArgs parameter specifying the name of the property to validate and the regex pattern. False if the rule is broken This implementation uses late binding. List of built-in regex patterns. US Social Security number pattern. Email address pattern. Custom object required by the rule method. The object used to validate the property. Creates a new object. Name of the property to validate. Built-in regex pattern to use. Creates a new object. Name of the property to validate. Custom regex pattern to use. Creates a new object. Name of the property to validate. object to use. f Returns a string representation of the object. Returns the specified built-in regex pattern. Pattern to return. Tracks all information for a rule. Gets the priority of the rule method. The priority value. Priorities are processed in descending order, so priority 0 is processed before priority 1, etc. Gets the name of the rule. The rule's name must be unique and is used to identify a broken rule in the BrokenRules collection. Returns the name of the field, property or column to which the rule applies. Invokes the rule to validate the data. if the data is valid, if the data is invalid. Object providing extra information to methods that implement business rules. The name of the property to be validated. Set by the rule handler method to describe the broken rule. A human-readable description of the broken rule. Setting this property only has an effect if the rule method returns . Gets or sets the severity of the broken rule. The severity of the broken rule. Setting this property only has an effect if the rule method returns . Gets or sets a value indicating whether this broken rule should stop the processing of subsequent rules for this property. if no further rules should be process for this property. Setting this property only has an effect if the rule method returns . Creates an instance of RuleArgs. The name of the property to be validated. Return a string representation of the object. Delegate that defines the method signature for all rule handler methods. Object containing the data to be validated. Parameter used to pass information to and from the rule method. if the rule was satisfied. When implementing a rule handler, you must conform to the method signature defined by this delegate. You should also apply the Description attribute to your method to provide a meaningful description for your rule. The method implementing the rule must return if the data is valid and return if the data is invalid. Delegate that defines the method signature for all rule handler methods. Type of the target object. Type of the arguments parameter. Object containing the data to be validated. Parameter used to pass information to and from the rule method. if the rule was satisfied. When implementing a rule handler, you must conform to the method signature defined by this delegate. You should also apply the Description attribute to your method to provide a meaningful description for your rule. The method implementing the rule must return if the data is valid and return if the data is invalid. Tracks all information for a rule. Returns the name of the method implementing the rule and the property, field or column name to which the rule applies. Gets the priority of the rule method. The priority value Priorities are processed in descending order, so priority 0 is processed before priority 1, etc. Gets the name of the rule. The rule's name must be unique and is used to identify a broken rule in the BrokenRules collection. Returns the name of the field, property or column to which the rule applies. Creates and initializes the rule. The address of the method implementing the rule. A RuleArgs object. Creates and initializes the rule. The address of the method implementing the rule. A RuleArgs object. Priority for processing the rule (smaller numbers have higher priority, default=0). Invokes the rule to validate the data. if the data is valid, if the data is invalid. Tracks all information for a rule. Type of the target object. Type of the arguments parameter. Returns the name of the method implementing the rule and the property, field or column name to which the rule applies. Gets the priority of the rule method. The priority value Priorities are processed in descending order, so priority 0 is processed before priority 1, etc. Gets the name of the rule. The rule's name must be unique and is used to identify a broken rule in the BrokenRules collection. Returns the name of the field, property or column to which the rule applies. Returns the name of the field, property or column to which the rule applies. Creates and initializes the rule. The address of the method implementing the rule. A RuleArgs object. Creates and initializes the rule. The address of the method implementing the rule. A RuleArgs object. Priority for processing the rule (smaller numbers have higher priority, default=0). Invokes the rule to validate the data. True if the data is valid, False if the data is invalid. Invokes the rule to validate the data. if the data is valid, if the data is invalid. Values for validation rule severities. Represents a serious business rule violation that should cause an object to be considered invalid. Represents a business rule violation that should be displayed to the user, but which should not make an object be invalid. Represents a business rule result that should be displayed to the user, but which is less severe than a warning. Maintains a list of all the per-type objects loaded in memory. Gets the for the specified object type, optionally creating a new instance of the object if necessary. Type of business object for which the rules apply. Indicates whether to create a new instance of the object if one doesn't exist. Gets a value indicating whether a set of rules have been created for a given . Type of business object for which the rules apply. if rules exist for the type. Exception class indicating that there was a validation problem with a business object. Creates an instance of the object. Creates an instance of the object. Message describing the exception. Creates an instance of the object. Message describing the exception. Inner exception object. Creates an instance of the object for serialization. Serialization context. Serialization info. Tracks the business rules broken within a business object. Returns an array containing the text descriptions of all validation rules associated with this object. String array. Gets or sets the priority through which CheckRules should process before short-circuiting processing on broken rules. Defaults to 0. All rules for each property are processed by CheckRules though this priority. Rules with lower priorities are only processed if no previous rule has been marked as broken. Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. The propertyName may be used by the method that implements the rule in order to retrieve the value to be validated. If the rule implementation is inside the target object then it probably has direct access to all data. However, if the rule implementation is outside the target object then it will need to use reflection or CallByName to dynamically invoke this property to retrieve the value to be validated. The method that implements the rule. The property name on the target object where the rule implementation can retrieve the value to be validated. Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. The propertyName may be used by the method that implements the rule in order to retrieve the value to be validated. If the rule implementation is inside the target object then it probably has direct access to all data. However, if the rule implementation is outside the target object then it will need to use reflection or CallByName to dynamically invoke this property to retrieve the value to be validated. The method that implements the rule. The property name on the target object where the rule implementation can retrieve the value to be validated. The priority of the rule, where lower numbers are processed first. Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. The propertyName may be used by the method that implements the rule in order to retrieve the value to be validated. If the rule implementation is inside the target object then it probably has direct access to all data. However, if the rule implementation is outside the target object then it will need to use reflection or CallByName to dynamically invoke this property to retrieve the value to be validated. The method that implements the rule. The property name on the target object where the rule implementation can retrieve the value to be validated. Type of the business object to be validated. Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. The propertyName may be used by the method that implements the rule in order to retrieve the value to be validated. If the rule implementation is inside the target object then it probably has direct access to all data. However, if the rule implementation is outside the target object then it will need to use reflection or CallByName to dynamically invoke this property to retrieve the value to be validated. The method that implements the rule. The property name on the target object where the rule implementation can retrieve the value to be validated. The priority of the rule, where lower numbers are processed first. Type of the business object to be validated. Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. The method that implements the rule. A RuleArgs object specifying the property name and other arguments passed to the rule method Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. The method that implements the rule. A RuleArgs object specifying the property name and other arguments passed to the rule method The priority of the rule, where lower numbers are processed first. Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. Type of the target object. Type of the arguments parameter. The method that implements the rule. A RuleArgs object specifying the property name and other arguments passed to the rule method Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. Type of the target object. Type of the arguments parameter. The method that implements the rule. A RuleArgs object specifying the property name and other arguments passed to the rule method The priority of the rule, where lower numbers are processed first. Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. The propertyName may be used by the method that implements the rule in order to retrieve the value to be validated. If the rule implementation is inside the target object then it probably has direct access to all data. However, if the rule implementation is outside the target object then it will need to use reflection or CallByName to dynamically invoke this property to retrieve the value to be validated. The method that implements the rule. The property name on the target object where the rule implementation can retrieve the value to be validated. Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. The propertyName may be used by the method that implements the rule in order to retrieve the value to be validated. If the rule implementation is inside the target object then it probably has direct access to all data. However, if the rule implementation is outside the target object then it will need to use reflection or CallByName to dynamically invoke this property to retrieve the value to be validated. The method that implements the rule. The property name on the target object where the rule implementation can retrieve the value to be validated. The priority of the rule, where lower numbers are processed first. Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. The propertyName may be used by the method that implements the rule in order to retrieve the value to be validated. If the rule implementation is inside the target object then it probably has direct access to all data. However, if the rule implementation is outside the target object then it will need to use reflection or CallByName to dynamically invoke this property to retrieve the value to be validated. The method that implements the rule. The property name on the target object where the rule implementation can retrieve the value to be validated. Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. The propertyName may be used by the method that implements the rule in order to retrieve the value to be validated. If the rule implementation is inside the target object then it probably has direct access to all data. However, if the rule implementation is outside the target object then it will need to use reflection or CallByName to dynamically invoke this property to retrieve the value to be validated. The method that implements the rule. The property name on the target object where the rule implementation can retrieve the value to be validated. The priority of the rule, where lower numbers are processed first. Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. The method that implements the rule. A RuleArgs object specifying the property name and other arguments passed to the rule method Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. The method that implements the rule. A RuleArgs object specifying the property name and other arguments passed to the rule method The priority of the rule, where lower numbers are processed first. Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. Type of the target object. Type of the arguments parameter. The method that implements the rule. A RuleArgs object specifying the property name and other arguments passed to the rule method Adds a rule to the list of rules to be enforced. A rule is implemented by a method which conforms to the method signature defined by the RuleHandler delegate. Type of the target object. Type of the arguments parameter. The method that implements the rule. A RuleArgs object specifying the property name and other arguments passed to the rule method The priority of the rule, where lower numbers are processed first. Adds a property to the list of dependencies for the specified property The name of the property. The name of the depandent property. When rules are checked for propertyName, they will also be checked for any dependant properties associated with that property. Adds a property to the list of dependencies for the specified property The name of the property. The name of the depandent property. If then a reverse dependancy is also established from dependantPropertyName to propertyName. When rules are checked for propertyName, they will also be checked for any dependant properties associated with that property. If isBidirectional is then an additional association is set up so when rules are checked for dependantPropertyName the rules for propertyName will also be checked. Invokes all rule methods associated with the specified property and any dependant properties. The name of the property to validate. Invokes all rule methods for all properties in the object. Given a list containing IRuleMethod objects, this method executes all those rule methods. Returns a value indicating whether there are any broken rules at this time. A value indicating whether any rules are broken. Returns a reference to the readonly collection of broken business rules. The reference returned points to the actual collection object. This means that as rules are marked broken or unbroken over time, the underlying data will change. Because of this, the UI developer can bind a display directly to this collection to get a dynamic display of the broken rules at all times. A reference to the collection of broken rules. Maintains rule methods for a business object or business object type. Adds a property to the list of dependencies for the specified property The name of the property. The name of the dependant property. When rules are checked for propertyName, they will also be checked for any dependant properties associated with that property. A Web Forms data binding control designed to support CSLA .NET business objects as data sources. Event raised when an object is to be created and populated with data. Handle this event in a page and set e.BusinessObject to the populated business object. Event raised when an object is to be populated with data and inserted. Handle this event in a page to create an instance of the object, load the object with data and insert the object into the database. Event raised when an object is to be updated. Handle this event in a page to update an existing instance of an object with new data and then save the object into the database. Event raised when an object is to be deleted. Handle this event in a page to delete an object from the database. Returns the default view for this data control. Ignored. This control only contains a "Default" view. Get or set the name of the assembly (no longer used). Obsolete - do not use. Get or set the full type name of the business object class to be used as a data source. Full type name of the business class, including assembly name. Get or set a value indicating whether the business object data source supports paging. To support paging, the business object (collection) must implement . Get or set a value indicating whether the business object data source supports sorting. Returns a Type object based on the assembly and type information provided. Optional assembly name. Full type name of the class, including assembly name. Returns a list of views available for this control. This control only provides the "Default" view. Raises the SelectObject event. Raises the InsertObject event. Raises the UpdateObject event. Raises the DeleteObject event. The object responsible for managing data binding to a specific CSLA .NET object. Creates an instance of the object. The CslaDataSource object that owns this view. The name of the view. Get or set the name of the assembly (no longer used). Obsolete - do not use. Get or set the full type name of the business object class to be used as a data source. Full type name of the business class. Get or set a value indicating whether the business object data source supports paging. To support paging, the business object (collection) must implement . Get or set a value indicating whether the business object data source supports sorting. Implements the select behavior for the control by raising the event. Arguments object. The data returned from the select. Gets a value indicating whether the data source can insert data. Implements the insert behavior for the control by raising the event. The values from the UI that are to be inserted. The number of rows affected. Gets a value indicating whether the data source can delete data. Implements the delete behavior for the control by raising the event. The key values from the UI that are to be deleted. The old values from the UI. The number of rows affected. Gets a value indicating whether the data source can update data. Implements the update behavior for the control by raising the event. The key values from the UI that identify the object to be updated. The values from the UI that are to be inserted. The old values from the UI. The number of rows affected. Gets a value indicating whether the data source supports paging of the data. Gets a value indicating whether the data source can retrieve the total number of rows of data. Always returns . Gets a alue indicating whether the data source supports sorting of the data. Always returns . Argument object used in the DeleteObject event. Gets or sets the number of rows affected while handling this event. The code handling the event should set this value to indicate the number of rows affected by the operation. The list of key values entered by the user. It is up to the event handler in the web page to use the values to identify the object to be deleted. The list of old data values maintained by data binding. It is up to the event handler in the web page to use the values to identify the object to be deleted. Create an instance of the object. CslaDataSource configuration form. Create instance of object. Create instance of object. Reference to the data source control. Existing type name. Gets the type name entered by the user. Required designer variable. Clean up any resources being used. true if managed resources should be disposed; otherwise, false. Required method for Designer support - do not modify the contents of this method with the code editor. Implements designer support for CslaDataSource. Initialize the designer component. The CslaDataSource control to be designed. Returns the default view for this designer. Ignored This designer supports only a "Default" view. Return a list of available views. This designer supports only a "Default" view. Refreshes the schema for the data. Get a value indicating whether the control can refresh its schema. Invoke the design time configuration support provided by the control. Get a value indicating whether this control supports design time configuration. Get a value indicating whether the control can be resized. Get a reference to the CslaDataSource control being designed. Object responsible for providing details about data binding to a specific CSLA .NET object. Creates an instance of the object. Returns a set of sample data used to populate controls at design time. Minimum number of sample rows to create. Returns True if the data is sample data. Returns schema information corresponding to the properties of the CSLA .NET business object. All public properties are returned except for those marked with the Browsable attribute as False. Get a value indicating whether data binding can retrieve the total number of rows of data. Get a value indicating whether data binding can directly delete the object. If this returns true, the web page must handle the DeleteObject event. Get a value indicating whether data binding can directly insert an instance of the object. If this returns true, the web page must handle the InsertObject event. Get a value indicating whether data binding can directly update or edit the object. If this returns true, the web page must handle the UpdateObject event. Gets a value indicating whether the data source supports paging. Gets a value indicating whether the data source supports sorting. Contains schema information for a single object property. Creates an instance of the object. The PropertyInfo object describing the property. Gets the data type of the property. Gets a value indicating whether this property is an identity key for the object. Returns the optional value provided through the DataObjectField attribute on the property. Gets a value indicating whether this property is readonly. Gets a value indicating whether this property must contain a unique value. Always returns True if the property is marked as a primary key, otherwise returns False. Gets the length of the property value. Returns the optional value provided through the DataObjectField attribute on the property. Gets the property name. Gets a value indicating whether the property is nullable Returns True for reference types, and for value types wrapped in the Nullable generic. The result can also be set to True through the DataObjectField attribute on the property. Gets the property's numeric precision. Always returns -1. Gets a value indicating whether the property is a primary key value. Returns the optional value provided through the DataObjectField attribute on the property. Gets the property's scale. Always returns -1. Object providing access to schema information for a business object. This object returns only one view, which corresponds to the business object used by data binding. Creates an instance of the object. Data source designer object. Type name for which the schema should be generated. Returns a single element array containing the schema for the CSLA .NET business object. Object providing schema information for a business object. Create an instance of the object. Site containing the control. The business class for which to generate the schema. Returns a list of child schemas belonging to the object. This schema object only returns schema for the object itself, so GetChildren will always return Nothing (null in C#). Returns schema information for each property on the object. All public properties on the object will be reflected in this schema list except for those properties where the Browsable attribute is False. Returns the name of the schema. Argument object used in the InsertObject event. Gets or sets the number of rows affected while handling this event. The code handling the event should set this value to indicate the number of rows affected by the operation. The list of data values entered by the user. It is up to the event handler in the web page to take the list of values, put them into a business object and to save that object into the database. Create an instance of the object. Argument object used in the SelectObject event. Get or set a reference to the business object that is created and populated by the SelectObject event handler in the web page. A reference to a CSLA .NET business object. Gets the sort expression that should be used to sort the data being returned to the data source control. Gets the property name for the sort if only one property/column name is specified. If multiple properties/columns are specified for the sort, you must parse the value from to find all the property names and sort directions for the sort. Gets the sort direction for the sort if only one property/column name is specified. If multiple properties/columns are specified for the sort, you must parse the value from to find all the property names and sort directions for the sort. Gets the index for the first row that will be displayed. This should be the first row in the resulting collection set into the property. Gets the maximum number of rows that should be returned as a result of this query. For paged collections, this is the page size. Gets a value indicating whether the query should return the total row count through the interface. Creates an instance of the object, initializing it with values from data binding. Values provided from data binding. Argument object used in the UpdateObject event. Gets or sets the number of rows affected while handling this event. The code handling the event should set this value to indicate the number of rows affected by the operation. The list of key values entered by the user. It is up to the event handler in the web page to take the list of values, put them into a business object and to save that object into the database. The list of data values entered by the user. It is up to the event handler in the web page to take the list of values, put them into a business object and to save that object into the database. The list of old data values maintained by data binding. It is up to the event handler in the web page to take the list of values, put them into a business object and to save that object into the database. Creates an instance of the object. Windows Forms extender control that resolves the data refresh issue with data bound detail controls as discussed in Chapter 5. Creates an instance of the object. Container of the control. Gets a value indicating whether the extender control can extend the specified control. The control to be extended. This control only extends controls. Gets the value of the custom ReadValuesOnChange extender property added to extended controls. Control being extended. Sets the value of the custom ReadValuesOnChange extender property added to extended controls. Control being extended. New value of property. Windows Forms extender control that automatically enables and disables detail form controls based on the authorization settings from a CSLA .NET business object. Creates an instance of the object. The container of the control. Gets a value indicating whether the extender control can extend the specified control. The control to be extended. Any control implementing either a ReadOnly property or Enabled property can be extended. Gets the custom ApplyAuthorization extender property added to extended controls. Control being extended. Sets the custom ApplyAuthorization extender property added to extended controls. Control being extended. New value of property. Causes the ReadWriteAuthorization control to apply authorization rules from the business object to all extended controls on the form. Call this method to refresh the display of detail controls on the form any time the authorization rules may have changed. Examples include: after a user logs in or out, and after an object has been updated, inserted, deleted or retrieved from the database.