Esempio n. 1
1
 private void App_OnStartup(object sender, StartupEventArgs e)
 {
     Updater.Run();
     ErrorSelectionWindow = new ErrorSelectionWindow();
     ErrorSelectionWindow.Show();
     ErrorSelectionWindow.Topmost = true;
 }
        protected override void OnStartup(StartupEventArgs e)
        {
            try
            {
                AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
                Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;

                SoftphoneEngine model = new SoftphoneEngine();

                MainWindow_1 window = new MainWindow_1(model);
                window.Show();
            }
            catch (Exception ex)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("Could not initialize softphone: \r\n");
                sb.Append(ex.Message);
                sb.Append("\r\n");
                sb.Append(ex.InnerException);
                sb.Append(ex.StackTrace);
                MessageBox.Show(sb.ToString());
                Application.Current.Shutdown();
            }

            base.OnStartup(e);
        }
Esempio n. 3
1
        private void Application_Startup(object sender, StartupEventArgs e)
        {

            Csla.DataPortal.ProxyTypeName = "Csla.DataPortalClient.WcfProxy, Csla";
            Csla.DataPortalClient.WcfProxy.DefaultUrl = "http://localhost:3390/ChildGrandChildWeb/WcfPortal.svc";
            this.RootVisual = new Page();
        }
Esempio n. 4
1
        /// <summary>
        /// Handles the Startup event of the Application control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.StartupEventArgs"/> instance containing the event data.</param>
        private void OnApplicationStartup(object sender, StartupEventArgs e)
        {
            Catel.Windows.StyleHelper.CreateStyleForwardersForDefaultStyles();

            var serviceLocator = ServiceLocator.Default;
            serviceLocator.RegisterType<IViewLocator, ViewLocator>();
            var viewLocator = serviceLocator.ResolveType<IViewLocator>();
            viewLocator.NamingConventions.Add("[UP].Views.[VM]");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInBehavior.[VM]");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInBehavior.[VM]View");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInBehavior.[VM]Window");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInViewBase.[VM]");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInViewBase.[VM]View");
            viewLocator.NamingConventions.Add("[UP].Views.LogicInViewBase.[VM]Window");

            serviceLocator.RegisterType<IViewModelLocator, ViewModelLocator>();
            var viewModelLocator = serviceLocator.ResolveType<IViewModelLocator>();
            viewModelLocator.NamingConventions.Add("Catel.Examples.AdvancedDemo.ViewModels.[VW]ViewModel");

            // Register several different external IoC containers for demo purposes
            IoCHelper.MefContainer = new CompositionContainer();
            IoCHelper.UnityContainer = new UnityContainer();
            serviceLocator.RegisterExternalContainer(IoCHelper.MefContainer);
            serviceLocator.RegisterExternalContainer(IoCHelper.UnityContainer);

            RootVisual = new MainPage();
        }
Esempio n. 5
1
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     string langPath = "/lang/zh.xaml";
     App.Current.Resources.MergedDictionaries.Clear();
     App.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri(langPath, UriKind.RelativeOrAbsolute) });
 }
Esempio n. 6
1
        protected override void OnStartup(StartupEventArgs e)
        {
            var handle = IntPtr.Zero;
            var className = new StringBuilder(1024);
            for(;;)
            {
                handle = WinApi.FindWindowEx(IntPtr.Zero, handle, null, "LyncMsg");
                if (handle == IntPtr.Zero)
                    break;

                if (WinApi.GetClassName(handle, className, 1024) <= 0)
                    continue;

                if (className.ToString().IndexOf("[LyncMsg.exe") >= 0)
                    break;
            }

            if (handle == IntPtr.Zero)
            {
                base.OnStartup(e);
                return;
            }
            if (WinApi.IsWindowVisible(handle) && (WinApi.IsIconic(handle) || WinApi.GetForegroundWindow() != handle))
                WinApi.SwitchToThisWindow(handle, true);
            else
                WinApi.ShowWindow(handle, WinApi.WindowShowStyle.SwShow);
            Current.Shutdown();
        }
