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


C# IWriter类代码示例

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


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

示例1: IncrementAndAppendChars

    private int IncrementAndAppendChars(
IWriter output,
char b1,
char b2,
char b3) {
      var count = 0;
      if (!this.unlimitedLineLength) {
        if (this.lineCount + 3 > 75) {
          // 76 including the final '='
          output.WriteByte(0x3d);
          output.WriteByte(0x0d);
          output.WriteByte(0x0a);
          this.lineCount = 0;
          count += 3;
        }
      }
      if (this.lineCount==0 && b1=='.') {
        output.WriteByte((byte)'=');
        output.WriteByte((byte)'2');
        output.WriteByte((byte)'E');
        this.lineCount += 2;
        count += 2;
      } else {
        output.WriteByte((byte)b1);
      }
      output.WriteByte((byte)b2);
      output.WriteByte((byte)b3);
      this.lineCount += 3;
      count += 3;
      return count;
    }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:31,代码来源:QuotedPrintableEncoder.cs

示例2: SetUp

        public void SetUp()
        {
            _reader = MockRepository.GenerateStub<IReader<Artist>>();
            _writer = MockRepository.GenerateStub<IWriter<Artist>>();

            _operationOutput = new ExceptionOperationOutput();
        }
开发者ID:gregsochanik,项目名称:RESTfulService,代码行数:7,代码来源:ArtistHandlerPutTests.cs

示例3: IncrementAndAppend

 private int IncrementAndAppend(IWriter output, string appendStr) {
   var count = 0;
   if (!this.unlimitedLineLength) {
     if (this.lineCount + appendStr.Length > 75) {
       // 76 including the final '='
       output.WriteByte(0x3d);
       output.WriteByte(0x0d);
       output.WriteByte(0x0a);
       this.lineCount = 0;
       count += 3;
     }
   }
   for (int i = 0; i < appendStr.Length; ++i) {
     if (i==0 && this.lineCount == 0 && appendStr[i] == '.') {
       output.WriteByte((byte)'=');
       output.WriteByte((byte)'2');
       output.WriteByte((byte)'E');
       this.lineCount += 2;
       count += 2;
     } else {
       output.WriteByte((byte)appendStr[i]);
     }
     ++count;
   }
   this.lineCount += appendStr.Length;
   return count;
 }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:27,代码来源:QuotedPrintableEncoder.cs

示例4: WriteElement

        public static void WriteElement(IScope scope, IWriter writer, object obj)
        {
            var type = obj.GetType();

            var xmlWriter = writer as XmlWriterImpl;
            if (xmlWriter != null)
            {
                var surrogate = scope.GetSurrogate(type);
                if (surrogate != null)
                {
                    surrogate.Write(xmlWriter.XmlWriter, obj);
                    return;
                }
            }

            var def = scope.GetElementDef(type);
            if (def != null)
            {
                var subScope = def as IScope ?? scope;
                WriteElement(subScope, writer, obj, def, def.Name);
                return;
            }

            throw new NotSupportedException();
        }
开发者ID:sergeyt,项目名称:xserializer,代码行数:25,代码来源:Serializer.cs

示例5: EventEngine

 public EventEngine(IReader reader, IWriter writer, IEventHolder eventHolder, IEventLogger eventLogger)
 {
     this.reader = reader;
     this.writer = writer;
     this.eventHolder = eventHolder;
     this.eventLogger = eventLogger;
 }
开发者ID:AlexanderDimitrov,项目名称:HighQualityCode,代码行数:7,代码来源:EventEngine.cs

示例6: AzureService

 protected AzureService(string subscriptionId, X509Certificate certificate, IWriter writer)
 {
     this.subscriptionId = subscriptionId;
     this.certificate = certificate;
     Writer = writer;
     ServiceUri = new ServiceUri(subscriptionId);
 }
开发者ID:georgeslegros,项目名称:AzureManagementApiClient,代码行数:7,代码来源:AzureService.cs

示例7: ParseCommand

        public static void ParseCommand(string input, IWriter output, BlobDatabase database)
        {
            var tokens = input.Split(' ').ToArray();
            var commandType = tokens[0];
            switch (commandType)
            {
                case "create":
                    CreateCommand(database, tokens);
                    break;
                case "attack":
                    AttackCommand(database, tokens);
                    break;
                case "pass":

                    break;
                case "status":
                    StatusCommand(output, database);
                    break;
                case "report-events":
                    //todo: report events
                    break;
                default:
                    throw new InvalidOperationException("Invalid Command.");
            }

            foreach (var blob in database)
            {
                if (blob.BlobBehavior.HasBeenTriggered)
                {
                    blob.BlobBehavior.EndTurnAction(blob);
                }
            }
        }
