Example #1
0
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            base.OnStartup(sender, e);

            _log.Info("Starting");
            DisplayRootViewFor <ShellViewModel>();
        }
Example #2
0
        public void Bootstrap(App app, System.Windows.StartupEventArgs e)
        {
            //Start server in new thread
            try
            {
                System.Threading.ThreadPool.QueueUserWorkItem(state =>
                {
                    _host.Open();
                });
            }
            catch (Exception exc)
            {
                _host.Abort();
                throw (exc);
            }

            //Start client
            _todoServiceClient = new TodoServiceClient("NetNamedPipeBinding_ITodoService");

            //try
            //{
            //    _todoServiceClient.Open();
            //}
            //catch (Exception ex)
            //{
            //    _todoServiceClient.Abort();
            //    throw(ex);
            //}

            //_todoServiceClient = new TodoServiceClient("WsHttpBinding_ITodoService");
        }
Example #3
0
        public void Bootstrap(App app, System.Windows.StartupEventArgs e)
        {
            //ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
            //smb.HttpGetEnabled = true;
            //smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
            //_host.Description.Behaviors.Add(smb);


            //Start server in new thread
            try
            {
                System.Threading.ThreadPool.QueueUserWorkItem(state =>
                {
                    _host.Open();
                });
            }
            catch (Exception exc)
            {
                _host.Abort();
                throw (exc);
            }

            //Start client
            _todoServiceClient = new TodoServiceClient("NetNamedPipeBinding_ITodoService");
        }
Example #4
0
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            ApplicationService.IsStarting = true;

            var config = IoC.Get <IConfigurationService>().ActiveConfiguration;

            SetColors(config);
            LanguageHelper.ChangeLanguage(config.Language);

            var splashScreen = new SplashScreen();

            splashScreen.Show();

            RegisterGlobalExceptionHandling(LogManager.GetLog(typeof(AppBootstrapper)), IoC.Get <IDialogManager>());

            Dictionary <string, object> windowSettings = new Dictionary <string, object>();

            windowSettings.Add("Title", Translations.Links);
            windowSettings.Add("Height", 0D);
            windowSettings.Add("Width", 0D);

            DisplayRootViewFor <IShell>(windowSettings);

            splashScreen.Close();
            ApplicationService.IsStarting = false;
        }
Example #5
0
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            base.OnStartup(e);

            var mainThread             = Thread.CurrentThread;
            var synchronizationContext = SynchronizationContext.Current;

            NuGetUIThreadHelper.SetCustomJoinableTaskFactory(mainThread, synchronizationContext);

            var sp = new ServiceProvider();

            ServiceLocator.InitializePackageServiceProvider(sp);

            var host = sp.HostProvider?.CreateHost(async: false);

            host.ActivePackageSource = "All";
            var commandExpansion = sp.CommandExpansionProvider?.Create(host);

            var console = new StandaloneConsole();

            host.Initialize(console);

            Task.Run(async() =>
            {
                var listener = new ConsoleListener(host, commandExpansion);
                await listener.RunAsync(console).ConfigureAwait(false);
            });
        }
Example #6
0
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            this.localizer = this.Kernel.Get <ILocalizer>();
            this.localizer.Initialize();

            this.DisplayRootViewFor(typeof(IStockTickerViewModel));
        }
Example #7
0
        private void Application_Startup(object sender, System.Windows.StartupEventArgs e)
        {
            ResourceDictionary res = new ResourceDictionary();

            if (Document.Editor.My.Settings.Options_Theme == 0)
            {
                res.Source = new Uri("pack://application:,,,/Fluent;Component/Themes/Office2010/Blue.xaml");
                Document.Editor.My.Application.Resources = res;
            }
            else if (Document.Editor.My.Settings.Options_Theme == 1)
            {
                res.Source = new Uri("pack://application:,,,/Fluent;Component/Themes/Office2010/Silver.xaml");
                Document.Editor.My.Application.Resources = res;
            }
            else if (Document.Editor.My.Settings.Options_Theme == 2)
            {
                res.Source = new Uri("pack://application:,,,/Fluent;Component/Themes/Office2010/Black.xaml");
                Document.Editor.My.Application.Resources = res;
            }
            if (e.Args.Length > 0)
            {
                foreach (string s in e.Args)
                {
                    StartUpFileNames.Add(s);
                }
            }
        }
Example #8
0
        // METHODS
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            // handle unhadled exception
            this.DispatcherUnhandledException += FatalClose;

            // It is for single instance of application, when other application will be created it will redirect to first main one
            // and that other will be closed.
            bool isCreatedNewMutex;

            mutex = new Mutex(initiallyOwned: true, name: "LibraryManagementMutex", createdNew: out isCreatedNewMutex);

            // close another instance of the application
            if (!isCreatedNewMutex)
            {
                // Second application has been started up - redirected to main one

                // search for original program process
                int     currentProcessId = Process.GetCurrentProcess().Id; // second process id
                Process process          = Process.GetProcessesByName(APP_NAME).First(p => p.Id != currentProcessId);

                // shows original program main window
                ShowWindow(process.MainWindowHandle, 9); // 9 = SW_RESTORE, If the window is minimized or maximized, the system restores it to its original size and position.
                SetForegroundWindow(process.MainWindowHandle);

                // close second application
                this.Shutdown();
                return;
            }

            // call base startup
            base.OnStartup(e);
        }
Example #9
0
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            // Debugger.Launch();
            this.args = e.Args;

            base.OnStartup(sender, e);
        }
Example #10
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////
        #region Event Handler

        private void App_Startup(object sender, System.Windows.StartupEventArgs e)
        {
            using (var container = CreateContainer())
            {
                var mainWindow = container.Resolve <IMainWindow>();
                mainWindow.ShowDialog();
            }
        }
