Пример #1
0
 /// <summary>
 /// Bind binding type to TValue, instances will be made by reflection.
 /// </summary>
 /// <typeparam name="TValue">Type to be binded with TKey.</typeparam>
 public void To <TValue>()
     where TValue : TKey
 {
     DI.BindByBinder(BindedKey, typeof(TValue), null, IsExampleBind, IsSingleton);
 }
Пример #2
0
 /// <summary>
 /// Bind binding type to Func delegate with arguments, returning instances if TValue type.
 /// </summary>
 /// <typeparam name="TValue">Type to be binded with TKey.</typeparam>
 /// <param name="creatorWithArgs">Func delegate for creating the TValue instances with arguments.</param>
 public void ToDelegateWithArgs <TValue>(Func <object[], TValue> creatorWithArgs)
     where TValue : TKey
 {
     DI.BindByBinder(BindedKey, typeof(TValue), creatorWithArgs, IsExampleBind, IsSingleton);
 }
Пример #3
0
 /// <summary>
 /// Bind binding type to self, instances will be made by reflection.
 /// </summary>
 public void ToSelf()
 {
     DI.BindByBinder(BindedKey, BindedKey.KeyType, null, IsExampleBind, IsSingleton);
 }