当前位置: 首页>>代码示例>>C#>>正文


C# IApplicationController.Initialize方法代码示例

本文整理汇总了C#中IApplicationController.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# IApplicationController.Initialize方法的具体用法?C# IApplicationController.Initialize怎么用?C# IApplicationController.Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IApplicationController的用法示例。


在下文中一共展示了IApplicationController.Initialize方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            #if (DEBUG != true)
            // Don't handle the exceptions in Debug mode because otherwise the Debugger wouldn't
            // jump into the code when an exception occurs.
            DispatcherUnhandledException += AppDispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += AppDomainUnhandledException;
            #endif

            AggregateCatalog catalog = new AggregateCatalog();
            // Add the BigEggApplicationFramework assembly to the catalog
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(Controller).Assembly));
            // Add the FMStudio.Presentation assembly to the catalog
            catalog.Catalogs.Add(new AssemblyCatalog(Assembly.GetExecutingAssembly()));
            // Add the FMStudio.Applications assembly to the catalog
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(IApplicationController).Assembly));

            container = new CompositionContainer(catalog);
            CompositionBatch batch = new CompositionBatch();
            batch.AddExportedValue(container);
            container.Compose(batch);

            controller = container.GetExportedValue<IApplicationController>();
            controller.Initialize();
            controller.Run();
        }
开发者ID:naindejardin,项目名称:Financial-Management-Studio,代码行数:28,代码来源:App.xaml.cs

示例2: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            #if (DEBUG != true)
            // Don't handle the exceptions in Debug mode because otherwise the Debugger wouldn't
            // jump into the code when an exception occurs.
            DispatcherUnhandledException += AppDispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += AppDomainUnhandledException;
            #endif
            XmlConfigurator.Configure();
            _log.Debug("OnStartup called");

            var catalog = new AggregateCatalog();
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(Controller).Assembly));
            catalog.Catalogs.Add(new AssemblyCatalog(Assembly.GetExecutingAssembly()));
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(IApplicationController).Assembly));
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(ValidationModel).Assembly));

            _container = new CompositionContainer(catalog);
            var batch = new CompositionBatch();
            batch.AddExportedValue(_container);
            _container.Compose(batch);

            _controller = _container.GetExportedValue<IApplicationController>();
            _controller.Initialize();
            _controller.Run();
        }
开发者ID:nootn,项目名称:ClinImIm,代码行数:28,代码来源:App.xaml.cs

示例3: Initialize

        public void Initialize()
        {
            Container = CompositionHelper.GetContainer();
            CompositionHelper.ComposeContainerWithDefaults(Container);
            CompositionHelper.ComposeMessageServiceImplementation(Container, GetMessageService());
            CompositionHelper.ComposeFileEnumeratorImplementation(Container, GetFileEnumerator());
            CompositionHelper.ComposeImportImagesViewImplementation(Container, NSubstitute.Substitute.For<IImportImagesView>());

            ApplicationController = Container.GetExportedValue<IApplicationController>();
            ApplicationController.Initialize();
            ApplicationController.Run();
        }
开发者ID:nootn,项目名称:ClinImIm,代码行数:12,代码来源:SelectDriveToPreview.cs

示例4: Initialize

        public void Initialize()
        {
            Container = CompositionHelper.GetContainer();
            CompositionHelper.ComposeContainerWithDefaults(Container);
            CompositionHelper.ComposeMessageServiceImplementation(Container, GetMessageService());
            CompositionHelper.ComposeFileEnumeratorImplementation(Container, new FileEnumeratorHasMoreThanMaxNumberOfFiles());
            CompositionHelper.ComposeImportImagesViewImplementation(Container, NSubstitute.Substitute.For<IImportImagesView>());

            ApplicationController = Container.GetExportedValue<IApplicationController>();
            ApplicationController.Initialize();
            ApplicationController.Run();

            TestDataHelper.MakeDriveValid(ApplicationController.CurrentSelectDriveViewModel.Model);
            TestNavigationHelper.NavigateFromSelectDriveToSelectPatient(ApplicationController);
        }
开发者ID:nootn,项目名称:ClinImIm,代码行数:15,代码来源:SelectPatientToAssociateImagesWith.cs

