本文整理汇总了C#中Mono.CodeGeneration.CodeWriter.WriteLineInd方法的典型用法代码示例。如果您正苦于以下问题:C# CodeWriter.WriteLineInd方法的具体用法?C# CodeWriter.WriteLineInd怎么用?C# CodeWriter.WriteLineInd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.CodeGeneration.CodeWriter
的用法示例。
在下文中一共展示了CodeWriter.WriteLineInd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrintCode
public void PrintCode (CodeWriter cp)
{
cp.BeginLine ();
foreach (CodeCustomAttribute a in customAttributes)
a.PrintCode (cp);
cp.BeginLine ();
if (IsStatic)
cp.Write ("static ");
if (IsPublic)
cp.Write ("public ");
if (returnType != null) cp.Write (returnType + " ");
cp.Write (name);
if (parameterTypes.Length > 0) {
cp.Write (name + " [");
for (int n=0; n<parameterTypes.Length; n++) {
if (n > 0) cp.Write (", ");
cp.Write (parameterTypes[n] + " arg" + n);
}
cp.Write ("]");
}
cp.Write (" {");
cp.EndLine ();
cp.Indent ();
cp.WriteLineInd ("get {");
get_builder.PrintCode (cp);
cp.WriteLineUnind ("}");
cp.WriteLine ("set {");
set_builder.PrintCode (cp);
cp.WriteLine ("}");
cp.WriteLineUnind ("}");
}
示例2: PrintCode
public virtual void PrintCode (CodeWriter cp)
{
cp.BeginLine ();
foreach (CodeCustomAttribute a in customAttributes)
a.PrintCode (cp);
if ((methodBase.Attributes & MethodAttributes.Static) != 0)
cp.Write ("static ");
if ((methodBase.Attributes & MethodAttributes.Public) != 0)
cp.Write ("public ");
if (returnType != null) cp.Write (returnType + " ");
cp.Write (name + " (");
for (int n=0; n<parameterTypes.Length; n++) {
if (n > 0) cp.Write (", ");
cp.Write (parameterTypes[n] + " arg" + n);
}
cp.Write (")");
cp.EndLine ();
cp.WriteLineInd ("{");
builder.PrintCode (cp);
cp.WriteLineUnind ("}");
}
示例3: PrintCode
public override void PrintCode (CodeWriter cp)
{
if (trueBlock == null) return;
cp.Write ("if (");
condition.PrintCode (cp);
cp.Write (") {");
cp.EndLine ();
cp.Indent ();
trueBlock.PrintCode (cp);
cp.Unindent ();
cp.BeginLine ().Write ("}");
if (falseBlock != null) {
cp.EndLine ();
cp.WriteLineInd ("else {");
falseBlock.PrintCode (cp);
cp.Unindent ();
cp.BeginLine ().Write ("}");
}
}