public static void Main (string[] args) {
		var t1 = new CustomType1();
		var t2 = new CustomType2();

		Console.WriteLine("{0}", ((IInterface1)t1).Interface1Method(2));
		Console.WriteLine("{0}", ((IInterface1)t2).Interface1Method(3));;
    }
예제 #2
0
    public static void Main(string[] args)
    {
        var t1 = new CustomType1();
        var t2 = new CustomType2();

        Console.WriteLine("{0} {1}", t1.Interface1Method(1), ((IInterface1)t1).Interface1Method(2));
        Console.WriteLine("{0} {1} {2}", t2.Interface1Method(1), ((CustomType1)t2).Interface1Method(2), ((IInterface1)t2).Interface1Method(3));;
    }
예제 #3
0
    public static void Main(string[] args)
    {
        var a = new CustomType1();
        a.InterfaceMethod(32);
        a.InterfaceMethod("a");

        IInterface b = a;
        b.InterfaceMethod(32);
        b.InterfaceMethod("b");
    }
    public static void Main (string[] args) {
		var t1 = new CustomType1();
		var t2 = new CustomType2();

        Console.WriteLine("{0} {1}", t1 is IInterface1, t1 is IInterface2);
        Console.WriteLine("{0} {1}", t2 is IInterface1, t2 is IInterface2);
		((IInterface1)t1).Interface1Method(2);
		((IInterface1)t2).Interface1Method(3);((IInterface2)t2).Interface2Method(4);

    }
예제 #5
0
    public static void Main(string[] args)
    {
        var t1 = new CustomType1();
        var t2 = new CustomType2();

        Console.WriteLine("{0} {1}", t1 is IInterface1, t1 is IInterface2);
        Console.WriteLine("{0} {1}", t2 is IInterface1, t2 is IInterface2);
        ((IInterface1)t1).Interface1Method(2);
        ((IInterface1)t2).Interface1Method(3); ((IInterface2)t2).Interface2Method(4);
    }
        public void IntegrationTest()
        {
            _container.Resolve <IConversionExtensions>()
            .RegisterCustomStrategy <CustomType1, string>(
                input => input.Value);

            var from = new CustomType1 {
                Value = "123"
            };

            Assert.AreEqual("123", from.Conversion().To <string>());
        }
예제 #7
0
    public static void Main(string[] args)
    {
        var a = new CustomType1();

        a.InterfaceMethod(32);
        a.InterfaceMethod("a");

        IInterface b = a;

        b.InterfaceMethod(32);
        b.InterfaceMethod("b");
    }
예제 #8
0
    public static void Main(string[] args)
    {
        var a = new CustomType1();
        a.InterfaceMethod(32);
        IInterface b = a;
        b.InterfaceMethod(32);

        a.InterfaceProperty = 16;
        Console.WriteLine(a.InterfaceProperty);
        Console.WriteLine(b.InterfaceProperty);

        b.InterfaceProperty = 17;
        Console.WriteLine(a.InterfaceProperty);
        Console.WriteLine(b.InterfaceProperty);
    }
예제 #9
0
    public static void Main(string[] args)
    {
        var a = new CustomType1();

        a.InterfaceMethod(32);
        IInterface b = a;

        b.InterfaceMethod(32);

        a.InterfaceProperty = 16;
        Console.WriteLine(a.InterfaceProperty);
        Console.WriteLine(b.InterfaceProperty);

        b.InterfaceProperty = 17;
        Console.WriteLine(a.InterfaceProperty);
        Console.WriteLine(b.InterfaceProperty);
    }