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


C# DeserializeContext.ReadString方法代码示例

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


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

示例1: Deserialize

 /// <summary>
 /// Deserializes binary data to object.
 /// </summary>
 /// <param name="context">Context for deserialization</param>
 protected override void Deserialize(DeserializeContext context, byte version)
 {
     base.Deserialize(context, version);
       SystemName = context.ReadMultiLanguageString();
       WelcomeMessage = context.ReadMultiLanguageString();
       Image = context.ReadBytes();
       Url = context.ReadString();
       UpdateVersion = context.ReadString();
       UpdateUrl = context.ReadString();
 }
开发者ID:dbrgn,项目名称:pi-vote,代码行数:14,代码来源:RemoteConfig.cs

示例2: Deserialize

 /// <summary>
 /// Deserializes binary data to object.
 /// </summary>
 /// <param name="context">Context for deserialization</param>
 protected override void Deserialize(DeserializeContext context, byte version)
 {
     base.Deserialize(context, version);
       this.fullName = context.ReadString();
 }
开发者ID:dbrgn,项目名称:pi-vote,代码行数:9,代码来源:NotaryCertificate.cs

示例3: RunExtract

        private void RunExtract()
        {
            try
              {
            Progress = 0;

            FileStream fileStream = new FileStream(this.backupFile, FileMode.Open, FileAccess.Read);
            GZipStream gzipStream = new GZipStream(fileStream, CompressionMode.Decompress);
            DeserializeContext context = new DeserializeContext(gzipStream);

            int fileCount = context.ReadInt32();
            long totalSize = context.ReadInt64();
            long doneSize = 0;

            for (int index = 0; index < fileCount; index++)
            {
              string fileName = context.ReadString();
              FileName = fileName;
              byte[] data = context.ReadBytes();
              File.WriteAllBytes(Path.Combine(this.dataPath, fileName), data);
              doneSize += data.Length;

              Progress = 1d / (double)totalSize * (double)doneSize;
            }

            context.Close();
            gzipStream.Close();
            fileStream.Close();
              }
              catch (Exception exception)
              {
            Exception = exception;
              }

              Complete = true;
        }
开发者ID:dbrgn,项目名称:pi-vote,代码行数:36,代码来源:BackupFile.cs

示例4: Deserialize

 /// <summary>
 /// Deserializes binary data to object.
 /// </summary>
 /// <param name="context">Context for deserialization</param>
 protected override void Deserialize(DeserializeContext context, byte version)
 {
     base.Deserialize(context, version);
       FirstName = context.ReadString();
       FamilyName = context.ReadString();
       EmailAddress = context.ReadString();
 }
开发者ID:dbrgn,项目名称:pi-vote,代码行数:11,代码来源:SignatureRequest.cs

示例5: Deserialize

        /// <summary>
        /// Deserialize a string.
        /// </summary>
        /// <param name="context">Context of the deserialization.</param>
        /// <returns>Deserialized multi language string.</returns>
        public static MultiLanguageString Deserialize(DeserializeContext context)
        {
            int count = context.ReadInt32();
              MultiLanguageString value = new MultiLanguageString();

              for (int index = 0; index < count; index++)
              {
            value.content.Add((Language)context.ReadInt32(), context.ReadString());
              }

              return value;
        }
开发者ID:dbrgn,项目名称:pi-vote,代码行数:17,代码来源:MultiLangaugeString.cs

示例6: Deserialize

 /// <summary>
 /// Deserializes binary data to object.
 /// </summary>
 /// <param name="context">Context for deserialization</param>
 protected override void Deserialize(DeserializeContext context, byte version)
 {
     base.Deserialize(context, version);
       SubjectId = context.ReadGuid();
       Status = (SignatureResponseStatus)context.ReadInt32();
       Reason = context.ReadString();
       Signature = context.ReadObject<Signature>();
 }
开发者ID:dbrgn,项目名称:pi-vote,代码行数:12,代码来源:SignatureResponse.cs

示例7: FromBinary

        /// <summary>
        /// Deserializes an exception from binary data.
        /// </summary>
        /// <param name="data">Binary data of exception.</param>
        /// <returns>An exception.</returns>
        public static PiException FromBinary(byte[] data)
        {
            MemoryStream stream = new MemoryStream(data);
              DeserializeContext context = new DeserializeContext(stream);

              string typeName = context.ReadString();
              ExceptionCode code = (ExceptionCode)context.ReadInt32();
              string message = context.ReadString();

              Type type = Type.GetType(typeName);
              PiException exception = (PiException)Activator.CreateInstance(type, new object[] { code, code.Text() });
              exception.ServerMessage = message;

              context.Close();
              stream.Close();

              return exception;
        }
开发者ID:dbrgn,项目名称:pi-vote,代码行数:23,代码来源:PiException.cs

示例8: Deserialize

 /// <summary>
 /// Deserializes binary data to object.
 /// </summary>
 /// <param name="context">Context for deserialization</param>
 protected override void Deserialize(DeserializeContext context, byte version)
 {
     base.Deserialize(context, version);
       Message = context.ReadString();
 }
开发者ID:dbrgn,项目名称:pi-vote,代码行数:9,代码来源:EchoResponse.cs

示例9: Deserialize

        /// <summary>
        /// Deserializes binary data to object.
        /// </summary>
        /// <param name="context">Context for deserialization</param>
        protected override void Deserialize(DeserializeContext context, byte version)
        {
            base.Deserialize(context, version);
              EmailAddress = context.ReadString();

              if (version >= 1)
              {
            EncryptedSignatureRequest = context.ReadBytes();
              }
              else
              {
            EncryptedSignatureRequest = new byte[0];
              }
        }
开发者ID:dbrgn,项目名称:pi-vote,代码行数:18,代码来源:SignatureRequestInfo.cs


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