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


C# Func.GetMethodInfo方法代码示例

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


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

示例1: RemoteInvoke

 /// <summary>Invokes the method from this assembly in another process using the specified arguments.</summary>
 /// <param name="method">The method to invoke.</param>
 /// <param name="arg1">The first argument to pass to the method.</param>
 /// <param name="arg2">The second argument to pass to the method.</param>
 /// <param name="arg3">The third argument to pass to the method.</param>
 /// <param name="options">Options to use for the invocation.</param>
 internal static RemoteInvokeHandle RemoteInvoke(
     Func<string, string, string, int> method, 
     string arg1, string arg2, string arg3, 
     RemoteInvokeOptions options = null)
 {
     return RemoteInvoke(method.GetMethodInfo(), new[] { arg1, arg2, arg3 }, options);
 }
开发者ID:benpye,项目名称:corefx,代码行数:13,代码来源:RemoteExecutorTestBase.cs

示例2: RemoteInvoke

 /// <summary>Invokes the method from this assembly in another process using the specified arguments.</summary>
 /// <param name="method">The method to invoke.</param>
 /// <param name="start">true if this function should Start the Process; false if that responsibility is left up to the caller.</param>
 internal static RemoteInvokeHandle RemoteInvoke(
     Func<int> method, 
     bool start = true,
     ProcessStartInfo psi = null)
 {
     return RemoteInvoke(method.GetMethodInfo(), Array.Empty<string>(), start, psi);
 }
开发者ID:GeneralRookie,项目名称:corefx,代码行数:10,代码来源:RemoteExecutorTestBase.cs

示例3: ILBytesForDifferentDelegatesAreTheSameTest

        public void ILBytesForDifferentDelegatesAreTheSameTest()
        {
            var x = new Func<object, int>(y => 0);

            var z = new Func<object, int>(y => 0);

            Assert.False(x == z);

            var xBytes = x.GetMethodInfo().GetILBytes();
            Assert.False(xBytes.IsNullOrEmpty());

            var zBytes = x.GetMethodInfo().GetILBytes();
            Assert.False(zBytes.IsNullOrEmpty());

            Assert.True(xBytes.EqualTo(zBytes));
        }
开发者ID:Konard,项目名称:LinksPlatform,代码行数:16,代码来源:ReflectionTests.cs

示例4: ILBytesForDelegateAreAvailableTest

        public void ILBytesForDelegateAreAvailableTest()
        {
            var x = new Func<object, int>(y => 0);

            var bytes = x.GetMethodInfo().GetILBytes();

            Assert.False(bytes.IsNullOrEmpty());
        }
开发者ID:Konard,项目名称:LinksPlatform,代码行数:8,代码来源:ReflectionTests.cs

示例5: Run

        public static void Run(this ApplicationInstance applicationInstance,
                               Func<Task> staticMethodToExecute,
            TestInjectorSettings testInjectorSettings = null)
        {
            var methodInfo =
            #if NET40
             staticMethodToExecute.Method;
            #else
                staticMethodToExecute.GetMethodInfo();
            #endif

            if (!methodInfo.IsStatic)
                throw new InvalidOperationException("Method must be static - don't reference any outside parameters");

            RunMethodImpl(applicationInstance, methodInfo, testInjectorSettings);
        }
开发者ID:kiwidev,项目名称:testinjector,代码行数:16,代码来源:ApplicationInstanceExtensions.cs

示例6: InjectionFactory

 public InjectionFactory(Func<IUnityContainer, object> factoryFunc)
 {
     var parameters = new Expression[] { Expression.Constant(DummyContainer) };
     this.Factory = factoryFunc.Target == null ? Expression.Call(factoryFunc.GetMethodInfo(), parameters) : Expression.Call(Expression.Constant(factoryFunc.Target), factoryFunc.GetMethodInfo(), parameters);
 }
开发者ID:danielpalme,项目名称:QuickInject,代码行数:5,代码来源:InjectionFactory.cs


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