• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IFormatterConverter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



IFormatterConverter类属于命名空间,在下文中一共展示了IFormatterConverter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: Init

        internal void Init(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, ObjectManager objectManager, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, bool bSimpleAssembly)
        {
            _objectType = objectType;
            _objectManager = objectManager;
            _context = context;
            _serObjectInfoInit = serObjectInfoInit;
            _formatterConverter = converter;
            _isSimpleAssembly = bSimpleAssembly;

            InitReadConstructor(objectType, surrogateSelector, context);
        }
开发者ID:dotnet,项目名称:corefx,代码行数:11,代码来源:BinaryObjectInfo.cs


示例16: SerializationInfo

 public SerializationInfo(Type type, IFormatterConverter converter)
 {
   Contract.Requires(type.Module != null);
   Contract.Requires(type.Module.Assembly != null);
   Contract.Ensures(type.Module.Assembly != null);
 }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:6,代码来源:System.Runtime.Serialization.SerializationInfo.cs


示例17: 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


示例18: Serialize

        internal void Serialize(object graph, BinaryFormatterWriter serWriter, bool fCheck)
        {
            if (graph == null)
            {
                throw new ArgumentNullException(nameof(graph));
            }
            if (serWriter == null)
            {
                throw new ArgumentNullException(nameof(serWriter));
            }

            _serWriter = serWriter;

            serWriter.WriteBegin();
            long headerId = 0;
            object obj;
            long objectId;
            bool isNew;

            // allocations if methodCall or methodResponse and no graph
            _idGenerator = new ObjectIDGenerator();
            _objectQueue = new Queue<object>();
            _formatterConverter = new FormatterConverter();
            _serObjectInfoInit = new SerObjectInfoInit();

            _topId = InternalGetId(graph, false, null, out isNew);
            headerId = -1;
            WriteSerializedStreamHeader(_topId, headerId);

            _objectQueue.Enqueue(graph);
            while ((obj = GetNext(out objectId)) != null)
            {
                WriteObjectInfo objectInfo = null;

                // GetNext will return either an object or a WriteObjectInfo. 
                // A WriteObjectInfo is returned if this object was member of another object
                if (obj is WriteObjectInfo)
                {
                    objectInfo = (WriteObjectInfo)obj;
                }
                else
                {
                    objectInfo = WriteObjectInfo.Serialize(obj, _surrogates, _context, _serObjectInfoInit, _formatterConverter, this, _binder);
                    objectInfo._assemId = GetAssemblyId(objectInfo);
                }

                objectInfo._objectId = objectId;
                NameInfo typeNameInfo = TypeToNameInfo(objectInfo);
                Write(objectInfo, typeNameInfo, typeNameInfo);
                PutNameInfo(typeNameInfo);
                objectInfo.ObjectEnd();
            }

            serWriter.WriteSerializationHeaderEnd();
            serWriter.WriteEnd();

            // Invoke OnSerialized Event
            _objectManager.RaiseOnSerializedEvent();
        }
开发者ID:dotnet,项目名称:corefx,代码行数:59,代码来源:BinaryObjectWriter.cs


示例19: ObjectWriter

 internal ObjectWriter(Stream stream, ISurrogateSelector selector, StreamingContext context, InternalFE formatterEnums)
 {
     if (stream == null)
     {
         throw new ArgumentNullException("stream", SoapUtil.GetResourceString("ArgumentNull_Stream"));
     }
     this.m_stream = stream;
     this.m_surrogates = selector;
     this.m_context = context;
     this.formatterEnums = formatterEnums;
     this.m_objectManager = new SerializationObjectManager(context);
     this.m_formatterConverter = new FormatterConverter();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:ObjectWriter.cs


示例20: ObjectReader

 internal ObjectReader(Stream stream, ISurrogateSelector selector, StreamingContext context, InternalFE formatterEnums, SerializationBinder binder)
 {
     if (stream == null)
     {
         throw new ArgumentNullException("stream", SoapUtil.GetResourceString("ArgumentNull_Stream"));
     }
     this.m_stream = stream;
     this.m_surrogates = selector;
     this.m_context = context;
     this.m_binder = binder;
     this.formatterEnums = formatterEnums;
     if (formatterEnums.FEtopObject != null)
     {
         this.IsFakeTopObject = true;
     }
     else
     {
         this.IsFakeTopObject = false;
     }
     this.m_formatterConverter = new FormatterConverter();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:21,代码来源:ObjectReader.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IFormatterLogger类代码示例发布时间:2022-05-24
下一篇:
C# IFormatter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap