/// <summary>
 /// public TestClassWithGeneric1 ctor
 /// </summary>
 public TestClassWithGeneric1(TestClassWithTwoInterfaces1 testClassWithTwoInterfaces1,
                              ITestInterface2 testInterface2)
 {
     _testClassWithTwoInterfaces1 = testClassWithTwoInterfaces1;
     _testInterface2 = testInterface2;
     TestPrivateMethod();
 }
Ejemplo n.º 2
0
        public void WrongReturnAllow()
        {
            TestClass2      orig        = new TestClass2();
            ITestInterface2 asInterface = ReflectedCaster.Default.CastToInterface <ITestInterface2>(orig, CastUsageOptions.AllowMissingFunctions);

            Assert.Throws <ReflectedCastNotImplementedInSourceException>(() => asInterface.MethodReturn());
        }
Ejemplo n.º 3
0
        public void Test()
        {
            TestClass tc = /*[a]*/ TypeAccessor /*[/a]*/ <TestClass> .CreateInstance();

            ITestInterface1 i1 = (ITestInterface1)tc;
            ITestInterface2 i2 = (ITestInterface2)tc;

            Assert.AreEqual(/*[a]*/ 10 /*[/a]*/, i1.TestMethod(/*[a]*/ 10 /*[/a]*/));
            Assert.AreEqual(/*[a]*/ 15 /*[/a]*/, i2.TestMethod1(/*[a]*/ 20 /*[/a]*/));
            Assert.AreEqual(/*[a]*/ 30 /*[/a]*/, i2.TestMethod2(/*[a]*/ 30 /*[/a]*/));
        }
Ejemplo n.º 4
0
        public void CollisionImplementationOneExplicit()
        {
            var             o     = new CollisionImplementationOneExplicit();
            ITestInterface  test  = o;
            ITestInterface2 test2 = o;
            var             s     = test.Method();
            var             s2    = test2.Method();

            AssertEquals(s, "ITestInterface");
            AssertEquals(s2, "ITestInterface2");
        }
Ejemplo n.º 5
0
        //public  void Sub(int a, int b) // mandatory to write public here
        //{
        //    Console.WriteLine(a - b);
        //}
        static void Main(string[] args)
        {
            ImplementationClass obj = new ImplementationClass();
            //obj.Add(10, 5);
            //obj.Sub(10, 5);
            ITestInterface2 i = obj; // we can create reference of obj

            i.Add(10, 5);
            i.Sub(10, 5);
            Console.Read();
        }
Ejemplo n.º 6
0
        public void CollisionImplementationBothExplicit()
        {
            var             o     = new CollisionImplementationBothExplicit();
            ITestInterface  test  = o;
            ITestInterface2 test2 = o;
            var             s     = test.Method();
            var             s2    = test2.Method();

            QUnit.AreEqual(s, "ITestInterface");
            QUnit.AreEqual(s2, "ITestInterface2");
        }
Ejemplo n.º 7
0
        static void Main()
        {
            ImplementationClass obj = new ImplementationClass();
            ITestInterface2     i   = obj;//i is a parent refernce created by using a child instance

            obj.Add(1, 2);
            obj.Sub(6, 3);
            i.Add(2, 2);//we can create a refernce and call it through it
            i.Sub(10, 6);
            Console.ReadLine();
        }
Ejemplo n.º 8
0
    protected void OnButton2Clicked(object sender, EventArgs e)
    {
        ObjectPath opath = new ObjectPath("/org/example/TestObject");
        string     name  = "org.example.TestServer";

        Bus bus = Bus.Session;

        sample2     = bus.GetObject <ITestInterface2>(name, opath);
        label3.Text = sample2.Get("org.example.TestInterface", "Version");

        //sample = bus.GetObject<ITestInterface>(name, opath);
        //sample.OnEmitSignal += Store_OnEmitSignal;
        //sample.EmitSignal();
    }
Ejemplo n.º 9
0
        static void Main()
        {
            ImplementationClass obj = new ImplementationClass();

            obj.Add(100, 11);
            obj.Sub(100, 11);

            ITestInterface2 i = obj;

            i.Add(100, 11);
            i.Sub(100, 11);

            Console.ReadKey();
        }
Ejemplo n.º 10
0
 public TestInterfaceImpl(ITestInterface2 t2, ITestInterface3 t3)
 {
     Test2 = t2;
 }
Ejemplo n.º 11
0
 public GenericClassWithParametersAndDependencies(ITestInterface2 dependency, I prop1, S prop2)
 {
     Dependency = dependency;
     Prop1      = prop1;
     Prop2      = prop2;
 }
Ejemplo n.º 12
0
 public GenericClassWithParametersAndDependencies(ITestInterface2 dependency)
 {
     Dependency = dependency;
 }
Ejemplo n.º 13
0
 public TestCyclicDependency1(ITestInterface2 dependency)
 {
     _dependency = dependency;
 }
Ejemplo n.º 14
0
 public TestInterfaceImpl(ITestInterface2 t2, ITestInterface3 t3)
 {
     Test2 = t2;
 }