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 })); }
public static CHandle <T> Parse <T>(RedBaseClass value) where T : RedBaseClass { return(new CHandle <T>((T)value)); }