Class RegionAdapterBase<T>
Base class to facilitate the creation of IRegionAdapter implementations.
Implements
Namespace: Sartorius.SAF.Presentation.Regions
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public abstract class RegionAdapterBase<T> : IRegionAdapter where T : class
Type Parameters
Name | Description |
---|---|
T | Type of object to adapt. |
Constructors
View SourceRegionAdapterBase(IRegionBehaviorFactory)
Initializes a new instance of RegionAdapterBase<T>.
Declaration
protected RegionAdapterBase(IRegionBehaviorFactory regionBehaviorFactory)
Parameters
Type | Name | Description |
---|---|---|
IRegionBehaviorFactory | regionBehaviorFactory | The factory used to create the region behaviors to attach to the created regions. |
Properties
View SourceRegionBehaviorFactory
Gets or sets the factory used to create the region behaviors to attach to the created regions.
Declaration
protected IRegionBehaviorFactory RegionBehaviorFactory { get; set; }
Property Value
Type | Description |
---|---|
IRegionBehaviorFactory |
Methods
View SourceAdapt(IRegion, T)
Template method to adapt the object to an IRegion.
Declaration
protected abstract void Adapt(IRegion region, T regionTarget)
Parameters
Type | Name | Description |
---|---|---|
IRegion | region | The new region being used. |
T | regionTarget | The object to adapt. |
AttachBehaviors(IRegion, T)
Template method to attach new behaviors.
Declaration
protected virtual void AttachBehaviors(IRegion region, T regionTarget)
Parameters
Type | Name | Description |
---|---|---|
IRegion | region | The region being used. |
T | regionTarget | The object to adapt. |
AttachDefaultBehaviors(IRegion, T)
This method adds the default behaviors by using the IRegionBehaviorFactory object.
Declaration
protected virtual void AttachDefaultBehaviors(IRegion region, T regionTarget)
Parameters
Type | Name | Description |
---|---|---|
IRegion | region | The region being used. |
T | regionTarget | The object to adapt. |
CreateRegion()
Template method to create a new instance of IRegion that will be used to adapt the object.
Declaration
protected abstract IRegion CreateRegion()
Returns
Type | Description |
---|---|
IRegion | A new instance of IRegion. |
Initialize(T, String)
Adapts an object and binds it to a new IRegion.
Declaration
public IRegion Initialize(T regionTarget, string regionName)
Parameters
Type | Name | Description |
---|---|---|
T | regionTarget | The object to adapt. |
System.String | regionName | The name of the region to be created. |
Returns
Type | Description |
---|---|
IRegion | The new instance of IRegion that the |
Explicit Interface Implementations
View SourceIRegionAdapter.Initialize(Object, String)
Adapts an object and binds it to a new IRegion.
Declaration
IRegion IRegionAdapter.Initialize(object regionTarget, string regionName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | regionTarget | The object to adapt. |
System.String | regionName | The name of the region to be created. |
Returns
Type | Description |
---|---|
IRegion | The new instance of IRegion that the |
Remarks
This methods performs validation to check that regionTarget
is of type T
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | When |
System.InvalidOperationException | When |