protected override void OnStartup(StartupEventArgs e)
        {
            MainForm = _queuedTablatureFile != null ?
                new MainForm(_queuedTablatureFile, _queuedFileInfo) :
                new MainForm();

            MainForm.Visible = false;

            MainForm.Closed += (s, ev) => Stop();

            base.OnStartup(e);
        }
Esempio n. 2
0
   void Application_Startup(object sender,StartupEventArgs e)
   {
 for(int i = 0;i != e.Args.Length;++i)
 {
   if(e.Args[i].Split('=')[0].ToLower() == "/u")
   {
 string guid = e.Args[i].Split('=')[1];
 string path = Environment.GetFolderPath(Environment.SpecialFolder.System);
 ProcessStartInfo uninstallProcess = new ProcessStartInfo(path+"\\msiexec.exe","/x "+guid);
 Process.Start(uninstallProcess);
 System.Windows.Application.Current.Shutdown();
   }
 }
   }
        protected override void OnStartupNextInstance(StartupEventArgs e)
        {
            if (e.CommandLineArguments.Count > 0)
            {
                ProcessFirstArgForFile(e.CommandLineArguments[0]);

                if (_queuedTablatureFile != null)
                {
                    TablatureViewForm.GetInstance(MainForm).LoadTablature(_queuedTablatureFile, _queuedFileInfo);
                }
            }

            base.OnStartupNextInstance(e);
        }
Esempio n. 4
0
        protected override bool OnStartup(StartupEventArgs e)
        {
            app = new App();
            if (e.CommandLine != null && e.CommandLine.Count != 0)
            {
                if (System.IO.Directory.Exists(e.CommandLine[0]))
                {
                    app.SettingDirectory = e.CommandLine[0];
                }
            }
            app.InitializeComponent();
            app.Run();

            return false;
        }
        /// <summary>
        /// Is called once the application has started.
        /// </summary>
        /// <param name="e">The event arguments that contain more information about the application startup.</param>
        protected override async void OnStartup(StartupEventArgs e)
        {
            // Calls the base implementation of this method
            base.OnStartup(e);
            
            // Signs up for the unhandled exception event, which is raised when an exception was thrown, which was not handled by user-code
            AppDomain.CurrentDomain.UnhandledException += async (sender, eventArguments) => await this.OnUnhandledExceptionAsync(eventArguments);

            // Determines whether this application instance is the first instance of the application or whether another instance is already running (this can be used to force the application to be a single instance application)
            bool isFirstApplicationInstance;
            Mutex mutex = new Mutex(true, Assembly.GetExecutingAssembly().FullName, out isFirstApplicationInstance);

            // If this is the first instance of the application, the mutex is set and stored, so that it can be disposed of when this instance closes
            if (isFirstApplicationInstance)
                this.singleInstanceMutex = mutex;
            
            // Calls the on started method where the user is able to call his own code to set up the application
            await this.OnStartedAsync(new ApplicationStartedEventArgs(e.Args, isFirstApplicationInstance));
        }
Esempio n. 6
0
 void Application_Startup(object sender, StartupEventArgs e)
 {
     HtmlPage.RegisterScriptableObject("ASAP", this);
     string filename;
     if (e.InitParams.TryGetValue("file", out filename)) {
         string s;
         int song = -1;
         if (e.InitParams.TryGetValue("song", out s))
             song = int.Parse(s, CultureInfo.InvariantCulture);
         Play(filename, song);
     }
 }
 protected virtual void OnStartup(StartupEventArgs e)
 {
     _fileSystemWatcher.EnableRaisingEvents = false;
     WriteInstanceStatus(new InstanceStatus(Process.GetCurrentProcess().Id, e.CommandLineArguments));
     _fileSystemWatcher.EnableRaisingEvents = true;
     Application.Run(MainForm);
 }
Esempio n. 8
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     this.RootVisual = new MainPage();
 }
Esempio n. 9
0
 protected override void OnStartup(StartupEventArgs e)
 {
     //StaticConnectionString.Instance.ConnectionString =
     //    ConfigurationManager.ConnectionStrings["membershipConnectionString"].ConnectionString;
 }
Esempio n. 10
0
        void AppStartup(object sender, StartupEventArgs args)
        {
            Window1 mainWindow = new Window1();

            mainWindow.Show();
        }