Esempio n. 7
1
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            linkIO = LinkIOImp.Instance;

            if (!Directory.Exists(Data.NineFolder))
            {
                Directory.CreateDirectory(Data.NineFolder);
            }

            currentWindow = new MainWindow();
#if START_ON_MAINPAGE
            // Connect user as a Teacher
            new UserConnection().Connection.Execute(0);

            // If a Lesson exists, go to MainPage
            var nineFiles = Directory.GetFiles(Data.NineFolder.ToString(), "*.nine", SearchOption.AllDirectories);
            if (nineFiles.Length > 0)
            {
                FileStream serializedLesson = new FileStream(nineFiles[0], FileMode.Open);
                Data.Instance.Lesson = (Lessons.Lesson)(new BinaryFormatter()).Deserialize(serializedLesson);
                serializedLesson.Close();
                Catalog.Instance.NavigateTo("MainPage");
            }
            // Else go to HomePage (to create a Lesson)
            else
            {
                Catalog.Instance.NavigateTo("HomePage");
            }
#else
            Catalog.Instance.NavigateTo("UserConnectionPage");
#endif
            currentWindow.Show();

        }
Esempio n. 8
1
		protected override void OnStartup(StartupEventArgs e)
		{
			base.OnStartup(e);

			new TaskTrayIcon().AddTo(this);

			Clock clock = null;

			var detector = new ShortcutKeyDetector().AddTo(this);
			detector.KeySetPressedAsObservable()
					.Where(_ => Settings.Default.ClockTypeSetting == ClockTypeSetting.Win8)
					.Where(_ => clock?.IsDisposed ?? true)
					.Where(args => args.ShortcutKey == Settings.Default.ModkeySetting.ToShortcutKey())
					.Subscribe(args =>
					{
						args.Handled = true;
						clock = new Clock();
					}).AddTo(this);

			detector.KeySetPressedAsObservable()
			        .Where(_ => Settings.Default.ClockTypeSetting == ClockTypeSetting.Calendar)
			        .Where(args => args.ShortcutKey == Settings.Default.ModkeySetting.ToShortcutKey())
			        .Subscribe(args =>
			        {
				        args.Handled = true;
				        ShowCalendar.Show();
			        });
		}
Esempio n. 9
1
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            CommandingBootstrapper bootstrapper = new CommandingBootstrapper();
            bootstrapper.Run();
        }
Esempio n. 10
1
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            MainWindow window = new MainWindow();

            // Create the ViewModel to which
            // the main window binds.
            var viewModel = new ViewModel.MainWindowViewModel();

            // When the ViewModel asks to be closed,
            // close the window.
            EventHandler handler = (sender, e2) =>
            {
                window.Close();
            };

            viewModel.RequestClose += handler;
            viewModel.RequestClosed += (sender, e3) =>
                {
                    viewModel.RequestClose -= handler;
                };

            // Allow all controls in the window to
            // bind to the ViewModel by setting the
            // DataContext, which propagates down
            // the element tree.
            window.DataContext = viewModel;

            window.Show();
        }
Esempio n. 11
1
        protected override void OnStartup(StartupEventArgs e)
        {
            if (AppDomain.CurrentDomain.SetupInformation.ActivationArguments != null &&
                AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData != null &&
                AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData.Length > 0)
            {
                try
                {
                    string fname = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData[0];

                    // It comes in as a URI; this helps to convert it to a path.
                    var uri = new Uri(fname);
                    fname = uri.LocalPath;

                    Properties["OpenFile"] = fname;
                }
                catch (Exception ex)
                {
                    // For some reason, this couldn't be read as a URI.
                    // Do what you must...
                }
            }

            BCCL.MvvmLight.Threading.TaskFactoryHelper.Initialize();
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            base.OnStartup(e);
        }
