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