Example #1
0
 public ObjectA(InterfaceB b)
 {
     if (b == null)
     {
         throw new ArgumentNullException();
     }
     this.b = b;
 }
Example #2
0
 public ThirdController(ILogger <ThirdController> logger, IConfiguration configuration, InterfaceA interfaceA, InterfaceB interfaceB, InterfaceC interfaceC)
 {
     _logger        = logger;
     _configuration = configuration;
     _interfaceA    = interfaceA;
     _interfaceB    = interfaceB;
     _interfaceC    = interfaceC;
 }
    public void Callsite(InterfaceB intF)
    {
        B b = new B();

        // in both possible implementations of foo, this callsite is relevant
        // in IntA, it improves virtual dispatch,
        // and in IntB, it improves the dataflow analysis.
        intF.Foo(b, new object(), false);
    }
Example #4
0
    public void Callsite(InterfaceB intF)
    {
        B b = new B();

        // in both possible implementations of foo, this callsite is relevant
        // in IntA, it improves virtual dispatch,
        // and in IntB, it improves the dataflow analysis.
        intF.Foo(b, new object(), false); // no flow to `Sink()` via `A2.M()`, but flow via `IntA.Foo()`

        CallM(b, new object());           // no flow to `Sink()`
        CallM(this, new object());        // flow to `Sink()`
    }
Example #5
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            ICSContainer container = new CSContainer();

            container.Register <InterfaceA, ClassA>();
            container.Register <InterfaceB, ClassB>();


            InterfaceB itfb = container.Resolve <InterfaceB>();

            itfb.show();
        }
Example #6
0
    public static void Main()
    {
        MyClass myClass = new MyClass();

        Console.WriteLine("Calling myClass.MethodA()");
        myClass.MethodA();

        InterfaceB mySteerable = myClass as InterfaceB;

        Console.WriteLine("Calling mySteerable.MethodA()");
        mySteerable.MethodA();
        ((InterfaceB)myClass).MethodA();

        InterfaceA myDrivable = myClass as InterfaceA;

        Console.WriteLine("Calling myDrivable.MethodA()");
        myDrivable.MethodA();
        ((InterfaceA)myClass).MethodA();
    }
Example #7
0
 public void OneArgWithInterface(InterfaceB x)
 {
     AmbigousMethodsTests.Output = "OneArgWithInterface_InterfaceB";
 }
Example #8
0
 public ObjectBDecorator(InterfaceB b)
 {
     _b = b;
 }
 public Recipient(InterfaceA a, InterfaceB b)
 {
     Assert.Equals(a, b, "multiple type dependency");
 }
Example #10
0
 public ObjectA(InterfaceB b, ObjectC c)
 {
     this.b = b;
     _c     = c;
 }
Example #11
0
 public ObjectA(InterfaceB b)
 {
     this.b = b;
 }
Example #12
0
 public void NullPicking1(InterfaceB x)
 {
     AmbigousMethodsTests.Output = "NullPicking1_InterfaceB";
 }
Example #13
0
 public void TwoArgsWithInterface(InterfaceB x, InterfaceB y)
 {
     AmbigousMethodsTests.Output = "OneArgWithInterface_InterfaceBInterfaceB";
 }
Example #14
0
 public void TwoArgsWithInterface(InterfaceB x, ClassB2 y)
 {
     AmbigousMethodsTests.Output = "OneArgWithInterface_InterfaceBClassB2";
 }
Example #15
0
 public ServiceC(InterfaceB @interface)
 {
     interfaceB = @interface;
 }
 public void Visit(VisitContext <ContainerWithInterface> context, ref ContainerWithInterface container,
                   InterfaceB value)
 {
     Visitor.Builder.Append("B");
     context.ContinueVisitation(ref container);
 }
Example #17
0
 public ClassA(InterfaceB b)
 {
     Argument.IsNotNull(() => b);
 }
Example #18
0
 public static void PrintCounterB(InterfaceB b)
 {
     System.Console.Out.WriteLine(b.Counter);
 }