public static string GetTypeName(Type t, FormatterAssemblyStyle assemblyFormat, SerializationBinder binder)
        {
            string text2;

            if (binder != null)
            {
                string text;
                string str;
                binder.BindToName(t, out text, out str);
                text2 = str + ((text == null) ? "" : (", " + text));
            }
            else
            {
                text2 = t.AssemblyQualifiedName;
            }
            switch (assemblyFormat)
            {
            case FormatterAssemblyStyle.Simple:
                return(ReflectionUtils.RemoveAssemblyDetails(text2));

            case FormatterAssemblyStyle.Full:
                return(text2);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Example #2
0
        // Token: 0x06000E1E RID: 3614 RVA: 0x0005192C File Offset: 0x0004FB2C
        public static string GetTypeName(Type t, TypeNameAssemblyFormatHandling assemblyFormat, [Nullable(2)] ISerializationBinder binder)
        {
            string fullyQualifiedTypeName = ReflectionUtils.GetFullyQualifiedTypeName(t, binder);

            if (assemblyFormat == TypeNameAssemblyFormatHandling.Simple)
            {
                return(ReflectionUtils.RemoveAssemblyDetails(fullyQualifiedTypeName));
            }
            if (assemblyFormat != TypeNameAssemblyFormatHandling.Full)
            {
                throw new ArgumentOutOfRangeException();
            }
            return(fullyQualifiedTypeName);
        }
Example #3
0
        public static string GetTypeName(Type t, FormatterAssemblyStyle assemblyFormat, SerializationBinder binder)
        {
            string assemblyQualifiedName = t.AssemblyQualifiedName;

            if (assemblyFormat == FormatterAssemblyStyle.Simple)
            {
                return(ReflectionUtils.RemoveAssemblyDetails(assemblyQualifiedName));
            }
            if (assemblyFormat != FormatterAssemblyStyle.Full)
            {
                throw new ArgumentOutOfRangeException();
            }
            return(assemblyQualifiedName);
        }
Example #4
0
        public static string GetTypeName(Type t, FormatterAssemblyStyle assemblyFormat, SerializationBinder binder)
        {
            string assemblyQualifiedName = t.AssemblyQualifiedName;

            switch (assemblyFormat)
            {
            case FormatterAssemblyStyle.Simple:
                return(ReflectionUtils.RemoveAssemblyDetails(assemblyQualifiedName));

            case FormatterAssemblyStyle.Full:
                return(assemblyQualifiedName);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }