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


C# IMethodInfo.Resolve方法代码示例

本文整理汇总了C#中IMethodInfo.Resolve方法的典型用法代码示例。如果您正苦于以下问题:C# IMethodInfo.Resolve方法的具体用法?C# IMethodInfo.Resolve怎么用?C# IMethodInfo.Resolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMethodInfo的用法示例。


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

示例1: DecorateContainingScope

 /// <inheritdoc />
 protected override void DecorateContainingScope(IPatternScope containingScope, IMethodInfo methodInfo)
 {
     Type formattableType = methodInfo.Parameters[0].Resolve(true).ParameterType;
     var extensionPoints = (IExtensionPoints)RuntimeAccessor.ServiceLocator.ResolveByComponentId("Gallio.ExtensionPoints");
     CustomTestEnvironment.SetUpThreadChain.Before(() => extensionPoints.CustomFormatters.Register(formattableType, x => (string)methodInfo.Resolve(true).Invoke(this, new[] { x })));
     CustomTestEnvironment.TeardownThreadChain.After(() => extensionPoints.CustomFormatters.Unregister(formattableType));
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:8,代码来源:FormatterAttribute.cs

示例2: ResolveMethod

 public static MethodInfo ResolveMethod(IMethodInfo method, bool nonPublic)
 {
     return method != null && (nonPublic || method.IsPublic) ? method.Resolve(false) : null;
 }
开发者ID:rprouse,项目名称:mbunit-v3,代码行数:4,代码来源:UnresolvedMemberInfo.cs

示例3: DecorateContainingScope

 /// <inheritdoc />
 protected override void DecorateContainingScope(IPatternScope containingScope, IMethodInfo methodInfo)
 {
     Type comparableType = methodInfo.Parameters[0].Resolve(true).ParameterType;
     CustomTestEnvironment.SetUpThreadChain.Before(() => Register(comparableType, (x, y) => methodInfo.Resolve(true).Invoke(this, new[] { x, y })));
     CustomTestEnvironment.TeardownThreadChain.After(() => Unregister(comparableType));
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:AbstractComparerAttribute.cs

示例4: DecorateContainingScope

        /// <inheritdoc />
        protected override void DecorateContainingScope(IPatternScope containingScope, IMethodInfo method)
        {
            MethodInfo factoryMethod = method.Resolve(false);
            if (factoryMethod == null || Reflector.IsUnresolved(factoryMethod))
            {
                containingScope.TestModelBuilder.AddAnnotation(new Annotation(AnnotationType.Info, method,
                    "This test runner does not fully support static test factory methods "
                    + "because the code that defines the factory cannot be executed "
                    + "at test exploration time.  Consider using dynamic test factory "
                    + "methods instead."));
                return;
            }

            var tests = factoryMethod.Invoke(null, null) as IEnumerable<Test>;
            if (tests == null)
            {
                containingScope.TestModelBuilder.AddAnnotation(new Annotation(AnnotationType.Error, method,
                    "Expected the static test factory method to return a value that is assignable "
                    + "to type IEnumerable<Test>."));
                return;
            }

            Test.BuildStaticTests(tests, containingScope, method);
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:25,代码来源:StaticTestFactoryAttribute.cs


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