Esempio n. 12
1
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            // Global exception handling
            Current.DispatcherUnhandledException += AppDispatcherUnhandledException;

            string procName = Process.GetCurrentProcess().ProcessName;
            // get the list of all processes by that name

            Process[] processes = Process.GetProcessesByName(procName);

            if (processes.Length > 1)
            {
                MessageBox.Show(TranslationStrings.LabelApplicationAlreadyRunning);
                Shutdown(-1);
                return;
            }

            ThemeManager.AddAccent("Astro", new Uri("pack://application:,,,/CameraControl;component/Resources/AstroAccent.xaml"));
            ThemeManager.AddAppTheme("Black", new Uri("pack://application:,,,/CameraControl;component/Resources/AstroTheme.xaml"));

            ServiceProvider.Branding = Branding.LoadBranding();
            if (ServiceProvider.Branding.ShowStartupScreen)
            {
                _startUpWindow=new StartUpWindow();
                _startUpWindow.Show();
            }

            Task.Factory.StartNew(InitApplication);
        }
Esempio n. 13
1
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            try
            {
                // Deployed applications must be licensed at the Basic level or greater (https://developers.arcgis.com/licensing).
                // To enable Basic level functionality set the Client ID property before initializing the ArcGIS Runtime.
                // ArcGISRuntimeEnvironment.ClientId = "<Your Client ID>";

                // Initialize the ArcGIS Runtime before any components are created.
                ArcGISRuntimeEnvironment.Initialize();

                // Standard level functionality can be enabled once the ArcGIS Runtime is initialized.                
                // To enable Standard level functionality you must either:
                // 1. Allow the app user to authenticate with ArcGIS Online or Portal for ArcGIS then call the set license method with their license info.
                // ArcGISRuntimeEnvironment.License.SetLicense(LicenseInfo object returned from an ArcGIS Portal instance)
                // 2. Call the set license method with a license string obtained from Esri Customer Service or your local Esri distributor.
                // ArcGISRuntimeEnvironment.License.SetLicense("<Your License String or Strings (extensions) Here>");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "ArcGIS Runtime initialization failed.");

                // Exit application
                this.Shutdown();
            }
        }
Esempio n. 14
1
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            //for install plugin command when wox didn't start up
            //we shouldn't init MainWindow, just intall plugin and exit.
            if (e.Args.Length > 0 && e.Args[0].ToLower() == "installplugin")
            {
                var path = e.Args[1];
                if (!File.Exists(path))
                {
                    MessageBox.Show("Plugin " + path + " didn't exist");
                    return;
                }
                PluginInstaller.Install(path);
                Environment.Exit(0);
                return;
            }

            window = new MainWindow();
            if (e.Args.Length == 0 || e.Args[0].ToLower() != "hidestart")
            {
                window.ShowApp();
            }

            window.ParseArgs(e.Args);
        }
Esempio n. 15
1
        /// <summary>
        /// Override the startup behavior to handle files dropped on the app icon.
        /// </summary>
        /// <param name="e">
        /// The StartupEventArgs.
        /// </param>
        protected override void OnStartup(StartupEventArgs e)
        {
            OperatingSystem OS = Environment.OSVersion;
            if ((OS.Platform == PlatformID.Win32NT) && (OS.Version.Major == 5 && OS.Version.Minor <= 1))
            {
                MessageBox.Show("Windows XP and earlier are no longer supported. Version 0.9.9 was the last version to support these versions. ", "Notice", MessageBoxButton.OK, MessageBoxImage.Warning);
                Application.Current.Shutdown();
                return;
            }

            if (e.Args.Any(f => f.Equals("--reset")))
            {
                HandBrakeApp.ResetToDefaults();
                Application.Current.Shutdown();
                return;
            }

            if (e.Args.Any(f => f.Equals("--auto-start-queue")))
            {
                StartupOptions.AutoRestartQueue = true;
            }

            base.OnStartup(e);

            // If we have a file dropped on the icon, try scanning it.
            string[] args = e.Args;
            if (args.Any() && (File.Exists(args[0]) || Directory.Exists(args[0])))
            {
                IMainViewModel mvm = IoC.Get<IMainViewModel>();
                mvm.StartScan(args[0], 0);
            }
        }
