File

projects/wms-framework/src/lib/regionsframework/IRegionCollection.ts

Description

IRegionCollection interface.

Index

Methods

Methods

Add
Add(region: IRegion)

Adds a IRegion to the collection.

Parameters :
Name Type Optional Description
region IRegion No

Region to be added to the collection.

Returns : void
ContainsRegionWithName
ContainsRegionWithName(regionName: string)

Checks if the collection contains a IRegion with the name received as parameter

Parameters :
Name Type Optional Description
regionName string No

The name of the region to look for.

Returns : boolean
getItem
getItem(regionName: string)

Retrieves a region with the given name

Parameters :
Name Type Optional Description
regionName string No

the name of the region to retrieve

Returns : IRegion

{IRegion}

Remove
Remove(regionName: string)

Removes a IRegion from the collection.

Parameters :
Name Type Optional Description
regionName string No

Name of the region to be removed.

Returns : boolean
tryGetValue
tryGetValue(key: string, valueFunc: (v: IRegion) => void)

Tries to retrieve a region with the given name

Parameters :
Name Type Optional Description
key string No

region key

valueFunc function No

function to process the retrieved value

Returns : boolean

{boolean} true if the region was retrieved

()

Iteration protocol function

{Iterator<IRegion, any, undefined>}

import { IRegion } from './IRegion';

/**
 * IRegionCollection interface.
 *
 * @export
 * @interface IRegionCollection
 * @wInterface Microsoft.Practices.Prism.Regions.IRegionCollection
 */
export interface IRegionCollection {
  /**
   * Adds a IRegion to the collection.
   * @param region Region to be added to the collection.
   */
  Add(region: IRegion): void;
  /**
   * Removes a IRegion from the collection.
   * @param regionName Name of the region to be removed.
   */
  Remove(regionName: string): boolean;
  /**
   * Checks if the collection contains a IRegion with the name received as parameter
   * @param regionName The name of the region to look for.
   */
  ContainsRegionWithName(regionName: string): boolean;

  /**
   *  Tries to retrieve a region with the given name
   *
   * @param {string} key region key
   * @param {(v: IRegion) => void} valueFunc function to process the retrieved value
   * @return {*}  {boolean} true if the region was retrieved
   * @memberof IRegionCollection
   */
  tryGetValue(key: string, valueFunc: (v: IRegion) => void): boolean;

  /**
   *  Retrieves a region with the given name
   *
   * @param {string} regionName the name of the region to retrieve
   * @return {*}  {IRegion}
   * @memberof IRegionCollection
   */
  getItem(regionName: string): IRegion;

  /**
   *  Iteration protocol function
   *
   * @return {*}  {Iterator<IRegion, any, undefined>}
   * @memberof IRegionCollection
   */
  [Symbol.iterator](): Iterator<IRegion, any, undefined>;
}

result-matching ""

    No results matching ""