当前位置: 首页>>代码示例>>C#>>正文


C# IFormatterConverter类代码示例

本文整理汇总了C#中IFormatterConverter的典型用法代码示例。如果您正苦于以下问题:C# IFormatterConverter类的具体用法?C# IFormatterConverter怎么用?C# IFormatterConverter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IFormatterConverter类属于命名空间,在下文中一共展示了IFormatterConverter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SerializationInfo

        public SerializationInfo(Type type, IFormatterConverter converter, bool requireSameTokenInPartialTrust)
#endif
        {
            if ((object)type == null)
            {
                throw new ArgumentNullException("type");
            }

            if (converter == null)
            {
                throw new ArgumentNullException("converter");
            }

            Contract.EndContractBlock();

            objectType = type;
            m_fullTypeName = type.FullName;
            m_assemName = type.Module.Assembly.FullName;

            m_members = new String[defaultSize];
            m_data = new Object[defaultSize];
            m_types = new Type[defaultSize];

            m_converter = converter;

#if FEATURE_SERIALIZATION
            this.requireSameTokenInPartialTrust = requireSameTokenInPartialTrust;
#endif
        }
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:29,代码来源:serializationinfo.cs

示例2: SerializationInfo

    public SerializationInfo(Type type, IFormatterConverter converter)
    {
      if (null == type)
      {
        throw new ArgumentNullException("type");
      }

      if (converter == null)
      {
        throw new ArgumentNullException("converter");
      }


      m_fullTypeName = type.FullName;
      m_assemName = type.Module.Assembly.FullName;
      Debug.Assert(m_fullTypeName != null, "[SerializationInfo.ctor]m_fullTypeName!=null");
      Debug.Assert(m_assemName != null, "[SerializationInfo.ctor]m_assemName!=null");

      m_members = new String[defaultSize];
      m_data = new Object[defaultSize];
      m_types = new Type[defaultSize];

      m_converter = converter;

      m_currMember = 0;

    }
开发者ID:antonovicha,项目名称:EmitMapperRedux,代码行数:27,代码来源:SerializationInfo.cs

示例3: SerializationInfo

        public SerializationInfo(Type type, IFormatterConverter converter, bool requireSameTokenInPartialTrust)
        {
            if ((object)type == null)
            {
                throw new ArgumentNullException("type");
            }

            if (converter == null)
            {
                throw new ArgumentNullException("converter");
            }

            Contract.EndContractBlock();

            objectType = type;
            m_fullTypeName = type.FullName;
            m_assemName = type.Module.Assembly.FullName;

            m_members = new String[defaultSize];
            m_data = new Object[defaultSize];
            m_types = new Type[defaultSize];

            m_nameToIndex = new Dictionary<string, int>();

            m_converter = converter;

            this.requireSameTokenInPartialTrust = requireSameTokenInPartialTrust;
        }
开发者ID:l1183479157,项目名称:coreclr,代码行数:28,代码来源:SerializationInfo.cs

示例4: SerializationInfo

		public SerializationInfo (Type type, IFormatterConverter converter)
		{
			if (type == null)
				throw new ArgumentNullException ("type", "Null argument");

			if (converter == null)
				throw new ArgumentNullException ("converter", "Null argument");
			
			this.converter = converter;
			assemblyName = type.Assembly.FullName;
			fullTypeName = type.FullName;
		}
开发者ID:runefs,项目名称:Marvin,代码行数:12,代码来源:SerializationInfo.cs