Esempio n. 16
1
        void Application_Startup(object sender, StartupEventArgs e)
        {
            // Application.Current.Host

            foreach (var key in e.InitParams.Keys)
            {
                // Process the initParam from the createObjectEx function
            }

            this.RootVisual = new MainPage();

            Exceute(new NetworkChangedToast());
            Exceute(new NetworkChangedToast());
            Exceute(new NetworkChangedToast());

            // Exceute(new TalkAutomation() { Message = "I'm better than any in-page midi file!" });

            //Exceute(new ExcelAutomation());

            //Exceute(new ResizeWindowTask());

            if (Application.Current.HasElevatedPermissions)
            {
                /* Light up the awesomeness */
            }
        }
Esempio n. 17
1
        protected override void OnStartup(StartupEventArgs e)
        {
            PlatformService.Instance = this;
            Config config = Config.Load();

            if(!config.UseWebServices) {
                string connectionString = String.Format("Server = {0}; Database = {1}; Uid = {2};",
                    config.DatabaseServer, config.DatabaseName, config.DatabaseUser);
                IDatabase db = null;
                try {
                    db = new MYSQLDatabase(connectionString);
                } catch(Exception ex) {
                    PlatformService.Instance.ShowErrorMessage(
                        "Could not connect to database '" + connectionString + "'\n\n" + ex.Message,
                        "Database connection failure");
                    Environment.Exit(-1);
                }
                SharedServices.Init(db);
            }
            else
            {
                var client = new RestClient(config.WebServiceBase);
                SharedServices.Init(client);
            }

            base.OnStartup(e);
        }
Esempio n. 18
1
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Application.Startup"/> event.
        /// </summary>
        /// <param name="e">A <see cref="T:System.Windows.StartupEventArgs"/> that contains the event data.</param>
        protected override void OnStartup(StartupEventArgs e)
        {
#if DEBUG
            Catel.Logging.LogManager.AddDebugListener(true);

            var logPath = Path.Combine(GetType().Assembly.GetDirectory(), "debug.log");
            LogManager.AddListener(new FileLogListener(logPath, 25 * 1024));
#endif

            //var consoleLogListener = new ConsoleLogListener();
            //consoleLogListener.IgnoreCatelLogging = true;
            //LogManager.AddListener(consoleLogListener);

            Console.WriteLine(typeof(ILicenseService));

            StyleHelper.CreateStyleForwardersForDefaultStyles();

            var serviceLocator = ServiceLocator.Default;
            var languageService = serviceLocator.ResolveType<ILanguageService>();

            //languageService.PreferredCulture = new CultureInfo("nl-NL");
            //languageService.FallbackCulture = new CultureInfo("en-US");

            languageService.PreloadLanguageSources();

            base.OnStartup(e);
        }
Esempio n. 19
1
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     //Application.Current.Resources.MergedDictionaries.Clear();
     //ResourceDictionary resource = (ResourceDictionary)Application.LoadComponent(
     //        new Uri("Dictionary1.xaml", UriKind.Relative));
     //Application.Current.Resources.MergedDictionaries.Add(resource);
 }
Esempio n. 20
1
 void App_Startup(object sender, StartupEventArgs e)
 {
     Window = new MainWindow();
     SubscribeToWindowEvents();
     MainWindow = Window;
     Window.Show();
 }
Esempio n. 21
1
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     if (e.Args.Length > 0)
     {
         this.Properties["GamePath"] = e.Args[0];
     }
 }
 private void OnStartup(object sender, StartupEventArgs e)
 {
     // Create the ViewModel and expose it using the View's DataContext
     Views.MainView view = new Views.MainView();
     view.DataContext = new ViewModels.MainViewModel();
     view.Show();
 }
