コード例 #1
0
        /// <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);
        }
コード例 #2
0
            // -----------------------------------------------------------------
            /// <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));
            }
コード例 #3
0
 static AbstractDownloadState()
 {
     NameToType = KnownSubTypes.ToDictionary(t => t.FullName !.Substring(t.Namespace !.Length + 1), t => t);
     TypeToName = NameToType.ToDictionary(k => k.Value, k => k.Key);
 }
コード例 #4
0
ファイル: TypeLogic.cs プロジェクト: fbustamanteb/framework
 public static Type TryGetType(string cleanName)
 {
     return(NameToType.TryGetC(cleanName));
 }
コード例 #5
0
ファイル: TypeLogic.cs プロジェクト: fbustamanteb/framework
 public static Type GetType(string cleanName)
 {
     return(NameToType.GetOrThrow(cleanName, "Type {0} not found in the schema"));
 }
コード例 #6
0
ファイル: AJobPayload.cs プロジェクト: Jeremy-Laier/wabbajack
 static AJobPayload()
 {
     NameToType = KnownSubTypes.ToDictionary(t => t.FullName.Substring(t.Namespace.Length + 1), t => t);
     TypeToName = NameToType.ToDictionary(k => k.Value, k => k.Key);
 }