示例#1
0
 public static bool TryTypeAssert(this go.main_package.V target, Type type, out object result)
 {
     try
     {
         result = target.TypeAssert(type);
         return(true);
     }
     catch (PanicException)
     {
         result = type.IsValueType ? Activator.CreateInstance(type) : null;
         return(false);
     }
 }
示例#2
0
 public static bool TryTypeAssert <T>(this go.main_package.V target, out T result)
 {
     try
     {
         result = target.TypeAssert <T>();
         return(true);
     }
     catch (PanicException)
     {
         result = default(T);
         return(false);
     }
 }