Esempio n. 11
0
 private static void Application_Startup(object sender, StartupEventArgs e)
 {
     Logging.Info("---Application_Startup");
 }
Esempio n. 12
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     var mw = new MainWindow();
     mw.ShowDialog();
 }
Esempio n. 13
0
 protected override void OnStartup(StartupEventArgs e)
 {
     ContainerConfigurator.Kernel.Get <MainWindow>().ShowDialog();
 }
Esempio n. 14
0
 protected override void OnStartup(StartupEventArgs e)
 {
     IocKernel.Initialize(new IocConfiguration());
     LogVersions();
     base.OnStartup(e);
 }
Esempio n. 15
0
        protected override void OnStartup(StartupEventArgs e)
        {
            var key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v4.0", false);

            if (key == null) // || Util.Parse<int>(key.GetValue("ServicePackLevel")) < 2)
            {
                throw new Exception(Labels.AppRequiresSql);
            }

            key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Office");
            bool found = false;

            if (key != null)
            {
                string[] versions = key.GetSubKeyNames().Where(v => Util.Parse <double>(v) >= 10).ToArray();
                foreach (string v in versions)
                {
                    key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Office\" + v + @"\PowerPoint\InstallRoot", false);
                    if (key != null && !String.IsNullOrEmpty(key.GetValue("Path") as string))
                    {
                        found = true;
                    }
                }
            }

            if (!found)
            {
                key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Microsoft\Office");
                if (key == null)
                {
                    throw new Exception(Labels.AppRequiresOffice);
                }
                string[] versions = key.GetSubKeyNames().Where(v => Util.Parse <double>(v) >= 10).ToArray();
                foreach (string v in versions)
                {
                    key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Microsoft\Office\" + v + @"\PowerPoint\InstallRoot", false);
                    if (key != null && !String.IsNullOrEmpty(key.GetValue("Path") as string))
                    {
                        found = true;
                    }
                }
            }

            if (!found)
            {
                throw new Exception(Labels.AppRequiresOffice);
            }

            Config.FontSize = Util.Parse <double?>(ConfigurationManager.AppSettings["FontSize"]) ?? SystemFonts.MessageFontSize;

            base.OnStartup(e);

            //accessing database causes 3 or 4 sec delay so place in background thread, useful preloading for when planner is opened
            new Action(() =>
            {
                //determine if it's a new installation by whether there are any schedules loaded or not
                //if Presenter 0.9.9, will be running sql compact 3.5 that will need to be upgraded to 4.0
                bool isnew = true;
                try { isnew = !Schedule.LoadSchedules().Any(); }
                catch (Exception ex)
                {
                    if (ex.GetBaseException().Message == "The database file has been created by an earlier version of SQL Server Compact. Please upgrade using SqlCeEngine.Upgrade() method.")
                    {
                        var engine = new System.Data.SqlServerCe.SqlCeEngine(ConfigurationManager.ConnectionStrings["DatabaseConnectionString"].ConnectionString);
                        engine.Upgrade();
                        engine.Compact(null);
                        isnew = !Schedule.LoadSchedules().Any();
                    }
                    else
                    {
                        throw ex;
                    }
                }

                //gives warning that videos won't work without WMP10, not a requirement so only display if a new installation
                if (isnew)
                {
                    key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\MediaPlayer\PlayerUpgrade", false);
                    if (key == null || Util.Parse <int>((key.GetValue("PlayerVersion") ?? "").ToString().Split(',').FirstOrDefault()) < 10)
                    {
                        if (!Application.Current.Dispatcher.CheckAccess())
                        {
                            Application.Current.Dispatcher.Invoke(new Action(() => { MessageBox.Show(MainWindow, Labels.AppRequiresWMP, "", MessageBoxButton.OK, MessageBoxImage.Exclamation); }));
                        }
                    }
                }
            }).BeginInvoke(null, null);
        }
Esempio n. 16
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     MainWindow = new MainWindow();
     MainWindow.Show();
 }
Esempio n. 17
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     LoggingConfiguration.ConfigureLogging();
 }
Esempio n. 18
0
		private void App_Startup(object sender, StartupEventArgs e)
		{
			this.StartupUri = new Uri(@"pack://application:,,,/Microsoft.Expression.Prototyping.Runtime;Component/WPF/Workspace/PlayerWindow.xaml");
		}
