コード例 #1
0
 /// <summary>
 /// public TestClassWithGeneric1 ctor
 /// </summary>
 public TestClassWithGeneric1(TestClassWithTwoInterfaces1 testClassWithTwoInterfaces1,
                              ITestInterface2 testInterface2)
 {
     _testClassWithTwoInterfaces1 = testClassWithTwoInterfaces1;
     _testInterface2 = testInterface2;
     TestPrivateMethod();
 }
コード例 #2
0
        public void WrongReturnAllow()
        {
            TestClass2      orig        = new TestClass2();
            ITestInterface2 asInterface = ReflectedCaster.Default.CastToInterface <ITestInterface2>(orig, CastUsageOptions.AllowMissingFunctions);

            Assert.Throws <ReflectedCastNotImplementedInSourceException>(() => asInterface.MethodReturn());
        }
コード例 #3
0
ファイル: MixinAspect.cs プロジェクト: x64/bltoolkit
        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]*/));
        }
コード例 #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");
        }
コード例 #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();
        }
コード例 #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");
        }
コード例 #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();
        }
コード例 #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();
    }
コード例 #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();
        }
コード例 #10
0
ファイル: TestItems.cs プロジェクト: swmal/SimpleIOC
 public TestInterfaceImpl(ITestInterface2 t2, ITestInterface3 t3)
 {
     Test2 = t2;
 }
コード例 #11
0
 public GenericClassWithParametersAndDependencies(ITestInterface2 dependency, I prop1, S prop2)
 {
     Dependency = dependency;
     Prop1      = prop1;
     Prop2      = prop2;
 }
コード例 #12
0
 public GenericClassWithParametersAndDependencies(ITestInterface2 dependency)
 {
     Dependency = dependency;
 }
コード例 #13
0
 public TestCyclicDependency1(ITestInterface2 dependency)
 {
     _dependency = dependency;
 }
コード例 #14
0
ファイル: TestItems.cs プロジェクト: swmal/SimpleIOC
 public TestInterfaceImpl(ITestInterface2 t2, ITestInterface3 t3)
 {
     Test2 = t2;
 }