示例#1
0
 /// <summary>
 /// Creates an instance of a given type from the resources with the specified names.
 /// </summary>
 /// <typeparam name="TYPE">The type to create.</typeparam>
 /// <param name="names">A list of resource names.</param>
 /// <returns>
 /// An instance of the given type.
 /// </returns>
 public TYPE Load <TYPE>(IEnumerable <string> names) where TYPE : class
 {
     try
     {
         return(contentManager.Load <TYPE>(names));
     }
     catch (ShaderException e)
     {
         ShaderErrorHandling(e);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
     }
     return(null);
 }
示例#2
0
 /// <summary>
 /// Creates an instance of a given type from the resources with the specified names.
 /// </summary>
 /// <typeparam name="TYPE">The type to create.</typeparam>
 /// <param name="names">A list of resource names.</param>
 /// <returns>
 /// An instance of the given type.
 /// </returns>
 public TYPE Load <TYPE>(IEnumerable <string> names) where TYPE : class
 {
     try
     {
         return(contentManager.Load <TYPE>(names));
     }
     catch (NamedShaderException e)
     {
         ShowExceptionForm(e.InnerException, e.Name);
     }
     //throw all other exceptions
     //catch (Exception e)
     //{
     //	Console.WriteLine(e.ToString());
     //}
     return(null);
 }
示例#3
0
 /// <summary>
 /// Creates an instance of a given type from the resources with the specified names.
 /// </summary>
 /// <typeparam name="TYPE">The type to create.</typeparam>
 /// <param name="names">A list of resource names.</param>
 /// <returns>
 /// An instance of the given type.
 /// </returns>
 public TYPE Load <TYPE>(IEnumerable <string> names) where TYPE : class
 {
     try
     {
         var instance = contentManager.Load <TYPE>(names);
         Debug.WriteLine($"Load of '{string.Join(";", names)}' into {typeof(TYPE).FullName}.");
         return(instance);
     }
     catch (NamedShaderException e)
     {
         ShowExceptionForm(e.InnerException, e.Name);
     }
     //throw all other exceptions
     //catch (Exception e)
     //{
     //	Console.WriteLine(e.ToString());
     //}
     return(null);
 }
示例#4
0
 /// <summary>
 /// Creates an instance of a given type from the resources with the specified names.
 /// </summary>
 /// <typeparam name="TYPE">The type to create.</typeparam>
 /// <param name="names">A list of resource names.</param>
 /// <returns>
 /// An instance of the given type.
 /// </returns>
 public TYPE Load <TYPE>(IEnumerable <string> names) where TYPE : class
 {
     return(contentManager.Load <TYPE>(names));
 }