コード例 #1
0
 /// <summary>
 /// Provides an instance with given type and unique title.
 /// </summary>
 /// <param name="type"></param>
 /// <param name="title"></param>
 /// <returns>Requested object from subregister or if nothing found null.</returns>
 public object ProvideInstance(string type, string title)
 {
     try
     {
         return(register.ProvideInstance(type, title));
     }
     catch (ArgumentNullException e)
     {
         ExceptionHandler.LogException("Type or titel are null.", e);
     }
     catch (KeyNotFoundException e)
     {
         ExceptionHandler.LogException("The property is retrieved. Type and/or id does not exist in the subregister.", e);
     }
     return(null);
 }
コード例 #2
0
 /// <summary>
 /// Provides a instance of any type of the instance register.
 /// </summary>
 /// <param name="type">Type of the searched instance.</param>
 /// <param name="title">Unique title of searched instance.</param>
 /// <returns>Protocol manager instance if it is known.</returns>
 public IProtocolManager GetInstance(InstanceType type, string title)
 {
     return(register.ProvideInstance(type, title) as IProtocolManager);
 }