RunReferencesDecorator

References decorator that automatically opens newly added components that implement the IOpenable interface and closes removed components that implement the IClosable interface.

Inherits: ReferencesDecorator, IOpenable

Description

The RunReferencesDecorator class allows you to create a references decorator that automatically opens newly added components that implement the IOpenable interface and closes removed components that implement the IClosable interface.

Constructors

Creates a new instance of the decorator.

public RunReferencesDecorator(IReferences baseReferences = null, IReferences parentReferences = null)

  • baseReferences: IReferences - next references or decorator in the chain.
  • parentReferences: IReferences - decorator at the top of the chain.

Instance methods

Put

Puts a new reference into the reference map.

public override void Put(object locator, object component)

  • locator: object - locator to find the reference by.
  • reference: object - component reference to be added.

Remove

Removes a previously added component that matches the specified locator. If many references match the locator, it removes only the first one. When all references shall be removed, use the RemoveAll method instead.

public override object Remove(object locator)

  • locator: object - locator to remove component
  • returns: object - removed component.

RemoveAll

Removes all component references that match the specified locator.

public override List<object> RemoveAll(object locator)

  • locator: object - locator to remove references by.
  • returns: List<object> - list containing all removed references.

See also