vendredi 24 juillet 2015

How to use reflection to solve this?

           {
           IReflectionType1 iType1object = StaticClass1.GetObject1<IReflectionType1>();
           ReflectionType2 object2 = new ReflectionType2("parameter1","parameter2");
           iType1object.RunAsync(
                reflectionObject =>
                    reflectionObject.Method1(object2)
                    .OnCompleted(StaticMethodOne)
                    .OnProgressUpdated(StaticMethodSecond));

            }


   private static void StaticMethodSecond(int i, int i1, string arg3)
    {
        Console.WriteLine("{0} {1} {2}", i, i1, arg3);
    }

    private static void StaticMethodOne(ReflectionObject3 obj3)
    {
         obj3.Method3();
    }

This is my skeleton of problem. I must use reflection because I must load at runtime IReflectionType1,ReflectionType2,Method1,ReflectionObject3,reflectionObject (in async method) And now I have problem how to use reflection to change lambda expression. As i wrote "reflectionObject" is also type to get from reflection The second problem is how to use type from reflection as a parameter(in staticMethodOne)

Please help





Aucun commentaire:

Enregistrer un commentaire