Esempio n. 23
0
        [PrincipalPermission(SecurityAction.Demand)]  // Principal must be authenticated
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            Tracker.StartStudio();
            ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose;
            Task.Factory.StartNew(() =>
            {
                var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), GlobalConstants.Warewolf, "Feedback");
                DirectoryHelper.CleanUp(path);
                DirectoryHelper.CleanUp(Path.Combine(GlobalConstants.TempLocation, GlobalConstants.Warewolf, "Debug"));
            });

            var localprocessGuard = new Mutex(true, GlobalConstants.WarewolfStudio, out bool createdNew);

            if (createdNew)
            {
                _processGuard = localprocessGuard;
            }
            else
            {
                Environment.Exit(Environment.ExitCode);
            }

            InitializeShell(e);
#if !(DEBUG)
            var versionChecker = new VersionChecker();
            if (versionChecker.GetNewerVersion())
            {
                WebLatestVersionDialog dialog = new WebLatestVersionDialog();
                dialog.ShowDialog();
            }
#endif
        }
Esempio n. 24
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            var bootstrapper = new Bootstrapper(_installer);

            bootstrapper.Run();
        }
Esempio n. 25
0
 protected override void OnStartup(System.Windows.StartupEventArgs e)
 {
     SpectreEngine.xrCoreInit();
     SpectreEngine.xrEngineInit();
     SpectreEngine.xrRenderInit();
     base.OnStartup(e);
 }
Esempio n. 26
0
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            var useDefaultPrismConfiguration = bool.Parse(ConfigurationManager.AppSettings["useDefaultPrismConfiguration"]);
            var bootstrapper = new JamSoftBootstrapper();

            bootstrapper.Run();
        }
Esempio n. 27
0
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            // logger Helper guardara toda excepcion generada. // TODO no eliminar.
            AppDomain.CurrentDomain.UnhandledException += StockAdminContext.Helpers.LoggerHelper.OnExceptionRaised;

            StyleManager.ApplicationTheme = new Windows8TouchTheme();

            var culture = new CultureInfo(Config.CurrentCulture);

            Thread.CurrentThread.CurrentCulture   = culture;
            Thread.CurrentThread.CurrentUICulture = culture;

            FrameworkElement.LanguageProperty.OverrideMetadata(
                typeof(FrameworkElement),
                new FrameworkPropertyMetadata(
                    XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)
                    )
                );

            LocalizationManager.DefaultResourceManager = new ResourceManager("Telerik.Windows.Examples.GridView.Localization.Spanish", Assembly.GetCallingAssembly());
            LocalizationManager.Manager = new LocalizationManager {
                Culture = Thread.CurrentThread.CurrentCulture
            };
            LocalizationManager.DefaultCulture = culture;

            InitializeApplicationConfig();
        }
Esempio n. 28
0
        void StartupHandler(object sender, System.Windows.StartupEventArgs e)
        {
            Task loadAddressesTask = new Task(() =>
            {
                AddressManager.LoadAllAddresses();
            });

            loadAddressesTask.Start();
            //Task initialLoad = new Task(() =>
            //{
            ItemManager.LoadItems();

            ItemManager.LoadTotalOrders();
            MenuManager.ReadMenuFile();
            try
            {
                UserSettings.ReadSettingsFile();
            }
            catch
            {
                UserSettings.WriteSettingsFile();
            }
            //});
            //initialLoad.Start();
        }
Esempio n. 29
0
 protected override void OnStartup(StartupEventArgs e)
 {
     var ctx = ContextRegistry.GetContext();
     var model = ctx.GetObject("MainViewModel");
     var view = new Main {DataContext = model};
     view.Show();
 }