示例5: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            _catalog = new AggregateCatalog();
            // Add the WpfApplicationFramework assembly to the catalog
            _catalog.Catalogs.Add(new AssemblyCatalog(typeof(ViewModel).Assembly));
            // Add the Writer.Presentation assembly to the catalog
            _catalog.Catalogs.Add(new AssemblyCatalog(Assembly.GetExecutingAssembly()));
            // Add the Writer.Applications assembly to the catalog
            _catalog.Catalogs.Add(new AssemblyCatalog(typeof(IApplicationController).Assembly));

            _container = new CompositionContainer(_catalog, CompositionOptions.DisableSilentRejection);
            CompositionBatch batch = new CompositionBatch();
            batch.AddExportedValue(_container);
            _container.Compose(batch);

            _controller = _container.GetExportedValue<IApplicationController>();
            _controller.Initialize();
            _controller.Run();
        }
开发者ID:Porokhnin,项目名称:Replication,代码行数:21,代码来源:App.xaml.cs

示例6: OnStartup

        /// <exception cref="ImportCardinalityMismatchException">
        ///     There are zero exported objects with the contract name derived from
        ///     <paramref name="T" /> in the <see cref="CompositionContainer" />
        ///     .-or-There is more than one exported object with the contract name
        ///     derived from <paramref name="T" /> in the
        ///     <see cref="CompositionContainer" /> .
        /// </exception>
        /// <exception cref="CompositionContractMismatchException">
        ///     The underlying exported object cannot be cast to
        ///     <paramref name="T" /> .
        /// </exception>
        /// <exception cref="CompositionException">
        ///     An error occurred during composition.
        ///     <see cref="System.ComponentModel.Composition.CompositionException.Errors" />
        ///     will contain a collection of errors that occurred.
        /// </exception>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            DispatcherUnhandledException += AppDispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += AppDomainUnhandledException;

            catalog = new AggregateCatalog();
            // Add the WpfApplicationFramework assembly to the catalog
            catalog.Catalogs.Add(new AssemblyCatalog(typeof (ViewModel).Assembly));
            // Add the Common assembly to catalog
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(ApplicationLogger).Assembly));
            //Add Services assembly to catalog
            catalog.Catalogs.Add(new AssemblyCatalog(typeof (ICalendarService).Assembly));
            //Add Authentication.Google assembly to catalog
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(IAccountAuthenticationService).Assembly));
            //Add GoogleServices assembly to catalog
            catalog.Catalogs.Add(new AssemblyCatalog(typeof (IGoogleCalendarService).Assembly));
            //Add OutlookServices assembly to catalog
            catalog.Catalogs.Add(new AssemblyCatalog(typeof (IOutlookCalendarService).Assembly));
            //Add ExchangeWebServices assembly to catalog
            catalog.Catalogs.Add(new AssemblyCatalog(typeof (IExchangeWebCalendarService).Assembly));
            //Add SyncEngine assembly to catalog
            catalog.Catalogs.Add(new AssemblyCatalog(typeof (ICalendarSyncEngine).Assembly));
            //Add Analytics assembly to catalog
            catalog.Catalogs.Add(new AssemblyCatalog(typeof (SyncAnalyticsService).Assembly));
            // Add the Application assembly to the catalog
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(ShellViewModel).Assembly));
            // Add the Presentation assembly to the catalog
            catalog.Catalogs.Add(new AssemblyCatalog(Assembly.GetExecutingAssembly()));

            //Composition Container
            container = new CompositionContainer(catalog, true);
            var batch = new CompositionBatch();
            batch.AddExportedValue(container);
            container.Compose(batch);

            //Load settings
            var settings = container.GetExportedValue<ISettingsProvider>().GetSettings();
            container.ComposeExportedValue(settings);

            //Load sync summary
            var syncSummary = container.GetExportedValue<ISyncSummaryProvider>().GetSyncSummary();
            container.ComposeExportedValue(syncSummary);

            //Get Application logger
            _applicationLogger = container.GetExportedValue<ApplicationLogger>();
            _applicationLogger.Setup();

            //Initialize Application Controller
            controller = container.GetExportedValue<IApplicationController>();

            controller.Initialize();
            if (settings.AppSettings.StartMinimized)
            {
                _startMinimized = true;
            }
            controller.Run(_startMinimized);
        }
开发者ID:flyeven,项目名称:PCoMD,代码行数:75,代码来源:App.xaml.cs

