本文整理汇总了C#中CodeWriter.WriteLineNoIdent方法的典型用法代码示例。如果您正苦于以下问题:C# CodeWriter.WriteLineNoIdent方法的具体用法?C# CodeWriter.WriteLineNoIdent怎么用?C# CodeWriter.WriteLineNoIdent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CodeWriter
的用法示例。
在下文中一共展示了CodeWriter.WriteLineNoIdent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateInterface
public string GenerateInterface(Service service, Interface intr)
{
CodeWriter writer = new CodeWriter();
writer.WriteFormat(".factory(\"{0}Client\", function($http, serviceUrl)", intr.Name);
writer.WriteLineNoIdent(" {");
writer.PushIdent();
writer.WriteLine("return {");
int methodCount = intr.Methods.Count;
for (int i = 0; i < methodCount; i++)
{
writer.PushIdent();
Method method = intr.Methods[i];
string comma = i < methodCount - 1 ? "," : "";
writer.Write(GenerateMethod(intr, method).Trim());
writer.WriteLineNoIdent(comma);
writer.WriteLine();
writer.PopIdent();
}
writer.WriteLine("}");
writer.PopIdent();
writer.WriteLine("})");
return writer.Code;
}
示例2: GenerateInterface
public string GenerateInterface(Service service, Interface intr)
{
CodeWriter writer = new CodeWriter();
writer.WriteLine("define([\"dojo/request\", \"dojo/json\"], function (request, JSON) {");
writer.PushIdent();
writer.WriteLine("var serviceClient = {");
writer.PushIdent();
writer.WriteLine("urlString: '',");
writer.WriteLine();
int methodCount = intr.Methods.Count;
for (int i = 0; i < methodCount; i++)
{
Method method = intr.Methods[i];
string comma = i < methodCount - 1 ? "," : "";
writer.Write(GenerateMethod(intr, method).Trim());
writer.WriteLineNoIdent(comma);
writer.WriteLine();
}
writer.PopIdent();
writer.WriteLine("}");
writer.WriteLine("return serviceClient;");
writer.PopIdent();
writer.Write("});");
return writer.Code;
}