Esempio n. 30
0
        //private static bool IsSingleInstance()
        //{
        //    _mutex = new Mutex(false, "RelayMutex");
        //    GC.KeepAlive(_mutex);
        //    try
        //    {
        //        return _mutex.WaitOne(0, false);
        //    }
        //    catch (AbandonedMutexException)
        //    {
        //        _mutex.ReleaseMutex();
        //        return _mutex.WaitOne(0, false);
        //    }
        //}

        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            bool createdMutex;

            this.ShutdownMode = IsRelease == true ? ShutdownMode.OnExplicitShutdown : ShutdownMode.OnMainWindowClose;

            _mutex = new Mutex(true, "MyApplicationMutex", out createdMutex);

            GeckoWebBrowser.UseCustomPrompt();
            Xpcom.Initialize(System.AppDomain.CurrentDomain.BaseDirectory + "xulrunner");
            GeckoPreferences.Default["extensions.blocklist.enabled"] = false;
            RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;

            if (!createdMutex)
            {
                _mutex = null;
                MessageBox.Show("The application is already running.");
                Application.Current.Shutdown();
                return;
            }
            else
            {
                ;
            }

            base.OnStartup(e);
        }
Esempio n. 31
0
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            //SingleInstanceManager manager = new SingleInstanceManager();
            //manager.app = this;
            //manager.Run(new[] { "teste" });

            //try
            //{
            //    base.OnStartup(e);
            //    Process p = RunningInstance();
            //    if (p == null)
            //    {
            //        Window main = new MainWindow();
            //        main.Show();
            //    }
            //    else
            //    {
            //        new function.window.WindowControl().ActivateWindow(p, "Like360Main");
            //        this.Shutdown();
            //    }
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(App.Current.MainWindow as MainWindow, ex.Message, "系统错误", MessageBoxButton.OK, MessageBoxImage.Error);
            //    App.Current.Shutdown();
            //}
        }
Esempio n. 32
0
 protected override void OnStartup(System.Windows.StartupEventArgs e)
 {
     if (e.Args.Length > 0)
     {
         // todo add command line argument handling, when necessary
     }
 }
Esempio n. 33
0
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            base.OnStartup(sender, e);

            Application.DispatcherUnhandledException += (s, ex) => LogError(ex.Exception);

            Environment.CurrentDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);

            Accent accent = ThemeManager.DefaultAccents.First(a => a.Name == UserSettings.Appearance.AccentColor);
            ThemeManager.ChangeTheme(Application.MainWindow, accent, UserSettings.Appearance.Theme);

            IShell shell = Container.GetExportedValue<IShell>();
            UserSettings.Shell = shell;
            ISystemSettings settings = Container.GetExportedValue<ISystemSettings>();
            int storedActiveIndex = settings.ActiveTabIndex;

            if (UserSettings.Application.RememberOpenFiles)
                settings.OpenFiles.Apply(shell.FileNames.Add);

            if (e.Args.Length > 0)
            {
                var newFiles = e.Args.Except(shell.FileNames).ToList();
                newFiles.Apply(shell.FileNames.Add);
                shell.ActiveTabIndex = shell.FileNames.IndexOf(e.Args.Last());
            }
            else
            {
                shell.ActiveTabIndex = storedActiveIndex;
            }
        }
Esempio n. 34
0
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            base.OnStartup(sender, e);

            Application.MainWindow.SizeToContent = SizeToContent.Manual;
            Application.MainWindow.WindowState   = WindowState.Maximized;
        }
Esempio n. 35
0
        protected override void OnStartup(StartupEventArgs e)
        {
            this.DispatcherUnhandledException += ErrorReporting.DispatcherUnhandledException;

            base.OnStartup(e);

            //for install plugin command when wox didn't start up
            //we shouldn't init MainWindow, just intall plugin and exit.
            if (e.Args.Length > 0 && e.Args[0].ToLower() == "installplugin")
            {
                var path = e.Args[1];
                if (!File.Exists(path))
                {
                    MessageBox.Show("Plugin " + path + " didn't exist");
                    return;
                }
                PluginInstaller.Install(path);
                Environment.Exit(0);
                return;
            }

            if (e.Args.Length > 0 && e.Args[0].ToLower() == "plugindebugger")
            {
                var path = e.Args[1];
                PluginLoader.Plugins.ActivatePluginDebugger(path);
            }

            window = new MainWindow();
            if (e.Args.Length == 0 || e.Args[0].ToLower() != "hidestart")
            {
                window.ShowApp();
            }

            window.ParseArgs(e.Args);
        }
