C# Class Antmicro.Migrant.Utilities.SwapList

Key/value pair list in which more generic types are always inserted after their specializations.
Show file Open project: antmicro/Migrant Class Usage Examples

Private Properties

Property Type Description
GenericIsMatch bool
InnerAddOrReplace int
IsMatch bool

Public Methods

Method Description
AddGenericTemplate ( Type genericType, Delegate>.Func actualDelegateGenerator ) : void

Adds new key/dynamically generated pair or replaces one if the key already exists.

AddOrReplace ( Type key, Delegate value ) : void

Adds new key/value pair or replaces existing one if the key already exists.

FindMatchingIndex ( Type value ) : int

Finds the index of the delegate that matches given type.

GetByIndex ( int index ) : Delegate

Gets a delegate by an index.

SwapList ( ) : System

Initializes a new instance of the Antmicro.Migrant.Utilities.SwapList class.

Private Methods

Method Description
GenericIsMatch ( Type candidate, Type value ) : bool
InnerAddOrReplace ( Type key, Delegate value, Delegate>.Func valueCreator ) : int
IsMatch ( Type candidate, Type value ) : bool

Method Details

AddGenericTemplate() public method

Adds new key/dynamically generated pair or replaces one if the key already exists.
public AddGenericTemplate ( Type genericType, Delegate>.Func actualDelegateGenerator ) : void
genericType System.Type Key.
actualDelegateGenerator Delegate>.Func Function generating final value.
return void

AddOrReplace() public method

Adds new key/value pair or replaces existing one if the key already exists.
public AddOrReplace ( Type key, Delegate value ) : void
key System.Type Key.
value System.Delegate Value.
return void

FindMatchingIndex() public method

Finds the index of the delegate that matches given type.
public FindMatchingIndex ( Type value ) : int
value System.Type Type to match.
return int

GetByIndex() public method

Gets a delegate by an index.
public GetByIndex ( int index ) : Delegate
index int The index of the element.
return System.Delegate

SwapList() public method

Initializes a new instance of the Antmicro.Migrant.Utilities.SwapList class.
public SwapList ( ) : System
return System