/// <summary> /// public TestClassWithGeneric1 ctor /// </summary> public TestClassWithGeneric1(TestClassWithTwoInterfaces1 testClassWithTwoInterfaces1, ITestInterface2 testInterface2) { _testClassWithTwoInterfaces1 = testClassWithTwoInterfaces1; _testInterface2 = testInterface2; TestPrivateMethod(); }
public void WrongReturnAllow() { TestClass2 orig = new TestClass2(); ITestInterface2 asInterface = ReflectedCaster.Default.CastToInterface <ITestInterface2>(orig, CastUsageOptions.AllowMissingFunctions); Assert.Throws <ReflectedCastNotImplementedInSourceException>(() => asInterface.MethodReturn()); }
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]*/)); }
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"); }
//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(); }
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"); }
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(); }
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(); }
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(); }
public TestInterfaceImpl(ITestInterface2 t2, ITestInterface3 t3) { Test2 = t2; }
public GenericClassWithParametersAndDependencies(ITestInterface2 dependency, I prop1, S prop2) { Dependency = dependency; Prop1 = prop1; Prop2 = prop2; }
public GenericClassWithParametersAndDependencies(ITestInterface2 dependency) { Dependency = dependency; }
public TestCyclicDependency1(ITestInterface2 dependency) { _dependency = dependency; }