summaryrefslogtreecommitdiff
path: root/slips/src/app/Marina/Infrastructure/Container/Custom/CustomDependencyContainer.cs
blob: d37e452c93396c1231a16a479ff68dffbe26f1a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;
using System.Collections.Generic;

namespace Marina.Infrastructure.Container.Custom {
	public class CustomDependencyContainer : IDependencyContainer {
		private static IDictionary< Type, object > list;

		public CustomDependencyContainer( ) {
			list = new Dictionary< Type, object >( );
		}

		public Interface GetMeAnImplementationOfAn< Interface >( ) {
			Type currentType = typeof( Interface );
			return ( Interface )list[ currentType ];
		}

		public void AddImplementationOf< Interface >( Interface objectToRegister ) {
			list.Add( typeof( Interface ), objectToRegister );
		}
	}
}