Esempio n. 19
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     DispatcherHelper.UIDispatcher = Dispatcher;
     SQLiteQuery.SetConnectionString($"Data Source={this.SQLiteDbPath};");
     //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
 }
Esempio n. 20
0
        protected override void OnStartup(StartupEventArgs e)
        {
            CheckAlreadyRunning();

            base.OnStartup(e);
        }
Esempio n. 21
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     LifecycleObserver.NotifyStartup(e.Args);
 }
Esempio n. 22
0
 protected override void OnStartup(StartupEventArgs startupEventArgs)
 {
     SetDarkMode(Settings.Default.DarkMode);
 }
Esempio n. 23
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            ParseInputs(e);

            ProcessInputs();
        }
Esempio n. 24
0
 void App_Startup(object sender, StartupEventArgs e)
 {
     //Here if called from XAML, otherwise, this code can be in App()
     AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException; // Example 1
     AppDomain.CurrentDomain.UnhandledException   += CurrentDomain_UnhandledException;   // Example 3
 }
Esempio n. 25
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     DispatcherHelper.UIDispatcher = Dispatcher;
     //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
 }
Esempio n. 26
0
 protected override void OnStartup(StartupEventArgs e)
 {
     Modern.App.Run(InstanceType.Alpha, Resources);
 }
Esempio n. 27
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
 }
Esempio n. 28
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     string[] args = System.Environment.GetCommandLineArgs();
     string filePath = args[0];
 }
Esempio n. 29
0
 private void App_Startup(object sender, StartupEventArgs e)
 {
     DispatcherHelper.Initialize();
 }
Esempio n. 30
0
        protected override void OnStartup(object sender, StartupEventArgs e)
        {
            Application.ShutdownMode = ShutdownMode.OnMainWindowClose;

            DisplayRootViewFor <MainViewModel>();
        }
 protected virtual void OnStartupNextInstance(StartupEventArgs e)
 {
 }
Esempio n. 32
0
 private async void Application_Startup(object sender, StartupEventArgs e)
 {
     if (Config.local.showloadingscreen)
     {
         splash = new Views.SplashScreen();
         splash.Show();
         splash.BusyContent = "Loading main window";
     }
     AutomationHelper.syncContext = System.Threading.SynchronizationContext.Current;
     System.Threading.Thread.CurrentThread.Name = "UIThread";
     if (!Config.local.isagent)
     {
         if (!Config.local.showloadingscreen)
         {
             notifyIcon.Visible = true;
         }
     }
     else
     {
         notifyIcon.Visible = true;
     }
     if (Config.local.files_pending_deletion.Length > 0)
     {
         bool sucess = true;
         foreach (var f in Config.local.files_pending_deletion)
         {
             try
             {
                 if (System.IO.File.Exists(f))
                 {
                     System.IO.File.Delete(f);
                 }
             }
             catch (Exception ex)
             {
                 sucess = false;
                 Log.Error(ex.ToString());
             }
         }
         if (sucess)
         {
             Config.local.files_pending_deletion = new string[] { };
             Config.Save();
         }
     }
     RobotInstance.instance.Status += App_Status;
     Input.InputDriver.Instance.initCancelKey(Config.local.cancelkey);
     await Task.Run(async() =>
     {
         try
         {
             if (Config.local.showloadingscreen)
             {
                 splash.BusyContent = "loading plugins";
             }
             // Plugins.LoadPlugins(RobotInstance.instance, Interfaces.Extensions.ProjectsDirectory);
             Plugins.LoadPlugins(RobotInstance.instance, Interfaces.Extensions.PluginsDirectory, false);
             if (Config.local.showloadingscreen)
             {
                 splash.BusyContent = "Initialize main window";
             }
             await RobotInstance.instance.init();
         }
         catch (Exception ex)
         {
             Console.WriteLine(ex.ToString());
         }
     });
 }
Esempio n. 33
0
 protected override void OnStartup(StartupEventArgs e) {
     base.OnStartup(e);
     CreateAndShowMainWindow();
 }
 public virtual void Invoke(object sender, StartupEventArgs e)
 {
 }
Esempio n. 35
0
        protected override void OnStartup(StartupEventArgs e)
        {
            (Resources["IDEState"] as IDEState).LoadConfiguration();

            base.OnStartup(e);
        }
