本文整理匯總了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;
}