开发者ID:HouseBreaker,项目名称:SoftUni-Exams,代码行数:33,代码来源:CommandParser.cs

示例8: RenderChildren

 protected override void RenderChildren(IWriter writer)
 {
     foreach(Section section in this.Sections)
     {
         section.Render(writer);
     }
 }
开发者ID:chrcar01,项目名称:HyperActive,代码行数:7,代码来源:ConfigBuilder.cs

示例9: CSVReaderWriter

        public CSVReaderWriter(IWriter writerStream)
        {
            ReaderStream = null;
            writerStream.ThrowIfNull("writerStream");

            WriterStream = writerStream;
        }
开发者ID:dminik,项目名称:AddressProcessor,代码行数:7,代码来源:CSVReaderWriter.cs

示例10: Encode

 public int Encode(int b, IWriter output) {
   if (b < 0) {
     return this.finalized ? (-1) : this.FinalizeEncoding(output);
   }
   b &= 0xff;
   var count = 0;
   if (this.lenientLineBreaks) {
     if (b == 0x0d) {
       // CR
       this.haveCR = true;
       count += this.AddByteInternal(output, (byte)0x0d);
       count += this.AddByteInternal(output, (byte)0x0a);
       return count;
     }
     if (b == 0x0a && !this.haveCR) {
       // bare LF
       if (this.haveCR) {
         // Do nothing, this is an LF that follows CR
         this.haveCR = false;
       } else {
         count += this.AddByteInternal(output, (byte)0x0d);
         count += this.AddByteInternal(output, (byte)0x0a);
         this.haveCR = false;
       }
       return count;
     }
   }
   count += this.AddByteInternal(output, (byte)b);
   this.haveCR = false;
   return count;
 }
开发者ID:houzhenggang,项目名称:MailLib,代码行数:31,代码来源:Base64Encoder.cs

示例11: WriteLocaleChanges

        private static void WriteLocaleChanges(Patch patch, IWriter writer)
        {
            if (patch.LanguageChanges.Count == 0)
                return;

            long startPos = writer.Position;
            writer.WriteInt32(AssemblyPatchBlockID.Locl);
            writer.WriteUInt32(0); // Size filled in later
            writer.WriteByte(0); // Version 0

            // Write change data for each language
            writer.WriteByte((byte)patch.LanguageChanges.Count);
            foreach (LanguageChange language in patch.LanguageChanges)
            {
                writer.WriteByte(language.LanguageIndex);

                // Write the change data for each string in the language
                writer.WriteInt32(language.LocaleChanges.Count);
                foreach (LocaleChange change in language.LocaleChanges)
                {
                    writer.WriteUInt16((ushort)change.Index);
                    writer.WriteUTF8(change.NewValue);
                }
            }

            // Fill in the block size
            long endPos = writer.Position;
            writer.SeekTo(startPos + 4);
            writer.WriteUInt32((uint)(endPos - startPos));
            writer.SeekTo(endPos);
        }
开发者ID:YxCREATURExY,项目名称:Assembly,代码行数:31,代码来源:AssemblyPatchWriter.cs

示例12: Core

 public Core(ILogicController controller, IReader reader, IWriter writer, IGameInstance game)
 {
     this.controller = controller;
     this.reader = reader;
     this.writer = writer;
     this.game = game;
 }
开发者ID:TemplarRei,项目名称:Battle-Field-3,代码行数:7,代码来源:Core.cs

示例13: Nav

 public Nav(IWriter writer, string activeIdentifier, NavSettings settings = null)
     : base(writer)
 {
     _activeIdentifier = activeIdentifier;
     _settings = settings ?? new NavSettings();
     WriteOpening();
 }
开发者ID:FerozAhmed,项目名称:bootstrapcomponents,代码行数:7,代码来源:Nav.cs

示例14: AddChips

 public AddChips(IWriter writer)
 {
     this.InitializeComponent();
     this.ControlBox = false;
     this.outOfChipsLabel.BorderStyle = BorderStyle.FixedSingle;
     this.writer = writer;
 }
开发者ID:Team-Bilberry,项目名称:Poker,代码行数:7,代码来源:AddChips.cs

示例15: WritePatch

		public static void WritePatch(Patch patch, IWriter writer)
		{
			var container = new ContainerWriter(writer);
			container.StartBlock("asmp", 0);
			WriteBlocks(patch, container, writer);
			container.EndBlock();
		}
开发者ID:t3hm00kz,项目名称:Assembly,代码行数:7,代码来源:AssemblyPatchWriter.cs


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