示例7: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            #if (DEBUG != true)
            // Don't handle the exceptions in Debug mode because otherwise the Debugger wouldn't
            // jump into the code when an exception occurs.
            DispatcherUnhandledException += AppDispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += AppDomainUnhandledException;
            #endif

            catalog = new AggregateCatalog();
            // Add the Framework assembly to the catalog
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(ViewModel).Assembly));
            // Add the Bugger.Presentation assembly to the catalog
            catalog.Catalogs.Add(new AssemblyCatalog(Assembly.GetExecutingAssembly()));
            // Add the Bugger.Applications assembly to the catalog
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(IApplicationController).Assembly));

            // Add the Bugger.Proxy assemblies to the catalog
            string proxyAsseblyPath = Path.Combine(
                Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
                "Proxies");
            foreach (var file in new System.IO.DirectoryInfo(proxyAsseblyPath).GetFiles())
            {
                if (file.Extension.ToLower() == ".dll" && file.Name.StartsWith("Bugger.Proxy."))
                {
                    catalog.Catalogs.Add(new AssemblyCatalog(file.FullName));
                }
            }

            container = new CompositionContainer(catalog);
            CompositionBatch batch = new CompositionBatch();
            batch.AddExportedValue(container);
            container.Compose(batch);

            controller = container.GetExportedValue<IApplicationController>();
            controller.Initialize();
            controller.Run();
        }
开发者ID:alibad,项目名称:Bugger,代码行数:40,代码来源:App.xaml.cs

示例8: InitializeContext

        private void InitializeContext(bool showUpdateDateMsg = false)
        {
            components = new System.ComponentModel.Container();

            InitializeMef();
            controller = container.GetExportedValue<IApplicationController>();
            controller.Initialize();

            controller.SetAddFileCommand(new DelegateCommand(AddFile));
            controller.SetAddApiTokenCommand(new DelegateCommand(AddApiToken));
            controller.SetUpdateApiTokenCommand(new DelegateCommand(UpdateApiToken));
            controller.SetRemoveApiTokenCommand(new DelegateCommand(RemoveApiToken));
            controller.SetUploadFilesCommand(new DelegateCommand(ForceUploads));
            controller.SetGetFilesCommand(new DelegateCommand(GetFiles));
            controller.SetGetTokensCommand(new DelegateCommand(GetTokens));
            controller.SetGetDeleteFileCommand(new DelegateCommand(DeleteFile));
            controller.SetUpdateFilesCommand(new DelegateCommand(UpdateFileInfo));

            NotifyIcon = new NotifyIcon(components)
            {
                ContextMenuStrip = new ContextMenuStrip(),
                Icon = Core.Properties.Resources.NotifyIcon,
                Text = Core.Properties.Resources.DefaultNotificationToolTip,
                BalloonTipText = Core.Properties.Resources.DefaultNotificationToolTip
            };

            //Status manager is ues to check if windows WCF service is runing and if windows server is running
            ServiceStatusManager = new ServiceStatusManager(NotifyIcon, controller);
            NotifyIcon.ContextMenuStrip.Opening += ContextMenuStripOpening;
            NotifyIcon.DoubleClick += NotifyIconDoubleClick;
            NotifyIcon.MouseUp += NotifyIconMouseUp;
            NotifyIcon.Visible = true;

            try
            {
                var updaterChecker = Util.CreateUpdater();
                updateIsRequired = updaterChecker.IsUpdateFileExist();
                if (updateIsRequired)
                {
                    if (DoUpdateMsg(updaterChecker.Manifest.AppVersion) == DialogResult.Yes)
                    {
                        updaterChecker.ExecuteOutProcessUpdate();
                        return;
                    }
                }

                if (showUpdateDateMsg)
                     MessageBox.Show(Resources.IsUptoDateMsg,
                        Resources.UpdateAlertCaption, MessageBoxButtons.OK,
                        MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);

                updateTimer = new Timer { Interval = 1000 * 60 * Settings.Default.UpdateIntervalInMinutes };
                updateTimer.Tick += (s, e) => CheckUpdateApp(false);
                updateTimer.Start();

                Process.Start("TicketEvolution.Updater.exe");
            }
            catch (Exception ex)
            {

                Log.DebugFormat("Exception occured trying to start Updater: {0}", ex.Message);
            }
        }
开发者ID:tccyp001,项目名称:ticketrevolution,代码行数:63,代码来源:SysTrayApplicationContext.cs


注:本文中的IApplicationController.Initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。