Exemplo n.º 1
0
        //Command Line Args
        private async void Arguments()
        {
            string[] args = Environment.GetCommandLineArgs();
            if (args.Contains("help"))
            {
                Hide();
                Help(null, null);
                Close();
            }
            if (args.Contains("update"))
            {
                Hide();
                bool updateAvailable = await InstallerHelper.CheckForUpdates(this, true);

                if (updateAvailable)
                {
                    Update(null, null);
                }
                else
                {
                    Close();
                }
            }
            if (args.Contains("troubleshooting"))
            {
                //Task.Delay for Open/Close Animations
                await Task.Delay(400);
                await ShowOkDialog(str.troubleshooting, str.troubleshootingTips);

                await Task.Delay(200);

                Close();
            }
        }
Exemplo n.º 2
0
        //Save Changes Button
        private async void Save(object s, RoutedEventArgs e)
        {
            try {
                Cursor = Cursors.Wait;

                ConfigHelper.Save();

                //Restart for applied changes
                InstallerHelper.KillPipeShot(false);
                //If not Tray Service, do not start
                if (ConfigHelper.RunOnBoot)
                {
                    try {
                        InstallerHelper.StartPipeShot();
                    } catch {
                        await ErrorToast.ShowAsync(str.trayServiceNotRunning, TimeSpan.FromSeconds(3));
                    }
                }

                SuccessToast.Show(str.applied, TimeSpan.FromSeconds(2));

                BtnSave.IsEnabled = false;
            } catch {
                ErrorToast.Show(str.couldNotApply, TimeSpan.FromSeconds(3));
            }
            Cursor = Cursors.Arrow;
        }
Exemplo n.º 3
0
        //Constructor
        public MainWindow()
        {
            InitializeComponent();

            //Update Loading Indicator
            ShowProgressIndicator();
            SetProgressStatus(str.initializing);

            //Check for Commandline Arguments
            Arguments();

            //Create Documents\PipeShot Path
            if (!Directory.Exists(DocPath))
            {
                Directory.CreateDirectory(DocPath);
            }

            //Initialize Helpers
            Helper = new InstallerHelper(ErrorToast);
        }