예제 #1
0
        public void AssignExternalObj()
        {
            var a = new ReflectIntoPython(1, "test");

            runBasicTest("b = a\n",
                         new Dictionary <string, object>
            {
                { "a", a }
            },
                         new VariableMultimap(new TupleList <string, object>
            {
                { "b", a }
            }), 1);
        }
예제 #2
0
        public void AccessExternalObjProperty()
        {
            // We currently have fields and properties figured out, but we can't assign a method or anything like that. :(
            var a = new ReflectIntoPython(1, "test");

            runBasicTest("b = a.AnInteger\n" +
                         "c = a.AnIntegerProperty\n",
                         new Dictionary <string, object>
            {
                { "a", a }
            },
                         new VariableMultimap(new TupleList <string, object>
            {
                { "b", 1 },
                { "c", 1 }
            }), 1);
        }
예제 #3
0
        public void FollowTwoLevelsDeep()
        {
            var inner = new ReflectIntoPython(100, "inner");
            var outer = new ReflectIntoPython(0, "outer");

            outer.RecursiveObject = inner;

            runBasicTest(
                "a = obj.AnInteger\n" +
                "b = obj.RecursiveObject.AnInteger\n",
                new Dictionary <string, object>()
            {
                { "obj", outer }
            }, new VariableMultimap(new TupleList <string, object>
            {
                { "a", 0 },
                { "b", 100 }
            }), 1);
        }
예제 #4
0
 public static bool AGenericExtensionMethodNoArgs <T>(this ReflectIntoPython reflectThis)
 {
     return(true);
 }
예제 #5
0
 public static T AGenericExtensionMethod <T>(this ReflectIntoPython reflectThis, T arg)
 {
     return(reflectThis.GenericMethod <T>(arg));
 }
예제 #6
0
 public static int AnExtensionMethodWithArgs(this ReflectIntoPython reflectThis, int number)
 {
     reflectThis.AnInteger += number;
     return(reflectThis.AnInteger);
 }
예제 #7
0
 public static int AnExtensionMethod(this ReflectIntoPython reflectThis)
 {
     return(reflectThis.AnInteger);
 }