示例#1
0
        public static IRedBaseHandle Parse(Type handleType, RedBaseClass value)
        {
            var method  = typeof(CHandle).GetMethod(nameof(Parse), BindingFlags.Public | BindingFlags.Static, null, new[] { typeof(RedBaseClass) }, null);
            var generic = method.MakeGenericMethod(handleType);

            return((IRedBaseHandle)generic.Invoke(null, new object[] { value }));
        }
示例#2
0
 public static CHandle <T> Parse <T>(RedBaseClass value) where T : RedBaseClass
 {
     return(new CHandle <T>((T)value));
 }