Esempio n. 36
0
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            base.OnStartup(e);

            // Retrieve the current jump list.
            JumpList jumpList = new JumpList();

            JumpList.SetJumpList(Application.Current, jumpList);

            // Add a new JumpPath for an application task.
            JumpTask jumpTask = new JumpTask();

            jumpTask.CustomCategory   = "Tasks";
            jumpTask.Title            = "Do Something";
            jumpTask.ApplicationPath  = Assembly.GetExecutingAssembly().Location;
            jumpTask.IconResourcePath = jumpTask.ApplicationPath;
            jumpTask.Arguments        = "@#StartOrder";
            jumpList.JumpItems.Add(jumpTask);

            // Update the jump list.
            jumpList.Apply();

            // Load the main window.
            Window1 win = new Window1();

            win.Show();
        }
Esempio n. 37
0
        private void HandleApplicationStartup(object sender, StartupEventArgs e)
        {
            var orderSystemDashboardView = new OrderSystemDashboardView();

            Application.Current.MainWindow = orderSystemDashboardView;
            Application.Current.MainWindow.Show();
        }
Esempio n. 38
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var bootstrapper = new Bootstrapper();
            bootstrapper.Run();
        }
Esempio n. 39
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            mw = new MainWindow();
            mw.Show();

            KListener.KeyDown += new RawKeyEventHandler(KListener_KeyDown);
        }
Esempio n. 40
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     
     this.ShutdownMode = ShutdownMode.OnExplicitShutdown;
     component = new NotifyIconWrapper();            
 }
Esempio n. 41
0
        void App_Startup(object sender, StartupEventArgs e)
        {
            // Before initializing the ArcGIS Runtime first 
            // set the ArcGIS Runtime license by providing the license string 
            // obtained from the License Viewer tool.
            //ArcGISRuntime.SetLicense("Place the License String in here");

            // Initialize the ArcGIS Runtime before any components are created.
            try
            {
                string exeLocation = Assembly.GetExecutingAssembly().Location;
                string exePath = System.IO.Path.GetDirectoryName(exeLocation);
                DirectoryInfo di = System.IO.Directory.GetParent(exePath);
                string rootPath = di.FullName;
                string dataPath = rootPath + "\\Data";
                string tilePath = dataPath + "\\TPKs";
                Runtime.rootPath = rootPath;
                Runtime.dataPath = dataPath;
                Runtime.tilePath = tilePath;

                //ArcGISRuntime.Initialize();
                Runtime.initializeEngines(_graphicEngine, _geometryEngine);
                Globals.application = this;
                Globals.mainthreadID = Thread.CurrentThread.ManagedThreadId;
                //test();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());

                // Exit application
                this.Shutdown();
            }
        }
Esempio n. 42
0
 private void App_OnStartup(object sender, StartupEventArgs e)
 {
     var window = new MainWindow();
     window.DataContext = new MainViewModel();
     Application.Current.MainWindow = window;
     window.ShowDialog();
 }
Esempio n. 43
0
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            base.OnStartup(e);
            MainWindow mw = new MainWindow();

            mw.Show();
        }
Esempio n. 44
0
 protected override void OnStartup( StartupEventArgs args )
 {
     log4net.Config.XmlConfigurator.Configure();
     base.OnStartup( args );
     var bootstrapper = new MyBootstrapper();
     bootstrapper.Run();
 }
Esempio n. 45
0
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            base.OnStartup(e);

            SurfacePalette myPalette = new LightSurfacePalette();

            SurfaceColors.SetDefaultApplicationPalette(myPalette);
        }
Esempio n. 46
0
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            var errorsService = IoC.Get <IErrorsService>();

            errorsService.InstallGlobalExceptionHandler();

            DisplayRootViewFor <ShellViewModel>();
        }
