/// <summary> /// Returns the type that this reference is of. /// </summary> public static Type GetType(string fullTypeName) { if (NameToType.TryGetValue(fullTypeName, out Type resultType)) { return(resultType); } return(null); }
// ----------------------------------------------------------------- /// <summary> /// /// </summary> // ----------------------------------------------------------------- public override Type BindToType(string assemblyName, string typeName) { if (NameToType.ContainsKey(typeName)) { return(NameToType[typeName]); } string resolvedTypeName = string.Format(TypeFormat, typeName, assemblyName); return(Type.GetType(resolvedTypeName, true)); }
static AbstractDownloadState() { NameToType = KnownSubTypes.ToDictionary(t => t.FullName !.Substring(t.Namespace !.Length + 1), t => t); TypeToName = NameToType.ToDictionary(k => k.Value, k => k.Key); }
public static Type TryGetType(string cleanName) { return(NameToType.TryGetC(cleanName)); }
public static Type GetType(string cleanName) { return(NameToType.GetOrThrow(cleanName, "Type {0} not found in the schema")); }
static AJobPayload() { NameToType = KnownSubTypes.ToDictionary(t => t.FullName.Substring(t.Namespace.Length + 1), t => t); TypeToName = NameToType.ToDictionary(k => k.Value, k => k.Key); }