コード例 #1
0
ファイル: Services.cs プロジェクト: zhyfeather/WOA-Deployer
        public void Configure(IExportRegistrationBlock block)
        {
            block.Export <GuiRequirementSatisfier>().As <IRequirementSatisfier>().Lifestyle.Singleton();
            block.Export <WpfDialogService>().As <IDialogService>().Lifestyle.Singleton();
            block.Export <SettingsService>().As <ISettingsService>().Lifestyle.Singleton();
            block.Export <OpenFilePicker>().As <IOpenFilePicker>().Lifestyle.Singleton();
            block.Export <DesktopFilePicker>().As <IFilePicker>().Lifestyle.Singleton();
            block.ExportFactory <Uri, IFileSystemOperations, ZafiroFile>((uri, f) => new DesktopZafiroFile(uri, f, null));
            block.Export <MarkdownService>().As <IMarkdownService>().Lifestyle.Singleton();
            var simpleInteraction = new SimpleInteraction();

            simpleInteraction.Register("Requirements", typeof(Requirements));
            block.ExportInstance(simpleInteraction).As <ISimpleInteraction>();
            block.Export <WoaDeployer>().Lifestyle.Singleton();
        }
コード例 #2
0
        public void Configure(IExportRegistrationBlock block)
        {
            block.Export <GuiRequirementSatisfier>().As <IRequirementSatisfier>().Lifestyle.Singleton();
            block.Export <WpfDialogService>().As <IDialogService>().Lifestyle.Singleton();
            block.Export <SettingsService>().As <ISettingsService>().Lifestyle.Singleton();
            block.Export <OpenFilePicker>().As <IOpenFilePicker>().Lifestyle.Singleton();
            block.Export <DesktopFilePicker>().As <IFilePicker>().Lifestyle.Singleton();
            block.ExportFactory <Uri, IFileSystemOperations, ZafiroFile>((uri, f) => new DesktopZafiroFile(uri, f, null));
            block.Export <MarkdownService>().As <IMarkdownService>().Lifestyle.Singleton();
            var simpleInteraction = new SimpleInteraction();

            simpleInteraction.Register("Requirements", typeof(Requirements));
            block.ExportInstance(simpleInteraction).As <ISimpleInteraction>();
            block.Export <ScriptDeployer>().As <Core.Deployer>().Lifestyle.Singleton();
            block.Export <DeviceDeployer>().As <Core.Deployer>().Lifestyle.Singleton();
            block.ExportAssemblies(Assemblies.AppDomainAssemblies)
            .Where(y => typeof(ISection).IsAssignableFrom(y))
            .ByInterface <ISection>()
            .ByInterface <IBusy>()
            .ByType()
            .ExportAttributedTypes()
            .Lifestyle.Singleton();
        }