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


C# IMethodReference类代码示例

本文整理汇总了C#中IMethodReference的典型用法代码示例。如果您正苦于以下问题:C# IMethodReference类的具体用法?C# IMethodReference怎么用?C# IMethodReference使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IMethodReference类属于命名空间,在下文中一共展示了IMethodReference类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetMethodSignature

 // Put return type after the signature
 public override string GetMethodSignature(IMethodReference method, NameFormattingOptions formattingOptions)
 {
     string baseSig = base.GetMethodSignature(method, (formattingOptions & ~NameFormattingOptions.ReturnType));
     StringBuilder sb = new StringBuilder(baseSig);
     AppendReturnTypeSignature(method, (formattingOptions | NameFormattingOptions.ReturnType), sb);
     return sb.ToString();
 }
开发者ID:dsgouda,项目名称:buildtools,代码行数:8,代码来源:ModelSigFormatter.cs

示例2: CustomAttribute

 public CustomAttribute(
     IMethodReference constructor,
     ITypeReference type,
     ReadOnlyArray<MetadataConstant> positionalArguments) :
     this(constructor, type, positionalArguments, ReadOnlyArray<IMetadataNamedArgument>.Empty)
 {
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:7,代码来源:CustomAttribute.cs

示例3: Unspecialize

 /// <summary>
 /// Returns the unspecialized version of the given method reference.
 /// </summary>
 public static IMethodReference Unspecialize(IMethodReference method) {
   var smr = method as ISpecializedMethodReference;
   if (smr != null) return smr.UnspecializedVersion;
   var gmir = method as IGenericMethodInstanceReference;
   if (gmir != null) return gmir.GenericMethod;
   return method;
 }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:10,代码来源:MethodHelper.cs

示例4: ResolveUnspecializedMethodOrThrow

 private static IMethodDefinition ResolveUnspecializedMethodOrThrow(IMethodReference methodReference) {
   var resolvedMethod = Sink.Unspecialize(methodReference).ResolvedMethod;
   if (resolvedMethod == Dummy.Method) { // avoid downstream errors, fail early
     throw new TranslationException(ExceptionType.UnresolvedMethod, MemberHelper.GetMethodSignature(methodReference, NameFormattingOptions.None));
   }
   return resolvedMethod;
 }
开发者ID:lleraromero,项目名称:bytecodetranslator,代码行数:7,代码来源:ExpressionTraverser.cs

示例5: Matches

 public bool Matches(IMethodReference method)
 {
     var sig = CreateIdentifier(method);
     _log.Debug("matching: "+sig);
     //AKB to rethink
     return sig.MethodNameWithoutParams == _identifier.MethodNameWithoutParams;
 }
开发者ID:Refresh06,项目名称:visualmutator,代码行数:7,代码来源:CciMethodMatcher.cs

示例6: AddAlternativeInvocation

        private void AddAlternativeInvocation(BlockStatement block,
            IMethodDefinition fakeMethod, IMethodReference originalCall)
        {
            var context = new ReplacementMethodConstructionContext(host, originalCall, fakeMethod, block, log, null);
            var methodBuilder = context.GetMethodBuilder();

            methodBuilder.BuildMethod();
        }
开发者ID:jamarchist,项目名称:SharpMock,代码行数:8,代码来源:AddInterceptionTargetsToAssembly.cs

示例7: CreateIdentifier

 public static MethodIdentifier CreateIdentifier(IMethodReference method)
 {
     method = MemberHelper.UninstantiateAndUnspecialize(method);
     return new MethodIdentifier(MemberHelper.GetMethodSignature(method,
             NameFormattingOptions.Signature |
             NameFormattingOptions.TypeParameters |
             NameFormattingOptions.ParameterModifiers));
 }
开发者ID:Refresh06,项目名称:visualmutator,代码行数:8,代码来源:CciMethodMatcher.cs

示例8: ReplacementMethodConstructionContext

        public ReplacementMethodConstructionContext(IMetadataHost host, IMethodReference originalCall, IMethodDefinition fakeMethod, BlockStatement block, ILogger log, IReplaceableReference originalReference)
        {
            this.host = host;
            this.block = block;
            this.log = log;
            this.originalReference = originalReference;
            this.originalCall = originalCall;

            fakeMethodParameters = fakeMethod.Parameters;
            returnType = fakeMethod.Type;
        }
开发者ID:jamarchist,项目名称:SharpMock,代码行数:11,代码来源:ReplacementMethodConstructionContext.cs

示例9: ResolveMethodThrowing

        public static IMethodDefinition ResolveMethodThrowing(IMethodReference method)
        {
            IMethodDefinition result = method.ResolvedMethod;
            if (result == Dummy.Method ||
                result == null)
            {
                throw new Exception(String.Format("Cannot resolve member '{0}'. Are all dependent assemblies loaded?", method.ToString()));
            }

            Debug.Assert(!result.GetType().Name.Contains("Dummy"));
            return result;
        }
开发者ID:dsgouda,项目名称:buildtools,代码行数:12,代码来源:Util.cs

示例10: CreateNormalizeMethodDefinition

    /// <summary>
    /// Creates the normalize method definition.
    /// </summary>
    /// <param name="methodReference">The method reference.</param>
    /// <returns>A new NormalizeMethodDefinition instance, based on the input.</returns>
    internal static NormalizeMethodDefinition CreateNormalizeMethodDefinition(IMethodReference methodReference)
    {
      if (methodReference == null)
      {
        throw new ArgumentNullException("methodReference");
      }

      ITypeReference typeReference = methodReference.DeclaringType as ITypeReference;

      return new NormalizeMethodDefinition(
        typeReference.Name,
        typeReference.Namespace,
        methodReference.Name,
        BuildParameterList(methodReference.Parameters),
        methodReference.ReturnType.Type.ToString(),
        string.Empty);
    }
开发者ID:WrongDog,项目名称:Sequence,代码行数:22,代码来源:ReflectorHelper.cs

示例11: Mangle

    internal string Mangle(IMethodReference method) {
      Contract.Requires(method != null);

      method.ResolvedMethod.Dispatch(this); //compute the hash
      var sb = new StringBuilder();
      sb.Append('_');
      sb.Append((uint)this.hash);
      sb.Append('_');
      this.AppendSanitizedName(sb, TypeHelper.GetTypeName(method.ContainingType));
      sb.Append('_');
      this.AppendSanitizedName(sb, method.Name.Value);
      foreach (var par in method.Parameters) {
        sb.Append('_');
        this.AppendSanitizedName(sb, TypeHelper.GetTypeName(par.Type, NameFormattingOptions.OmitContainingType));
      }
      return sb.ToString();
    }
开发者ID:mestriga,项目名称:Microsoft.CciSamples,代码行数:17,代码来源:Mangler.cs

示例12: TryGetCompatibileModifier

        private static bool TryGetCompatibileModifier(IMethodDefinition resolvedMethod, out IMethodReference accessor)
        {
            var result = resolvedMethod.ContainingTypeDefinition.Properties
                .FirstOrDefault(p => p.Setter != null && p.Setter.Name.UniqueKey != resolvedMethod.Name.UniqueKey
                && TypeHelper.ParameterListsAreEquivalent(p.Setter.Parameters, resolvedMethod.Parameters));
            if (result == null)
            {
                accessor = null;
                return false;
            }
            else
            {
                accessor = result.Setter;
                return true;
            }

        }
开发者ID:Refresh06,项目名称:visualmutator,代码行数:17,代码来源:EMM_ModiferMethodChange.cs

示例13: AddDependencyForCalledMethod

        private void AddDependencyForCalledMethod(IMethodReference method)
        {
            AddDependency(method.ContainingType, false);

            this._methodDependents.Add(method);
        }
开发者ID:pgavlin,项目名称:ApiTools,代码行数:6,代码来源:TypeDependencies.cs

示例14: SecurityCustomAttribute

 internal SecurityCustomAttribute(SecurityAttribute containingSecurityAttribute, IMethodReference constructorReference, IMetadataNamedArgument[]/*?*/ namedArguments) {
   this.ContainingSecurityAttribute = containingSecurityAttribute;
   this.ConstructorReference = constructorReference;
   this.NamedArguments = namedArguments;
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:5,代码来源:Attributes.cs

示例15: CustomAttribute

 internal CustomAttribute(PEFileToObjectModel peFileToObjectModel, uint attributeRowId, IMethodReference constructor,
   IMetadataExpression[]/*?*/ arguments, IMetadataNamedArgument[]/*?*/ namedArguments)
   : base(peFileToObjectModel) {
   this.AttributeRowId = attributeRowId;
   this.Constructor = constructor;
   this.Arguments = arguments;
   this.NamedArguments = namedArguments;
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:8,代码来源:Attributes.cs


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