public static IToken Register([NotNull] this IMutableContainer container, [NotNull][ItemNotNull] IEnumerable <Type> types, [NotNull] IDependency dependency, [CanBeNull] ILifetime lifetime = null, [CanBeNull][ItemCanBeNull] object[] tags = null) { if (container == null) { throw new ArgumentNullException(nameof(container)); } if (types == null) { throw new ArgumentNullException(nameof(types)); } if (dependency == null) { throw new ArgumentNullException(nameof(dependency)); } var keys = from type in types from tag in tags ?? DefaultTags select new Key(type, tag); return(container.TryRegisterDependency(keys, dependency, lifetime, out var dependencyToken) ? dependencyToken : container.Resolve <ICannotRegister>().Resolve(container, keys, dependency, lifetime)); }
public TeamCityMsBuildLogger(IMutableContainer container) { _container = container; _logger = _container.Resolve <INodeLogger>(); }
public App() { InitializeComponent(); MainPage = Container.Resolve <Page>(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); Container.Resolve <IMainWindowView>().Show(); }