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


C# SerializationWriter.WriteByte方法代码示例

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


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

示例1: Serialize

 public new void Serialize(SerializationWriter writer, object value)
 {
     base.Serialize(writer, this);
     writer.WriteByte((Byte)Behaviour);
 }
开发者ID:TheByte,项目名称:sones,代码行数:5,代码来源:SettingInvalidReferenceHandling.cs

示例2: Serialize

            public Byte[] Serialize()
            {
                SerializationWriter writer = new SerializationWriter();

                writer.WriteString(ServiceGlobalUniqueName);
                writer.WriteString(ServiceUri.ToString());
                writer.WriteByte((Byte)ServiceType);

                return writer.ToArray();
            }
开发者ID:TheByte,项目名称:sones,代码行数:10,代码来源:NSD_StorageEngine.cs

示例3: Serialize

        public override void Serialize(ref SerializationWriter mySerializationWriter)
        {
            try
            {

                #region Write Common attributes

                mySerializationWriter.WriteUInt64(_CreationTime);
                mySerializationWriter.WriteUInt64(_LastAccessTime);
                mySerializationWriter.WriteUInt64(_LastModificationTime);
                mySerializationWriter.WriteUInt64(_DeletionTime);
                mySerializationWriter.WriteUInt64(_ObjectSize);

                #endregion

                #region Object Safety and Security

                mySerializationWriter.WriteByte((Byte)_IntegrityCheckAlgorithm);
                mySerializationWriter.WriteByte((Byte)_EncryptionAlgorithm);

                #endregion

                #region Write list of ObjectLocatorPositions

                mySerializationWriter.WriteUInt64(_ObjectLocatorLength);
                mySerializationWriter.WriteUInt64(_ObjectLocatorCopies);

                mySerializationWriter.WriteUInt16((UInt16)Math.Min(_ObjectLocatorPositions.Count, MaxNumberOfObjectLocatorPositions));

                for (int i=0; i < Math.Min(_ObjectLocatorPositions.Count, MaxNumberOfObjectLocatorPositions - 1); i++)
                {
                    _ObjectLocatorPositions[i].StorageUUID.Serialize(ref mySerializationWriter);
                    mySerializationWriter.WriteUInt64(_ObjectLocatorPositions[i].Position);
                }

                #endregion

                #region Write list of INodePositions

                mySerializationWriter.WriteUInt16((UInt16)Math.Min(_INodePositions.Count, MaxNumberOfINodePositions));

                // for (int i=0; i < Math.Min(_INodePositions.Count, MaxNumberOfINodePositions - 1); i++) <- Why -1?
                for (int i=0; i < Math.Min(_INodePositions.Count, MaxNumberOfINodePositions); i++)
                {
                    _INodePositions[i].StorageUUID.Serialize(ref mySerializationWriter);
                    mySerializationWriter.WriteUInt64(_INodePositions[i].Position);
                }

                #endregion

                #region Write State

                mySerializationWriter.WriteByte((Byte)_ObjectLocatorStates);

                #endregion

            }

            catch (SerializationException e)
            {
                throw new SerializationException(e.Message);
            }
        }
开发者ID:TheByte,项目名称:sones,代码行数:63,代码来源:INode.cs

示例4: Serialize

            public Byte[] Serialize()
            {
                var _SerializationWriter = new SerializationWriter();

                _SerializationWriter.WriteString(ObjectLocation);
                _SerializationWriter.WriteByte(NewDefaultRule);

                return _SerializationWriter.ToArray();
            }
开发者ID:TheByte,项目名称:sones,代码行数:9,代码来源:NAccessControl_DefaultRuleChanged.cs

示例5: Serialize

        public override void Serialize(ref SerializationWriter mySerializationWriter)
        {
            try
            {

                #region NotificationHandling

                mySerializationWriter.WriteByte((Byte)_NotificationHandling);

                #endregion

                #region DefaultRule

                mySerializationWriter.WriteByte((Byte)_DefaultRule);

                #endregion

                #region AllowACL

                // Write number of AllowACL items
                mySerializationWriter.WriteUInt64((UInt64)_AllowACL.Count);

                foreach (KeyValuePair<RightUUID, HashSet<EntityUUID>> _KeyValuePair in _AllowACL)
                {

                    // KEY: RightUUID
                    mySerializationWriter.Write(_KeyValuePair.Key.GetByteArray());

                    // VALUE:
                    // Write number of HashSet elements
                    mySerializationWriter.WriteUInt64((UInt64)_KeyValuePair.Value.Count);

                    // Write the elements itself
                    foreach (EntityUUID _HashItem in _KeyValuePair.Value)
                        mySerializationWriter.Write(_HashItem.GetByteArray());

                }

                #endregion

                #region DenyACL

                // Write number of DenyACL items
                mySerializationWriter.WriteUInt64( (UInt64) _DenyACL.Count);

                foreach (KeyValuePair<RightUUID, HashSet<EntityUUID>> _KeyValuePair in _DenyACL)
                {

                    // KEY:
                    mySerializationWriter.Write(_KeyValuePair.Key.GetByteArray());

                    // VALUE:
                    // Write number of HashSet elements
                    mySerializationWriter.WriteUInt64( (UInt64) _KeyValuePair.Value.Count);

                    // Write the elements itself
                    foreach (EntityUUID _HashItem in _KeyValuePair.Value)
                        mySerializationWriter.Write(_HashItem.GetByteArray());

                }

                #endregion

            }

            catch (SerializationException e)
            {
                throw new SerializationException(e.Message);
            }
        }
开发者ID:ipbi,项目名称:sones,代码行数:70,代码来源:AccessControlObject.cs

示例6: Serialize

        public void Serialize(SerializationWriter mySerializationWriter, object value)
        {
            LicensedFeatures thisObject = (LicensedFeatures)value;

            mySerializationWriter.WriteObject((UInt32)thisObject.Features.Count);

            foreach (var entry in thisObject.Features)
                mySerializationWriter.WriteByte((Byte)entry);

            mySerializationWriter.WriteInt32(thisObject.NumberOfLicensedCPUs);
            mySerializationWriter.WriteInt32(thisObject.NumberOfLicensedRAM);
        }
开发者ID:TheByte,项目名称:sones,代码行数:12,代码来源:LicensedFeatures.cs

示例7: Serialize

        public void Serialize(ref SerializationWriter mySerializationWriter)
        {
            if (mySerializationWriter != null)
            {

                UUID.Serialize(ref mySerializationWriter);
                DBTypeUUID.Serialize(ref mySerializationWriter);
                mySerializationWriter.WriteByte((byte)KindOfType);
                TypeCharacteristics.Serialize(ref mySerializationWriter);

                mySerializationWriter.WriteString(Name);

                mySerializationWriter.WriteBoolean(EdgeType != null);
                if (EdgeType != null)
                    mySerializationWriter.WriteObject(EdgeType);

                RelatedGraphDBTypeUUID.Serialize(ref mySerializationWriter);

                if (TypeCharacteristics.IsBackwardEdge)
                    mySerializationWriter.WriteObject(BackwardEdgeDefinition);

                mySerializationWriter.WriteObject(DefaultValue);

                // Write Settings
                mySerializationWriter.WriteUInt32((UInt32)_Settings.Count);
                foreach (var _KVPair in _Settings)
                    mySerializationWriter.WriteObject(_KVPair.Value);
            }
        }
开发者ID:TheByte,项目名称:sones,代码行数:29,代码来源:TypeAttribute.cs


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