当前位置: 首页>>代码示例>>C#>>正文


C# MethodReference.GetSentinel方法代码示例

本文整理汇总了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;
        }
开发者ID:tigerhu67,项目名称:monobuildtools,代码行数:41,代码来源:MethodSignatureProvider.cs

示例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();
 }
开发者ID:o2platform,项目名称:O2.Platform.Projects.Misc_and_Legacy,代码行数:21,代码来源:CecilUtils.cs

示例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();
		}
开发者ID:akordowski,项目名称:Source-Code-Nitriq,代码行数:48,代码来源:BfMethod.cs

示例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 ();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:34,代码来源:InjectSecurityAttributes.cs


注:本文中的Mono.Cecil.MethodReference.GetSentinel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。