示例#1
0
 /// <summary>
 /// Gets the terminal resource for a given type or null if there is no such resource
 /// </summary>
 public ITerminalResource <T> SafeGetTerminalResource <T>() where T : Terminal => ResourceByType.SafeGet(typeof(T)) as ITerminalResource <T>;
示例#2
0
 /// <summary>
 /// Gets the terminal resource for a given type, and throws an UnknownResource exception
 /// if there is no such resource
 /// </summary>
 public ITerminalResource <T> GetTerminalResource <T>() where T : Terminal => ResourceByType.SafeGet(typeof(T)) as ITerminalResource <T>
 ?? throw new UnknownResource(typeof(T).GetRESTableTypeName());
示例#3
0
 /// <summary>
 /// Gets the terminal resource for a given type or null if there is no such resource
 /// </summary>
 public IResource <T> SafeGetResource <T>() where T : class => ResourceByType.SafeGet(typeof(T)) as IResource <T>;
示例#4
0
 /// <summary>
 /// Gets the terminal resource for a given type, and throws an UnknownResource exception
 /// if there is no such resource
 /// </summary>
 public IResource <T> GetResource <T>() where T : class => ResourceByType.SafeGet(typeof(T)) as IResource <T>
 ?? throw new UnknownResource(typeof(T).GetRESTableTypeName());
示例#5
0
 /// <summary>
 /// Gets the resource for a given type or returns null if there is no such resource
 /// </summary>
 public IResource SafeGetResource(Type type) => ResourceByType.SafeGet(type);
示例#6
0
 /// Gets the resource for a given type, or throws an UnknownResource exception if there is no such resource
 /// </summary>
 public IResource GetResource(Type type) => ResourceByType.SafeGet(type) ?? throw new UnknownResource(type.GetRESTableTypeName());