本文整理汇总了C#中IMemberRef.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IMemberRef.ToString方法的具体用法?C# IMemberRef.ToString怎么用?C# IMemberRef.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMemberRef
的用法示例。
在下文中一共展示了IMemberRef.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTooltip
/// <summary>
/// Converts a member signature to a string.
/// This is used for displaying the tooltip on a member reference.
/// </summary>
public virtual string GetTooltip(IMemberRef member)
{
if (member is ITypeDefOrRef)
return TypeToString((ITypeDefOrRef)member, true);
else
return member.ToString();
}
示例2: WriteToolTip
/// <summary>
/// Converts a member signature to a string.
/// This is used for displaying the tooltip on a member reference.
/// </summary>
public virtual void WriteToolTip(ITextOutput output, IMemberRef member, IHasCustomAttribute typeAttributes)
{
if (member is ITypeDefOrRef)
TypeToString(output, (ITypeDefOrRef)member, true, typeAttributes);
else if (member is GenericParam) {
var gp = (GenericParam)member;
output.Write(IdentifierEscaper.Escape(gp.Name), TextTokenHelper.GetTextTokenType(gp));
output.WriteSpace();
output.Write("in", TextTokenType.Text);
output.WriteSpace();
WriteToolTip(output, gp.Owner, typeAttributes);
}
else {
//TODO: This should be escaped but since it contains whitespace, parens, etc,
// we can't pass it to IdentifierEscaper.Escape().
output.Write(member.ToString(), TextTokenHelper.GetTextTokenType(member));
}
}