本文整理汇总了C#中System.IO.TextWriter.WriteIndentTabs方法的典型用法代码示例。如果您正苦于以下问题:C# TextWriter.WriteIndentTabs方法的具体用法?C# TextWriter.WriteIndentTabs怎么用?C# TextWriter.WriteIndentTabs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.TextWriter
的用法示例。
在下文中一共展示了TextWriter.WriteIndentTabs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public override int Write(TextWriter writer, int count, int p)
{
if (this.StructureType == StructureType.Union)
{
writer.Write("union");
count += 5;
}
else
{
writer.Write("struct");
count += 6;
}
if (this.Identifier != null)
{
writer.Write(' ');
writer.Write(this.Identifier);
count += this.Identifier.Length + 1;
}
else if (this.StructureDeclarationList != null)
{
using (var bracketWriter = new WrappingWriter(() => writer.WriteLine(" {"), () => writer.WriteLine('}')))
{
count += 2;
foreach (var decl in this.StructureDeclarationList)
{
count = decl.Write(writer, count, p + 1);
writer.WriteLine(';');
count++;
}
writer.WriteIndentTabs(p);
count += p + 1;
}
}
return count;
}
示例2: Write
public override int Write(TextWriter writer, int count, int p)
{
writer.Write("enum");
count += 4;
if (this.Identifier != null)
{
writer.Write(' ');
writer.Write(this.Identifier);
count += this.Identifier.Length + 1;
}
else if (this.EnumeratorList != null)
{
using (var bracketWriter = new WrappingWriter(() => writer.WriteLine(" {"), () => writer.WriteLine('}')))
{
count += 2;
bool first = true;
foreach (var enumerator in this.EnumeratorList)
{
if (!first)
{
writer.WriteLine(",");
count++;
}
else
first = false;
enumerator.Write(writer, count, p + 1);
}
writer.WriteLine();
writer.WriteIndentTabs(p);
count += p + 2;
}
}
return count;
}