示例5: SerializationInfo

	public SerializationInfo(Type type, IFormatterConverter converter)
			{
				if(type == null)
				{
					throw new ArgumentNullException("type");
				}
				if(converter == null)
				{
					throw new ArgumentNullException("converter");
				}
				this.converter = converter;
				this.assemblyName = type.Assembly.FullName;
				this.fullTypeName = type.FullName;
				this.names = new ArrayList();
				this.values = new ArrayList();
				this.types = new ArrayList();
				this.generation = 0;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:18,代码来源:SerializationInfo.cs

示例6: InitSerialize

        // Write constructor
        internal void InitSerialize(object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
        {
            _context = context;
            _obj = obj;
            _serObjectInfoInit = serObjectInfoInit;
            _objectType = obj.GetType();

            if (_objectType.IsArray)
            {
                _isArray = true;
                InitNoMembers();
                return;
            }

            InvokeSerializationBinder(binder);
            objectWriter.ObjectManager.RegisterObject(obj);

            ISurrogateSelector surrogateSelectorTemp;
            if (surrogateSelector != null && (_serializationSurrogate = surrogateSelector.GetSurrogate(_objectType, context, out surrogateSelectorTemp)) != null)
            {
                _si = new SerializationInfo(_objectType, converter);
                if (!_objectType.IsPrimitive)
                {
                    _serializationSurrogate.GetObjectData(obj, _si, context);
                }
                InitSiWrite();
            }
            else if (obj is ISerializable)
            {
                if (!_objectType.IsSerializable)
                {
                    throw new SerializationException(SR.Format(SR.Serialization_NonSerType, _objectType.FullName, _objectType.Assembly.FullName));
                }
                _si = new SerializationInfo(_objectType, converter);
                ((ISerializable)obj).GetObjectData(_si, context);
                InitSiWrite();
                CheckTypeForwardedFrom(_cache, _objectType, _binderAssemblyString);
            }
            else
            {
                InitMemberInfo();
                CheckTypeForwardedFrom(_cache, _objectType, _binderAssemblyString);
            }
        }
开发者ID:dotnet,项目名称:corefx,代码行数:45,代码来源:BinaryObjectInfo.cs

示例7: SerializationInfo

 public SerializationInfo(Type type, IFormatterConverter converter, bool requireSameTokenInPartialTrust)
 {
     if (type == null)
     {
         throw new ArgumentNullException("type");
     }
     if (converter == null)
     {
         throw new ArgumentNullException("converter");
     }
     this.objectType = type;
     this.m_fullTypeName = type.FullName;
     this.m_assemName = type.Module.Assembly.FullName;
     this.m_members = new string[4];
     this.m_data = new object[4];
     this.m_types = new Type[4];
     this.m_converter = converter;
     this.m_currMember = 0;
     this.requireSameTokenInPartialTrust = requireSameTokenInPartialTrust;
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:20,代码来源:SerializationInfo.cs

示例8: SerializationInfo

        public SerializationInfo(Type type, IFormatterConverter converter)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }
            if (converter == null)
            {
                throw new ArgumentNullException(nameof(converter));
            }

            _rootType = type;
            _rootTypeName = type.FullName;
            _rootTypeAssemblyName = type.Module.Assembly.FullName;

            _names = new string[DefaultSize];
            _values = new object[DefaultSize];
            _types = new Type[DefaultSize];
            _nameToIndex = new LowLevelListDictionary();
            _converter = converter;
        }
开发者ID:nattress,项目名称:corert,代码行数:21,代码来源:SerializationInfo.cs

示例9: SerializationInfo

        public SerializationInfo(Type type, IFormatterConverter converter)
        {
            if ((object)type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            if (converter == null)
            {
                throw new ArgumentNullException(nameof(converter));
            }

            _rootType = type;
            _rootTypeName = type.FullName;
            _rootTypeAssemblyName = type.GetTypeInfo().Module.Assembly.FullName;

            _names = new String[defaultSize];
            _values = new object[defaultSize];
            _types = new Type[defaultSize];

            _nameToIndex = new Dictionary<string, int>();

            _converter = converter;
        }
开发者ID:ESgarbi,项目名称:corefx,代码行数:24,代码来源:SerializationInfo.cs

示例10: SerializationInfo

        public SerializationInfo(Type type, IFormatterConverter converter) { 
            if ((object)type == null) { 
                throw new ArgumentNullException("type");
            } 

            if (converter==null) {
                throw new ArgumentNullException("converter");
            } 

            Contract.EndContractBlock(); 
 
            objectType = type;
            m_fullTypeName = type.FullName; 
            m_assemName = type.Module.Assembly.FullName;

            m_members = new String[defaultSize];
            m_data   = new Object[defaultSize]; 
            m_types  = new Type[defaultSize];
 
            m_converter = converter; 

            m_currMember = 0; 

        }
开发者ID:wsky,项目名称:System.Runtime.Remoting,代码行数:24,代码来源:SerializationInfo.cs

示例11: Init

        [System.Security.SecurityCritical]  // auto-generated
        internal void Init(Type objectType, String[] memberNames, Type[] memberTypes, ISurrogateSelector surrogateSelector, StreamingContext context, ObjectManager objectManager, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, bool bSimpleAssembly)
        {
            SerTrace.Log( this,objectInfoId, " Constructor 5 ",objectType);
            this.objectType = objectType;
            this.objectManager = objectManager;
            this.wireMemberNames = memberNames;
            this.wireMemberTypes = memberTypes;
            this.context = context;
            this.serObjectInfoInit = serObjectInfoInit;
            this.formatterConverter = converter;
            this.bSimpleAssembly = bSimpleAssembly;
            if (memberNames != null)
                isNamed = true;
            if (memberTypes != null)
                isTyped = true;

            if ((object)objectType != null)
                InitReadConstructor(objectType, surrogateSelector, context);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:20,代码来源:BinaryObjectInfo.cs

示例12: Create

 [System.Security.SecurityCritical]  // auto-generated
 internal static ReadObjectInfo Create(Type objectType, String[] memberNames, Type[] memberTypes, ISurrogateSelector surrogateSelector, StreamingContext context, ObjectManager objectManager, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, bool bSimpleAssembly)
 {
     ReadObjectInfo soi = GetObjectInfo(serObjectInfoInit);
     soi.Init(objectType, memberNames,memberTypes, surrogateSelector, context, objectManager, serObjectInfoInit, converter, bSimpleAssembly);
     return soi;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:BinaryObjectInfo.cs

示例13: InitSerialize

        [System.Security.SecurityCritical]  // auto-generated
        internal void InitSerialize(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, SerializationBinder binder)
        {

            SerTrace.Log( this, objectInfoId," Constructor 2 ",objectType);

            this.objectType = objectType;
            this.context = context;
            this.serObjectInfoInit = serObjectInfoInit;

            if (objectType.IsArray)
            {
                InitNoMembers();
                return;
            }

            InvokeSerializationBinder(binder);

            ISurrogateSelector surrogateSelectorTemp = null;

            if (surrogateSelector!=null)
                serializationSurrogate = surrogateSelector.GetSurrogate(objectType, context, out surrogateSelectorTemp);

            if (serializationSurrogate != null)
            {
                // surrogate does not have this problem since user has pass in through the BF's ctor
                si = new SerializationInfo(objectType, converter);
                cache = new SerObjectInfoCache(objectType);

                isSi = true;
            }
            else if (Object.ReferenceEquals(objectType, Converter.typeofObject))
            {
            }
            else if (Converter.typeofISerializable.IsAssignableFrom(objectType))
            {
                si = new SerializationInfo(objectType, converter, !FormatterServices.UnsafeTypeForwardersIsEnabled());
                cache = new SerObjectInfoCache(objectType);
                CheckTypeForwardedFrom(cache, objectType, binderAssemblyString);

                isSi = true;
            }

            if (!isSi)
            {
                InitMemberInfo();
                CheckTypeForwardedFrom(cache, objectType, binderAssemblyString);
            }

            SerTrace.Log( this,objectInfoId," ", objectType," InitSerialize Exit ",isSi);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:51,代码来源:BinaryObjectInfo.cs

示例14: Serialize

 [System.Security.SecurityCritical]  // auto-generated
 internal static WriteObjectInfo Serialize(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, SerializationBinder binder)
 {
     WriteObjectInfo soi = GetObjectInfo(serObjectInfoInit);
     soi.InitSerialize(objectType, surrogateSelector, context, serObjectInfoInit, converter, binder);
     return soi;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:BinaryObjectInfo.cs

示例15: SerializationInfo

		/* used by the runtime */
		private SerializationInfo (Type type)
		{
			assemblyName = type.Assembly.FullName;
			fullTypeName = type.FullName;
			converter = new FormatterConverter ();
			objectType = type;
		}
开发者ID:shana,项目名称:mono,代码行数:8,代码来源:SerializationInfo.cs


注:本文中的IFormatterConverter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。