示例#1
0
        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));
        }
示例#2
0
 public TeamCityMsBuildLogger(IMutableContainer container)
 {
     _container = container;
     _logger    = _container.Resolve <INodeLogger>();
 }
示例#3
0
 public App()
 {
     InitializeComponent();
     MainPage = Container.Resolve <Page>();
 }
示例#4
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     Container.Resolve <IMainWindowView>().Show();
 }