Class RegionBehaviorFactory
Defines a factory that allows the registration of the default set of IRegionBehavior, that will be added to the IRegionBehaviorCollection of all IRegions, unless overridden on a 'per-region' basis.
Namespace: Sartorius.SAF.Presentation.Regions
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public class RegionBehaviorFactory : IRegionBehaviorFactory, IEnumerable<string>, IEnumerable
Constructors
View SourceRegionBehaviorFactory(IServiceLocator)
Initializes a new instance of RegionBehaviorFactory.
Declaration
public RegionBehaviorFactory(IServiceLocator serviceLocator)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceLocator | serviceLocator | CommonServiceLocator.IServiceLocator used to create the instance of the behavior from its Type. |
Methods
View SourceAddIfMissing(string, Type)
Adds a particular type of RegionBehavior if it was not already registered. The behaviorKey string is used to check if the behavior is already present
Declaration
public void AddIfMissing(string behaviorKey, Type behaviorType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | behaviorKey | The behavior key that's used to find if a certain behavior is already added. |
| Type | behaviorType | Type of the behavior to add. |
ContainsKey(string)
Determines whether a behavior with the specified key already exists.
Declaration
public bool ContainsKey(string behaviorKey)
Parameters
| Type | Name | Description |
|---|---|---|
| string | behaviorKey | The behavior key. |
Returns
| Type | Description |
|---|---|
| bool | true if a behavior with the specified key is present; otherwise, false. |
CreateFromKey(string)
Creates an instance of the behavior Type that is registered using the specified key.
Declaration
public IRegionBehavior CreateFromKey(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key that is used to register a behavior type. |
Returns
| Type | Description |
|---|---|
| IRegionBehavior | A new instance of the behavior. |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<string> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<string> | A IEnumerator<T> that can be used to iterate through the collection. |