本文整理汇总了C#中Mono.Cecil.MethodReference.GetSentinel方法的典型用法代码示例。如果您正苦于以下问题:C# MethodReference.GetSentinel方法的具体用法?C# MethodReference.GetSentinel怎么用?C# MethodReference.GetSentinel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Cecil.MethodReference
的用法示例。
在下文中一共展示了MethodReference.GetSentinel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SignatureFor
public static string SignatureFor(MethodReference method)
{
if (cache.ContainsKey(method)) return cache[method];
var sb = new StringBuilder();
sb.Append(method.ReturnType.ReturnType.FullName);
sb.Append(" ");
sb.Append(method.DeclaringType.FullName);
sb.Append("::");
sb.Append(method.Name);
if (method.HasGenericParameters)
{
sb.Append("<");
for (int i = 0; i < method.GenericParameters.Count; i++)
{
if (i > 0)
sb.Append(",");
sb.Append(method.GenericParameters[i].Name);
}
sb.Append(">");
}
sb.Append("(");
if (method.HasParameters)
{
int sentinel = method.GetSentinel();
for (int i = 0; i < method.Parameters.Count; i++)
{
if (i > 0)
sb.Append(",");
if (i == sentinel)
sb.Append("...,");
sb.Append(method.Parameters[i].ParameterType.FullName);
}
}
sb.Append(")");
var result= sb.ToString();
cache[method] = result;
return result;
}
示例2: getMethodParametersSiganature
//based on the code from Mono.Cecil.MethodReference.ToString()
public static string getMethodParametersSiganature(MethodReference methodReference)
{
int sentinel = methodReference.GetSentinel();
var builder = new StringBuilder();
builder.Append("(");
for (int i = 0; i < methodReference.Parameters.Count; i++)
{
if (i > 0)
{
builder.Append(",");
}
if (i == sentinel)
{
builder.Append("...,");
}
builder.Append(methodReference.Parameters[i].ParameterType.FullName);
}
builder.Append(")");
return builder.ToString();
}
示例3: smethod_0
internal static string smethod_0(MethodReference methodReference_0)
{
int sentinel = methodReference_0.GetSentinel();
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append(methodReference_0.ReturnType.ReturnType.FullName);
stringBuilder.Append(" ");
if (methodReference_0.DeclaringType != null)
{
stringBuilder.Append(methodReference_0.DeclaringType.FullName + "::");
}
stringBuilder.Append(methodReference_0.Name);
if (methodReference_0.GenericParameters.Count > 0)
{
stringBuilder.Append("<");
}
for (int i = 0; i < methodReference_0.GenericParameters.Count; i++)
{
if (i > 0)
{
stringBuilder.Append(",");
}
stringBuilder.Append(methodReference_0.GenericParameters[i].Name);
}
if (methodReference_0.GenericParameters.Count > 0)
{
stringBuilder.Append(">");
}
stringBuilder.Append("(");
for (int i = 0; i < methodReference_0.Parameters.Count; i++)
{
if (i > 0)
{
stringBuilder.Append(",");
}
if (i == sentinel)
{
stringBuilder.Append("...,");
Logger.LogInfo("Sentinel");
Debugger.Break();
}
if (methodReference_0.Parameters[i].ParameterType != null)
{
stringBuilder.Append(methodReference_0.Parameters[i].ParameterType.FullName);
}
}
stringBuilder.Append(")");
return stringBuilder.ToString();
}
示例4: GetFullName
static string GetFullName (MethodReference method)
{
int sentinel = method.GetSentinel ();
StringBuilder sb = new StringBuilder ();
sb.Append (method.ReturnType.ReturnType.FullName);
sb.Append (" ");
sb.Append (method.DeclaringType.FullName);
sb.Append ("::");
sb.Append (method.Name);
if (method.HasGenericParameters) {
sb.Append ("<");
for (int i = 0; i < method.GenericParameters.Count; i++ ) {
if (i > 0)
sb.Append (",");
sb.Append (method.GenericParameters [i].Name);
}
sb.Append (">");
}
sb.Append ("(");
if (method.HasParameters) {
for (int i = 0; i < method.Parameters.Count; i++) {
if (i > 0)
sb.Append (",");
if (i == sentinel)
sb.Append ("...,");
sb.Append (method.Parameters [i].ParameterType.FullName);
}
}
sb.Append (")");
return sb.ToString ();
}