本文整理汇总了C#中IFormatter.WriteReference方法的典型用法代码示例。如果您正苦于以下问题:C# IFormatter.WriteReference方法的具体用法?C# IFormatter.WriteReference怎么用?C# IFormatter.WriteReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFormatter
的用法示例。
在下文中一共展示了IFormatter.WriteReference方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteVariableReference
private void WriteVariableReference(IVariableReference value, IFormatter formatter)
{
IVariableDeclaration variableDeclaration = value.Resolve();
TextFormatter textFormatter = new TextFormatter();
this.WriteVariableDeclaration(variableDeclaration, textFormatter);
textFormatter.Write(" // Local Variable");
formatter.WriteReference(variableDeclaration.Name, textFormatter.ToString(), null);
}
示例2: WriteMethodOfExpression
private void WriteMethodOfExpression(IMethodOfExpression value, IFormatter formatter)
{
formatter.WriteKeyword("methodof");
formatter.Write("(");
this.WriteType(value.Method.DeclaringType, formatter);
formatter.Write(".");
formatter.WriteReference(value.Method.Name, this.GetMethodReferenceDescription(value.Method), value.Method);
if (value.Type != null)
{
formatter.Write(", ");
this.WriteType(value.Type, formatter);
}
formatter.Write(")");
}
示例3: WriteReference
private void WriteReference(string name, IFormatter formatter, string toolTip, object reference)
{
string text = name;
if (name.Equals(".ctor"))
{
text = "Create";
}
if (name.Equals("..ctor"))
{
text = "Create";
}
if (Array.IndexOf(this.keywords, name) != -1)
{
text = "&" + name;
}
formatter.WriteReference(text, toolTip, reference);
}
示例4: WriteForEachStatement
private void WriteForEachStatement(IForEachStatement value, IFormatter formatter)
{
// TODO statement.Variable declaration needs to be rendered some where
this.WriteStatementSeparator(formatter);
TextFormatter description = new TextFormatter();
this.WriteVariableDeclaration(value.Variable, description);
formatter.WriteLine();
formatter.WriteKeyword("foreach");
formatter.Write(" (");
formatter.WriteReference(value.Variable.Name, description.ToString(), null);
formatter.WriteKeyword(" in ");
this.WriteExpression(value.Expression, formatter);
formatter.Write(") {");
formatter.WriteLine();
formatter.WriteIndent();
if (value.Body != null)
{
this.WriteStatement(value.Body, formatter);
}
formatter.WriteLine();
formatter.WriteOutdent();
formatter.WriteKeyword("}");
}