コード例 #1
0
        private AutofacMvxIocProvider CreateProvider(IContainer container = null, MvxPropertyInjectorOptions options = null)
        {
            if (container == null)
            {
                container = new ContainerBuilder().Build();
            }

            var provider = new AutofacMvxIocProvider(container, options ?? new MvxPropertyInjectorOptions());

            this._disposables.Add(provider);
            return(provider);
        }
コード例 #2
0
ファイル: MvxTest.cs プロジェクト: charri/xamzueri
        protected virtual void ClearAll()
        {
            // fake set up of the IoC
            MvxSingleton.ClearAllSingletons();
            var withInject = new MvxPropertyInjectorOptions()
            {
                InjectIntoProperties          = MvxPropertyInjection.MvxInjectInterfaceProperties,
                ThrowIfPropertyInjectionFails = true
            };
            var options = new MvxIocOptions {
                PropertyInjectorOptions = withInject
            };

            _ioc = MvxSimpleIoCContainer.Initialize(options);
            _ioc.RegisterSingleton(_ioc);
            InitializeTrace();
            InitializeSingletonCache();
            InitializeMvxSettings();
            MvxTrace.Initialize();
            AdditionalSetup();
        }