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);
        }
Example #2
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);
 }
Example #3
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);
        }
Example #4
1
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            CommandingBootstrapper bootstrapper = new CommandingBootstrapper();
            bootstrapper.Run();
        }
Example #5
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();
        }
Example #6
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);
        }
Example #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();

        }
Example #8
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();
        }
Example #9
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);
        }
Example #10
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) });
 }
Example #11
1
 private void App_OnStartup(object sender, StartupEventArgs e)
 {
     Updater.Run();
     ErrorSelectionWindow = new ErrorSelectionWindow();
     ErrorSelectionWindow.Show();
     ErrorSelectionWindow.Topmost = true;
 }
Example #12
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();
        }
Example #13
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);
        }
Example #14
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();
        }
Example #15
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();
            }
        }
Example #16
1
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     if (e.Args.Length > 0)
     {
         this.Properties["GamePath"] = e.Args[0];
     }
 }
Example #17
1
 void App_Startup(object sender, StartupEventArgs e)
 {
     Window = new MainWindow();
     SubscribeToWindowEvents();
     MainWindow = Window;
     Window.Show();
 }
Example #18
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);
            }
        }
        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);
        }
 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();
 }
Example #21
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();
			        });
		}
Example #22
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 */
            }
        }
Example #23
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var bootstrapper = new Bootstrapper();
            bootstrapper.Run();
        }
Example #24
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();
            }
        }
Example #25
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     
     this.ShutdownMode = ShutdownMode.OnExplicitShutdown;
     component = new NotifyIconWrapper();            
 }
Example #26
0
 private void App_OnStartup(object sender, StartupEventArgs e)
 {
     var window = new MainWindow();
     window.DataContext = new MainViewModel();
     Application.Current.MainWindow = window;
     window.ShowDialog();
 }
Example #27
0
 protected override void OnStartup( StartupEventArgs args )
 {
     log4net.Config.XmlConfigurator.Configure();
     base.OnStartup( args );
     var bootstrapper = new MyBootstrapper();
     bootstrapper.Run();
 }
Example #28
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            mw = new MainWindow();
            mw.Show();

            KListener.KeyDown += new RawKeyEventHandler(KListener_KeyDown);
        }
Example #29
0
        private void HandleApplicationStartup(object sender, StartupEventArgs e)
        {
            var orderSystemDashboardView = new OrderSystemDashboardView();

            Application.Current.MainWindow = orderSystemDashboardView;
            Application.Current.MainWindow.Show();
        }
Example #30
0
 protected override void OnStartup(StartupEventArgs e)
 {
     var ctx = ContextRegistry.GetContext();
     var model = ctx.GetObject("MainViewModel");
     var view = new Main {DataContext = model};
     view.Show();
 }