Beispiel #1
0
        /// <summary>
        /// Startup override to handle command line arguments.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            if (e.Args.Any())
            {
                var configs = (from s in e.Args
                               let c = new Configuration()
                                       where c.LoadFromFile(s)
                                       select c).ToList();
                configs.ForEach(c => AshitaInject.DoInjection(c));
                Application.Current.Shutdown();
            }

            base.OnStartup(e);
        }
Beispiel #2
0
        /// <summary>
        /// Command handler when a config is being launched.
        /// </summary>
        private void LaunchClicked()
        {
            if (this.SelectedConfig == null)
            {
                return;
            }

            if (AshitaInject.DoInjection(this.SelectedConfig))
            {
                if (this.SelectedConfig.AutoClose)
                {
                    Application.Current.Shutdown();
                }
            }
        }