Opener

Helper class that can be used to check whether all components are opened or not, a component is opened or not, and to open one or more components.

Description

The Opener class can be used to check whether all components are opened or not, a component is opened or not, and to open one or more components.

Static methods

IsOpen

Checks if all components are open.

To be checked, components must implement the IOpenable interface. If they don’t, the call to this method returns true.

public static bool IsOpen(IEnumerable components)

  • components: IEnumerable - list of components that are to be checked.
  • returns: bool - true if all components are open and false if at least one component is closed.

IsOpenOne

Checks if a specified component is opened. To be checked, components must implement the IOpenable interface. If they don’t, the call to this method returns true.

public static bool IsOpenOne(object component)

  • component: object - component that is to be checked.
  • returns: bool - true if the component is opened and false otherwise.

OpenAsync

Opens multiple components. To be opened, components must implement the IOpenable interface. If they don’t, the call to this method has no effect.

public static Task OpenAsync(IContext context, IEnumerable components)

  • context: IContext - (optional) a context to trace execution through a call chain.
  • components: IEnumerable - list of components that are to be closed.

OpenOneAsync

Opens a specific component. To be opened, components must implement the IOpenable interface. If they don’t, the call to this method has no effect.

public static Task OpenOneAsync(IContext context, object component)

  • context: IContext - (optional) a context to trace execution through a call chain.
  • component: object - component that is to be opened.

See also