Esempio n. 36
0
	void Application_Startup(object sender, StartupEventArgs e)
	{
		this.RootVisual = this.MediaElement;
		this.MediaElement.Volume = 1;
		this.MediaElement.AutoPlay = true;
		this.MediaElement.MediaEnded += MediaElement_MediaEnded;
		HtmlPage.RegisterScriptableObject("ASAP", this);
		string filename;
		if (e.InitParams.TryGetValue("file", out filename)) {
			string s;
			int song = -1;
			if (e.InitParams.TryGetValue("song", out s))
				song = int.Parse(s, CultureInfo.InvariantCulture);
			Play(filename, song);
		}
	}
Esempio n. 37
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     AutoGeneratedBaseCollection();
     GetAllTopicFromSetting();
 }
Esempio n. 38
0
 protected override void OnStartup(StartupEventArgs e)
 {
     Arguments = e.Args;
     base.OnStartup(e);
 }
 // Methods
 public virtual System.IAsyncResult BeginInvoke(object sender, StartupEventArgs e, System.AsyncCallback DelegateCallback, object DelegateAsyncState)
 {
 }
Esempio n. 40
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            ObjectBase.Container = AutoFacLoader.Init();
        }
Esempio n. 41
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
 }
Esempio n. 42
0
        protected override void OnStartup(StartupEventArgs e)
        {
            List <Arg> args = ProcessArgs(e.Args);

            StartMinimized = args.Any(a => a.Type == ArgType.Minimized);

            _silent = args.Any(a => a.Type == ArgType.Silent);

            var arg = args.FirstOrDefault(a => a.Type == ArgType.Send);

            if (arg != null)
            {
                AttachConsole(-1);

                PrintHeader();

                string[] cmds = arg.Param.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);

                var sys = SbmqSystem.Create();
                try {
                    foreach (var cmd in cmds)
                    {
                        var itm = sys.SavedCommands.Items.FirstOrDefault(c => c.DisplayName == cmd);

                        if (itm != null)
                        {
                            Out(string.Format("Sending Command '{0}'...", cmd));
                            sys.SendCommand(itm.SentCommand.Server, itm.SentCommand.Queue, itm.SentCommand.Command);
                        }
                        else
                        {
                            Out(string.Format("No Command with name '{0}' found, exiting...", cmd));
                        }
                    }
                } finally {
                    sys.Manager.Terminate();
                }

                Application.Current.Shutdown(0);
                return;
            }

            if (args.Where(a => a.Type != ArgType.Minimized).Count() > 0)
            {
                AttachConsole(-1);
                PrintHeader();
                PrintHelp();

                Application.Current.Shutdown(0);
                return;
            }


            // Check if we are already running...
            Process currProc  = Process.GetCurrentProcess();
            Process existProc = Process.GetProcessesByName(currProc.ProcessName).Where(p => p.Id != currProc.Id).FirstOrDefault();

            if (existProc != null)
            {
                try {
                    // Show the already started SBMQM
                    WindowTools.EnumWindows(new WindowTools.EnumWindowsProc((hwnd, lparam) => {
                        uint procId;
                        WindowTools.GetWindowThreadProcessId(hwnd, out procId);
                        if (procId == existProc.Id)
                        {
                            if (WindowTools.SendMessage(hwnd, ServiceBusMQManager.MainWindow.WM_SHOWWINDOW, 0, 0) == 1)
                            {
                                return(false);
                            }
                        }
                        return(true);
                    }), 0);
                } finally {
                    Application.Current.Shutdown();
                }
                return;
            }


            base.OnStartup(e);
        }
Esempio n. 43
0
		private void Application_Startup(object sender, StartupEventArgs e)
		{
			InitNavigationConfigurationInThisAssembly();
		}
Esempio n. 44
0
 protected override void OnStartup(object sender, StartupEventArgs e)
 {
     DisplayRootViewFor <ShellViewModel>();
 }
Esempio n. 45
0
		protected override void OnStartup(StartupEventArgs e)
		{
			InitNavigationConfigurationInThisAssembly();
			base.OnStartup(e);
		}
Esempio n. 46
0
 /// <summary>
 /// Override this to add custom behavior to execute after the application starts.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The args.</param>
 protected override void OnStartup(Object sender, StartupEventArgs e)
 {
     DisplayRootViewFor <IShell>();
 }