projects/wms-framework/src/lib/regionsframework/RegionBehaviorCollection.ts
RegionBehaviorCollection class.
Properties |
|
Methods |
constructor(region: IRegion)
|
||||||
|
Parameters :
|
| behaviors |
Type : SimpleDictionary<string | IRegionBehavior>
|
Default value : new SimpleDictionary<
string,
IRegionBehavior
>()
|
| region |
Type : IRegion
|
| Private internalMap |
Type : Map<K | V>
|
|
Inherited from
SimpleDictionary
|
|
Defined in
SimpleDictionary:23
|
| Abstract count |
Type : number
|
|
Inherited from
Dictionary
|
|
Defined in
Dictionary:61
|
|
Gets the count of elements in the dictionary |
| Abstract internalArray |
Type : []
|
|
Inherited from
Dictionary
|
|
Defined in
Dictionary:62
|
| Abstract keys |
Type : ICollection<K>
|
|
Inherited from
Dictionary
|
|
Defined in
Dictionary:41
|
|
The keys collection |
| Abstract values |
Type : ICollection<V>
|
|
Inherited from
Dictionary
|
|
Defined in
Dictionary:51
|
|
The values collection |
| Add | |||||||||
Add(key: string, behavior: IRegionBehavior)
|
|||||||||
|
Parameters :
Returns :
void
|
| ContainsKey | ||||||
ContainsKey(key: string)
|
||||||
|
Parameters :
Returns :
boolean
|
| add | ||||||
add(value: [K, V])
|
||||||
|
Inherited from
Dictionary
|
||||||
|
Defined in
Dictionary:66
|
||||||
|
Parameters :
Returns :
void
|
| addEntry | |||||||||
addEntry(key: K, value: V)
|
|||||||||
|
Inherited from
Dictionary
|
|||||||||
|
Defined in
Dictionary:46
|
|||||||||
|
Parameters :
Returns :
void
|
| clear |
clear()
|
|
Inherited from
Dictionary
|
|
Defined in
Dictionary:69
|
|
Returns :
void
|
| contains | ||||||
contains(value: [K, V])
|
||||||
|
Inherited from
Dictionary
|
||||||
|
Defined in
Dictionary:72
|
||||||
|
Parameters :
Returns :
boolean
|
| containsKey | ||||||
containsKey(key: K)
|
||||||
|
Inherited from
Dictionary
|
||||||
|
Defined in
Dictionary:76
|
||||||
|
Parameters :
Returns :
boolean
|
| copyTo | |||||||||
copyTo(target: [], index: number)
|
|||||||||
|
Inherited from
Dictionary
|
|||||||||
|
Defined in
Dictionary:83
|
|||||||||
|
Parameters :
Returns :
void
|
| filter | ||||||||
filter(predicate: (item: [K, V]) => void)
|
||||||||
|
Inherited from
SimpleDictionary
|
||||||||
|
Defined in
SimpleDictionary:98
|
||||||||
|
Creates a new SimpleDictionary object with the elements that matched the given predicate
Parameters :
Returns :
SimpleDictionary<K, V>
a new SimpleDictionary with filtered in elements. |
| getItem | ||||||
getItem(key: K)
|
||||||
|
Inherited from
Dictionary
|
||||||
|
Defined in
Dictionary:30
|
||||||
|
Parameters :
Returns :
V
|
| hasKey | ||||||
hasKey(key: K)
|
||||||
|
Inherited from
Dictionary
|
||||||
|
Defined in
Dictionary:49
|
||||||
|
Parameters :
Returns :
any
|
| remove | ||||||
remove(value: [K, V])
|
||||||
|
Inherited from
Dictionary
|
||||||
|
Defined in
Dictionary:79
|
||||||
|
Parameters :
Returns :
boolean
|
| removeEntry | ||||||
removeEntry(key: K)
|
||||||
|
Inherited from
Dictionary
|
||||||
|
Defined in
Dictionary:52
|
||||||
|
Parameters :
Returns :
void
|
| setItem | |||||||||
setItem(key: K, value: V)
|
|||||||||
|
Inherited from
Dictionary
|
|||||||||
|
Defined in
Dictionary:37
|
|||||||||
|
Parameters :
Returns :
void
|
| tryGetValue | |||||||||
tryGetValue(key: K, value: (v: V) => void)
|
|||||||||
|
Inherited from
Dictionary
|
|||||||||
|
Defined in
Dictionary:55
|
|||||||||
|
Parameters :
Returns :
boolean
|
()
|
|
Inherited from
Dictionary
|
|
Defined in
Dictionary:86
|
|
Returns :
Iterator<, any, undefined>
|
import {
ArgumentException,
ArgumentNullException,
} from '../baseframework/Exceptions';
import { SimpleDictionary } from '../baseframework/SimpleDictionary';
import { IRegion } from './IRegion';
import { IRegionBehavior } from './IRegionBehavior';
import { IRegionBehaviorCollection } from './IRegionBehaviorCollection';
/**
* RegionBehaviorCollection class.
*
* @export
* @class RegionBehaviorCollection
* @extends {SimpleDictionary<string, IRegionBehavior>}
* @implements {IRegionBehaviorCollection}
* @wType Microsoft.Practices.Prism.Regions.RegionBehaviorCollection
*/
export class RegionBehaviorCollection
extends SimpleDictionary<string, IRegionBehavior>
implements IRegionBehaviorCollection
{
region: IRegion;
behaviors: SimpleDictionary<string, IRegionBehavior> = new SimpleDictionary<
string,
IRegionBehavior
>();
constructor(region: IRegion) {
super();
this.region = region;
}
Add(key: string, behavior: IRegionBehavior): void {
if (key == null) {
throw new ArgumentNullException('key');
}
if (behavior == null) {
throw new ArgumentNullException('regionBehavior');
}
if (this.behaviors.containsKey(key)) {
throw new ArgumentException(
'Could not add duplicate behavior with same key.'
);
}
this.behaviors.add([key, behavior]);
behavior.Region = this.region;
behavior.Attach();
}
ContainsKey(key: string): boolean {
return this.behaviors.containsKey(key);
}
}