當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。