System.Xml.Serialization.DynamicAssemblies.GetName C# (CSharp) Method

GetName() static private method

static private GetName ( Assembly a ) : string
a System.Reflection.Assembly
return string
        internal static string GetName(Assembly a)
        {
            return s_assemblyToNameMap != null ? (string)s_assemblyToNameMap[a] : null;
        }
    }

Usage Example

Example #1
0
        private string WriteAssemblyInfo(Type type)
        {
            string fullName = type.Assembly.FullName;
            string str2     = (string)this.reflectionVariables[fullName];

            if (str2 == null)
            {
                int    index = fullName.IndexOf(',');
                string str3  = (index > -1) ? fullName.Substring(0, index) : fullName;
                str2 = this.GenerateVariableName("assembly", str3);
                this.writer.Write("static " + typeof(Assembly).FullName + " " + str2 + " = ResolveDynamicAssembly(");
                this.WriteQuotedCSharpString(DynamicAssemblies.GetName(type.Assembly));
                this.writer.WriteLine(");");
                this.reflectionVariables.Add(fullName, str2);
            }
            return(str2);
        }