public static object CreateInstance(this IDotnetExpander expander, string name, object[] args = null) { string assemblyName, typeName, value; expander.ParseName(name, out assemblyName, out typeName, out value); if (string.IsNullOrWhiteSpace(value)) { return(expander.CreateInstance(assemblyName, typeName, args)); } var type = expander.GetType(assemblyName, typeName); return(ValueExtensions.IsPrimitive(type) ? value.As(type) : expander.CreateInstance(assemblyName, typeName, args)); }
public static T CreateInstance <T>(this IDotnetExpander expander, object[] args = null) { return((T)expander.CreateInstance(typeof(T), args)); }
public static object CreateInstance(this IDotnetExpander expander, string assemblyName, string typeName, object[] args = null) { return(expander.CreateInstance(expander.GetType(assemblyName, typeName), args)); }
public static T CreateInstance <T>(this IDotnetExpander expander, string assemblyName, string typeName, object[] args = null) { return((T)expander.CreateInstance(assemblyName, typeName, args)); }
public static T CreateInstance <T>(this IDotnetExpander expander, string name, object[] args = null) { return((T)expander.CreateInstance(name, args)); }