Example #11
0
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            var shell   = this.GetInstance(typeof(IShell), null) as IShell;
            var configs = this.GetInstance(typeof(IAppConfiguration), null) as IAppConfiguration;

            base.OnStartup(sender, e);
            AppearanceManager.Current.AccentColor = System.Windows.Media.Color.FromRgb(230, 174, 61);
        }
Example #12
0
    protected override void OnStartup(System.Windows.StartupEventArgs e)
    {
        base.OnStartup(e);
        // Create and show the application's main window
        MainWindow window = new MainWindow();

        window.Show();
    }
Example #13
0
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            ILocationService locationService = _container.GetInstance <ILocationService>();

            locationService.Initialize();

            DisplayRootViewFor <IShell>();
        }
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            //var loggerFactory = _container.Resolve<ILoggerFactory>();
            //loggerFactory
            //    .AddSerilog();

            DisplayRootViewFor <IShell>();
        }
Example #15
0
 protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
 {
     if (e.Args.Length > 0)
     {
         UserTto = e.Args[0];
     }
     DisplayRootViewFor <IShell>();
 }
Example #16
0
 protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
 {
     log.Info("Bootrstrapper starting");
     System.Windows.Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
     System.AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
     System.Windows.Application.Current.ShutdownMode    = System.Windows.ShutdownMode.OnExplicitShutdown;
     DisplayRootViewFor <Ui.IShell>();
 }
Example #17
0
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            if (e.Args.Length > 0)
            {
                Properties["Arguments"] = e.Args[0];
            }

            base.OnStartup(e);
        }
Example #18
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            DispatcherUnhandledException += ErrorReporting.DispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle;

            Window = new MainWindow();
            CommandArgsFactory.Execute(e.Args.ToList());
        }
Example #19
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            DispatcherUnhandledException += ErrorReporting.DispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle;

            Window = new MainWindow();
            CommandArgsFactory.Execute(e.Args.ToList());
        }
Example #20
0
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            var windowManager = _container.GetInstance(typeof(IWindowManager), null) as IWindowManager;

            if (windowManager != null)
            {
                windowManager.ShowWindow(_container.GetInstance(typeof(MainWindowViewModel), "MainWindowViewModel"));
            }
        }
Example #21
0
        private void Application_Startup(object sender, System.Windows.StartupEventArgs e)
        {
            _viewModel = new MainViewModel();
            _view      = new MainWindow();

            // TODO: make _viewModel the view model for _view

            _view.Show();
        }
Example #22
0
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            var postfix = e.Args.Length == 0 ? "no arguments passed" : e.Args[0];
            var vm      = (ShellViewModel)container.GetInstance <IShell>();

            vm.TextLine = postfix;

            DisplayRootViewFor <IShell>();
        }
Example #23
0
 /// <inheritdoc />
 protected override void OnStartup(System.Windows.StartupEventArgs e)
 {
     base.OnStartup(e);
     MainWindow.Loaded            += HandleMainWindowLoaded;
     MainWindow.IsVisibleChanged  += HandleIsVisibleChanged;
     MainWindow.SourceInitialized += HandleSourceInitialized;
     MainWindow.Closing           += HandleMainWindowClosing;
     MainWindow.Show();
 }
Example #24
0
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            // Call the OnStartup event on our base class
            base.OnStartup(e);

            // Create our MainWindow and show it
            MainWindow window = new MainWindow();

            window.Show();
        }
Example #25
0
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            base.OnStartup(sender, e);

            //TODO: Find a better way
            if (Process.GetProcessesByName("Winfy").Length > 1)
            {
                Application.Shutdown();
            }
        }
        /// <summary>
        /// Called when [startup].
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.StartupEventArgs"/> instance containing the event data.</param>
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            Log.Info("App Startup!");
            ILoginConductor  loginConductor;
            IEventAggregator events;

            loginConductor = this.container.GetExportedValue <ILoginConductor>();
            events         = this.container.GetExportedValue <IEventAggregator>();
            events.Publish(new LoginEvent());
        }
Example #27
0
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            logListener = new ObservableEventListener();
            logListener.EnableEvents(TivoProxyEventSource.Log, EventLevel.LogAlways, Keywords.All);

            logListener.LogToConsole(new SimpleEventTextFormatter());
            logListener.LogToFlatFile("ProxyLog.txt", new SimpleEventTextFormatter());

            DisplayRootViewFor <IShell>();
        }
Example #28
0
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            base.OnStartup(sender, e);

            SetAwesomiumDefaults();

            container.Resolve <IEventAggregator>().Publish(new AppReadyEvent());

            ((App)Application).HandleArguments(Environment.GetCommandLineArgs().Skip(1).ToArray());
        }
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            container.GetInstance <NotificationHandler>(); // make sure we initialize the notification handler at startup
            DisplayRootViewFor <ShellViewModel>();

#if FAKE_DATA
            var windowManager = container.GetInstance <IWindowManager>();
            windowManager.ShowWindow(new EmulatorViewModel(container.GetInstance <IMonitorStreamsModel>()));
#endif
        }
Example #30
0
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            var services   = Bootstrapper.ConfigureServices();
            var mainWindow = new ShellView
            {
                DataContext = services.GetRequiredService <ShellViewModel>()
            };

            mainWindow.Show();
        }
Example #31
0
        /// <summary>
        /// Raises the System.Windows.Application.Startup event.
        /// </summary>
        /// <param name="e">A System.Windows.StartupEventArgs that contains the event data.</param>
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            base.OnStartup(e);

#if (DEBUG)
            RunInDebugMode();
#else
            RunInReleaseMode();
#endif
            this.ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose;
        }