本文整理汇总了C#中ICodeWriter.Unindent方法的典型用法代码示例。如果您正苦于以下问题:C# ICodeWriter.Unindent方法的具体用法?C# ICodeWriter.Unindent怎么用?C# ICodeWriter.Unindent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICodeWriter
的用法示例。
在下文中一共展示了ICodeWriter.Unindent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
#pragma warning disable 1591
public override void Write(ICodeWriter writer)
{
var childIndex = 0;
var numberOfChildren = Children.Count;
writer.Write("{{");
if (numberOfChildren > 0)
{
writer.Newline();
writer.Indent();
foreach (var child in Children)
{
child.Write(writer);
childIndex++;
if (childIndex > 0 && childIndex < numberOfChildren)
writer.Write(",");
writer.Newline();
}
writer.Unindent();
writer.WriteWithIndentation("}}");
}
else
{
writer.Write("}}");
}
}
示例2: Write
#pragma warning disable 1591
public override void Write(ICodeWriter writer)
{
base.Write(writer);
if( _extensions.Count > 0 )
{
writer.Newline();
IndentMultiple(writer, 3);
writer.WriteWithIndentation(".extend({{");
writer.Newline();
writer.Indent();
foreach (var extension in _extensions)
{
if (extension != _extensions[0])
{
writer.Write(",");
writer.Newline();
}
writer.WriteWithIndentation("{0} : {1}", extension.Name, extension.Options);
}
writer.Unindent();
writer.Newline();
writer.WriteWithIndentation("}})");
UnindentMultiple(writer, 3);
}
}
示例3: Write
#pragma warning disable 1591
public override void Write(ICodeWriter writer)
{
writer.Indent();
WriteChildren(writer);
writer.Unindent();
}
示例4: UnindentMultiple
void UnindentMultiple(ICodeWriter writer, int numberOfIdentions)
{
for (var i = 0; i < numberOfIdentions; i++) writer.Unindent();
}