本文整理匯總了C#中Mono.CodeGeneration.CodeWriter.Unindent方法的典型用法代碼示例。如果您正苦於以下問題:C# CodeWriter.Unindent方法的具體用法?C# CodeWriter.Unindent怎麽用?C# CodeWriter.Unindent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mono.CodeGeneration.CodeWriter
的用法示例。
在下文中一共展示了CodeWriter.Unindent方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: PrintCode
public override void PrintCode (CodeWriter cp)
{
if (tryBlock == null) return;
cp.Write ("try {");
cp.Indent ();
condition.PrintCode (cp);
cp.Unindent ();
foreach (DictionaryEntry de in catchBlocks) {
CodeVariableDeclaration vd = (CodeVariableDeclaration) de.Key;
cp.Write ("} catch (");
if (vd.Variable.Name.Length > 0)
vd.PrintCode (cp);
else
cp.Write (vd.Variable.Type.FullName);
cp.Write (") {");
cp.Indent ();
((CodeBlock) de.Value).PrintCode (cp);
cp.Unindent ();
}
if (!finallyBlock.IsEmpty) {
cp.Write ("} finally {");
cp.Indent ();
finallyBlock.PrintCode (cp);
cp.Unindent ();
}
cp.Write ("}");
}
示例2: PrintCode
public override void PrintCode (CodeWriter cp)
{
cp.Write ("while (");
condition.PrintCode (cp);
cp.Write (") {");
cp.EndLine ();
cp.Indent ();
whileBlock.PrintCode (cp);
cp.Unindent ();
cp.BeginLine ().Write ("}");
}
示例3: PrintCode
public override void PrintCode (CodeWriter cp)
{
cp.Write ("for (");
initExp.PrintCode (cp);
cp.Write (";");
conditionExp.PrintCode (cp);
cp.Write (";");
nextExp.PrintCode (cp);
cp.Write (") {");
cp.EndLine ();
cp.Indent ();
forBlock.PrintCode (cp);
cp.Unindent ();
cp.BeginLine ().Write ("}");
}
示例4: PrintCode
public override void PrintCode (CodeWriter cp)
{
for (int n=0; n<blocks.Count; n++) {
if (n == 0)
cp.Write ("if (");
else
cp.Write ("else if (");
((CodeExpression)conditions[n]).PrintCode (cp);
cp.Write (") {");
cp.EndLine ();
cp.Indent ();
((CodeBlock) blocks[n]).PrintCode (cp);
cp.Unindent ();
cp.BeginLine ().Write ("}");
if (n < blocks.Count - 1) {
cp.EndLine ();
cp.BeginLine ();
}
}
}
示例5: 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 ("}");
}
}
示例6: PrintCode
public override void PrintCode (CodeWriter cp)
{
cp.Write ("foreach (" + itemType + " item in ");
array.PrintCode (cp);
cp.Write (") {");
cp.EndLine ();
cp.Indent ();
forBlock.PrintCode (cp);
cp.Unindent ();
cp.BeginLine ().Write ("}");
}