本文整理汇总了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;
}
示例2: SetUp
public void SetUp()
{
_reader = MockRepository.GenerateStub<IReader<Artist>>();
_writer = MockRepository.GenerateStub<IWriter<Artist>>();
_operationOutput = new ExceptionOperationOutput();
}
示例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;
}
示例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();
}
示例5: EventEngine
public EventEngine(IReader reader, IWriter writer, IEventHolder eventHolder, IEventLogger eventLogger)
{
this.reader = reader;
this.writer = writer;
this.eventHolder = eventHolder;
this.eventLogger = eventLogger;
}
示例6: AzureService
protected AzureService(string subscriptionId, X509Certificate certificate, IWriter writer)
{
this.subscriptionId = subscriptionId;
this.certificate = certificate;
Writer = writer;
ServiceUri = new ServiceUri(subscriptionId);
}
示例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);
}
}
}
示例8: RenderChildren
protected override void RenderChildren(IWriter writer)
{
foreach(Section section in this.Sections)
{
section.Render(writer);
}
}
示例9: CSVReaderWriter
public CSVReaderWriter(IWriter writerStream)
{
ReaderStream = null;
writerStream.ThrowIfNull("writerStream");
WriterStream = writerStream;
}
示例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;
}
示例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);
}
示例12: Core
public Core(ILogicController controller, IReader reader, IWriter writer, IGameInstance game)
{
this.controller = controller;
this.reader = reader;
this.writer = writer;
this.game = game;
}
示例13: Nav
public Nav(IWriter writer, string activeIdentifier, NavSettings settings = null)
: base(writer)
{
_activeIdentifier = activeIdentifier;
_settings = settings ?? new NavSettings();
WriteOpening();
}
示例14: AddChips
public AddChips(IWriter writer)
{
this.InitializeComponent();
this.ControlBox = false;
this.outOfChipsLabel.BorderStyle = BorderStyle.FixedSingle;
this.writer = writer;
}
示例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();
}