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


C# BinaryReader.ReadObject方法代码示例

本文整理汇总了C#中BinaryReader.ReadObject方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryReader.ReadObject方法的具体用法?C# BinaryReader.ReadObject怎么用?C# BinaryReader.ReadObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BinaryReader的用法示例。


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

示例1: ComputeJobHolder

        /// <summary>
        /// Default ctor for marshalling.
        /// </summary>
        /// <param name="reader"></param>
        public ComputeJobHolder(BinaryReader reader)
        {
            Debug.Assert(reader != null);

            _ignite = reader.Marshaller.Ignite;

            _job = reader.ReadObject<IComputeJob>();
        }
开发者ID:juanavelez,项目名称:ignite,代码行数:12,代码来源:ComputeJobHolder.cs

示例2: ServiceDescriptor

        /// <summary>
        /// Initializes a new instance of the <see cref="ServiceDescriptor" /> class.
        /// </summary>
        /// <param name="name">Name.</param>
        /// <param name="reader">Reader.</param>
        /// <param name="services">Services.</param>
        public ServiceDescriptor(string name, BinaryReader reader, IServices services)
        {
            Debug.Assert(reader != null);
            Debug.Assert(services != null);
            Debug.Assert(!string.IsNullOrEmpty(name));

            _services = services;
            Name = name;

            CacheName = reader.ReadString();
            MaxPerNodeCount = reader.ReadInt();
            TotalCount = reader.ReadInt();
            OriginNodeId = reader.ReadGuid() ?? Guid.Empty;
            AffinityKey = reader.ReadObject<object>();

            var mapSize = reader.ReadInt();
            var snap = new Dictionary<Guid, int>(mapSize);

            for (var i = 0; i < mapSize; i++)
                snap[reader.ReadGuid() ?? Guid.Empty] = reader.ReadInt();

            TopologySnapshot = snap.AsReadOnly();
        }
开发者ID:dheep-purdessy,项目名称:ignite,代码行数:29,代码来源:ServiceDescriptor.cs

示例3: ReadNullableList

        /// <summary>
        /// Reads nullable list.
        /// </summary>
        /// <param name="reader">Reader.</param>
        /// <returns>List.</returns>
        private static List<object> ReadNullableList(BinaryReader reader)
        {
            if (!reader.ReadBoolean())
                return null;

            var size = reader.ReadInt();

            var list = new List<object>(size);

            for (int i = 0; i < size; i++)
                list.Add(reader.ReadObject<object>());

            return list;
        }
开发者ID:kjniemi,项目名称:ignite,代码行数:19,代码来源:ExceptionUtils.cs

示例4: CacheEntryFilterHolder

        /// <summary>
        /// Initializes a new instance of the <see cref="CacheEntryFilterHolder"/> class.
        /// </summary>
        /// <param name="reader">The reader.</param>
        public CacheEntryFilterHolder(BinaryReader reader)
        {
            _pred = reader.ReadObject<object>();

            _keepBinary = reader.ReadBoolean();

            _marsh = reader.Marshaller;

            _invoker = GetInvoker(_pred);
        }
开发者ID:juanavelez,项目名称:ignite,代码行数:14,代码来源:CacheEntryFilterHolder.cs


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