예제 #1
0
    static void Main()
    {
        A       a  = new A();
        IFooBar fb = (IFooBar)a;

        fb.DoIt();
    }
예제 #2
0
		public Bar2(IFooBar fooBar)
		{
			if (fooBar == null)
				throw new ArgumentNullException("fooBar");

			_fooBar = fooBar;
		}
예제 #3
0
        public Bar2(IFooBar fooBar)
        {
            if (fooBar == null)
            {
                throw new ArgumentNullException("fooBar");
            }

            _fooBar = fooBar;
        }
예제 #4
0
        public FooBarContainer(IFooBar fooBar)
        {
            if (fooBar == null)
            {
                throw new ArgumentNullException("fooBar");
            }

            FooBar = fooBar;
        }
예제 #5
0
 public void SomeMethod()
 {
     //You don't care what type of class you get here
     //you only care that the object you get back let's you
     //call GetData.
     IFooBar foobar = DataManager.GetFooBar();
     String  data   = foobar.GetData();
     //etc
 }
        public void NamedTypeWithParametersRegistrationResolvesToCorrectType()
        {
            using (var container = new IocContainer())
            {
                container.Register <IFoo, Foo1>();
                container.Register <IBar, Bar1>();
                container.Register <IFooBar, FooBar>("bob");

                IFooBar result = container.Resolve <IFooBar>("bob");

                Verify.That(result).IsNotNull().IsAnInstanceOfType(typeof(FooBar));
                Verify.That(result.foo).IsNotNull().IsAnInstanceOfType(typeof(Foo1));
                Verify.That(result.bar).IsNotNull().IsAnInstanceOfType(typeof(Bar1));
            }
        }
예제 #7
0
		public FooBarContainer(IFooBar fooBar)
		{
			if (fooBar == null)
				throw new ArgumentNullException("fooBar");

			FooBar = fooBar;
		}
예제 #8
0
 public Bar(Foo f, IFooBar fb)
 {
     this._f  = f;
     this._fb = fb;
 }
예제 #9
0
 public static IFooBar GetFooBar()
 {
     IFooBar foobar = ...
                      return(foobar);
 }
예제 #10
0
 public FooMiddleware(RequestDelegate next, IFooBar foobar)
 {
     _next   = next;
     _foobar = foobar;
 }
예제 #11
0
 public void AddFooBar(IFooBar bar)
 {
     this.bars.Add(FooBar.Create(this.value, bar.value));
 }
예제 #12
0
 public void AddFooBar(IFooBar foo)
 {
     this.foos.Add(FooBar.Create(this.value, foo.value));
 }
예제 #13
0
 public ClientTwo(IFooBar fooBar)
 {
     this.fooBar = fooBar;
 }
예제 #14
0
파일: Stubs.cs 프로젝트: GeorgeR/DynamoIOC
 public Bar2(IFooBar foobar)
 {
     _foobar = foobar;
 }