Esempio n. 47
0
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            base.OnStartup(e);

            // Create and show the application's main window
            this.MainWindow = new MainWindow(e.Args);
            this.MainWindow.Show();
        }
Esempio n. 48
0
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            base.OnStartup(e);

#if RELEASE
            Current.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(Current_DispatcherUnhandledException);
#endif
        }
Esempio n. 49
0
        protected override async void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            base.OnStartup(sender, e);
            FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement),
                new FrameworkPropertyMetadata(System.Windows.Markup.XmlLanguage.GetLanguage(CultureInfo.CurrentUICulture.IetfLanguageTag)));

            if (this.IgnoreDisplay == false)
                await this.DisplayRootViewForAsync(this.Descriptor.ModelType).ConfigureAwait(false);
        }
Esempio n. 50
0
        private void Application_Startup(object sender, System.Windows.StartupEventArgs e)
        {
            if (e.Args.Length > 0)
            {
                RunInBackground = e.Args[0].Trim() == "/background";
            }

            Translation.Initialize();
        }
Esempio n. 51
0
        protected sealed override void OnStartup(System.Windows.StartupEventArgs e)
        {
            var compositionRoot = new CompositionRoot();

            MainWindow             = new MainWindow();
            MainWindow.DataContext = compositionRoot.Compose();
            MainWindow.Title       = "Layout Designer";
            MainWindow.Show();
        }
Esempio n. 52
0
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            base.OnStartup(e);

            // Create and show the application's main window
            //MainWindow window = new MainWindow();

            this.InitializeComponent();
        }
Esempio n. 53
0
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            //var proxy = IoC.Get<YmsClient>();

            //proxy.Start();



            DisplayRootViewFor <IShell>();
        }
        protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
        {
            base.OnStartup(sender, e);
            FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement),
                                                               new FrameworkPropertyMetadata(System.Windows.Markup.XmlLanguage.GetLanguage(CultureInfo.CurrentUICulture.IetfLanguageTag)));

            if (this.IgnoreDisplay == false)
            {
                this.DisplayRootViewFor <TRootModel>();
            }
        }
Esempio n. 55
0
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            base.OnStartup(e);
            System.Uri resourceLocater = new System.Uri("/AreaParty;component/app.xaml", System.UriKind.Relative);
            #line 1 "..\..\App.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);
            // Create and show the application's main window
            Window main = new MainWindow();

            main.Show();
        }
 protected override void OnStartup(object sender, System.Windows.StartupEventArgs e)
 {
     if (string.IsNullOrEmpty(GlobalData.ImpInvViewModel.BootMode) || GlobalData.ImpInvViewModel.BootMode.ToLower() == "crawl")
     {
         DisplayRootViewFor <IShell>();
     }
     else if (GlobalData.ImpInvViewModel.BootMode.ToLower() == "confirm")
     {
         DisplayRootViewFor <IConfirmShell>();
     }
 }
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            base.OnStartup(e);

            Process[] processcollection = Process.GetProcessesByName("系统可用性监控工具");
            if (processcollection.Length >= 2)
            {
                MessageBox.Show("应用程序已运行");
                Thread.Sleep(1000);
                System.Environment.Exit(1);
            }
        }
Esempio n. 58
0
        /// <summary>
        /// 程序启动
        /// </summary>
        /// <param name="e"></param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var main = new MainWindow();

            RemoveTrayIcon();
            AddTrayIcon();

            MainWindow = main;
            MainWindow.Hide();
        }
Esempio n. 59
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            MainWindow = new MainWindow();
            foreach (var arg in Args)
            {
                ((MainWindow)MainWindow).AddNewTab(arg);
            }
            MainWindow.Show();
            Shutdown();
        }
Esempio n. 60
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            window = new MainWindow();
            if (e.Args.Length == 0 || e.Args[0].ToLower() != "hidestart")
            {
                window.ShowApp();
            }

            window.ParseArgs(e.Args);
        }