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);
        }
예제 #2
0
파일: Program.cs 프로젝트: ssc1223/piCite
   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);
        }
예제 #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));
        }
예제 #6
0
파일: SilverASAP.cs 프로젝트: epi/asap
 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);
 }
예제 #8
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     this.RootVisual = new MainPage();
 }
예제 #9
0
 protected override void OnStartup(StartupEventArgs e)
 {
     //StaticConnectionString.Instance.ConnectionString =
     //    ConfigurationManager.ConnectionStrings["membershipConnectionString"].ConnectionString;
 }
예제 #10
0
        void AppStartup(object sender, StartupEventArgs args)
        {
            Window1 mainWindow = new Window1();

            mainWindow.Show();
        }
예제 #11
0
 private static void Application_Startup(object sender, StartupEventArgs e)
 {
     Logging.Info("---Application_Startup");
 }
예제 #12
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     var mw = new MainWindow();
     mw.ShowDialog();
 }
예제 #13
0
 protected override void OnStartup(StartupEventArgs e)
 {
     ContainerConfigurator.Kernel.Get <MainWindow>().ShowDialog();
 }
예제 #14
0
 protected override void OnStartup(StartupEventArgs e)
 {
     IocKernel.Initialize(new IocConfiguration());
     LogVersions();
     base.OnStartup(e);
 }
예제 #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);
        }
예제 #16
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     MainWindow = new MainWindow();
     MainWindow.Show();
 }
예제 #17
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     LoggingConfiguration.ConfigureLogging();
 }
예제 #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");
		}
예제 #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);
 }
예제 #20
0
        protected override void OnStartup(StartupEventArgs e)
        {
            CheckAlreadyRunning();

            base.OnStartup(e);
        }
예제 #21
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     LifecycleObserver.NotifyStartup(e.Args);
 }
예제 #22
0
파일: App.xaml.cs 프로젝트: ipud2/OWLib
 protected override void OnStartup(StartupEventArgs startupEventArgs)
 {
     SetDarkMode(Settings.Default.DarkMode);
 }
예제 #23
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            ParseInputs(e);

            ProcessInputs();
        }
예제 #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
 }
예제 #25
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     DispatcherHelper.UIDispatcher = Dispatcher;
     //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
 }
예제 #26
0
파일: App.xaml.cs 프로젝트: forki/Gallifrey
 protected override void OnStartup(StartupEventArgs e)
 {
     Modern.App.Run(InstanceType.Alpha, Resources);
 }
예제 #27
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
 }
예제 #28
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     string[] args = System.Environment.GetCommandLineArgs();
     string filePath = args[0];
 }
예제 #29
0
 private void App_Startup(object sender, StartupEventArgs e)
 {
     DispatcherHelper.Initialize();
 }
예제 #30
0
        protected override void OnStartup(object sender, StartupEventArgs e)
        {
            Application.ShutdownMode = ShutdownMode.OnMainWindowClose;

            DisplayRootViewFor <MainViewModel>();
        }
예제 #31
0
 protected virtual void OnStartupNextInstance(StartupEventArgs e)
 {
 }
예제 #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());
         }
     });
 }
예제 #33
0
파일: Embed.cs 프로젝트: xxjeng/nuxleus
 protected override void OnStartup(StartupEventArgs e) {
     base.OnStartup(e);
     CreateAndShowMainWindow();
 }
 public virtual void Invoke(object sender, StartupEventArgs e)
 {
 }
예제 #35
0
        protected override void OnStartup(StartupEventArgs e)
        {
            (Resources["IDEState"] as IDEState).LoadConfiguration();

            base.OnStartup(e);
        }
예제 #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);
		}
	}
예제 #37
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     AutoGeneratedBaseCollection();
     GetAllTopicFromSetting();
 }
예제 #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)
 {
 }
예제 #40
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            ObjectBase.Container = AutoFacLoader.Init();
        }
예제 #41
0
파일: App.xaml.cs 프로젝트: ewin66/tools
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
 }
예제 #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);
        }
예제 #43
0
		private void Application_Startup(object sender, StartupEventArgs e)
		{
			InitNavigationConfigurationInThisAssembly();
		}
예제 #44
0
 protected override void OnStartup(object sender, StartupEventArgs e)
 {
     DisplayRootViewFor <ShellViewModel>();
 }
예제 #45
0
		protected override void OnStartup(StartupEventArgs e)
		{
			InitNavigationConfigurationInThisAssembly();
			base.OnStartup(e);
		}
예제 #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>();
 }