本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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);
}
示例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();
}
示例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);
}
}