コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: tumGER/Quasar
 /// <summary>
 /// Processes any incoming Modal Events
 /// </summary>
 /// <param name="meuh"></param>
 public void ProcessIncomingModalEvent(ModalEvent meuh)
 {
     if (meuh.EventName == "QuasarClose")
     {
         if (meuh.Action == "OK")
         {
             //Quits the app
             System.Environment.Exit(0);
         }
     }
 }
コード例 #2
0
ファイル: InstallManager.cs プロジェクト: tumGER/Quasar
        /// <summary>
        /// Moves the installation files to a new location
        /// </summary>
        /// <param name="newPath">New install folder path</param>
        public static void ChangeInstallLocation(string newPath)
        {
            string SourcePath = Properties.Settings.Default.DefaultDir;
            bool   proceed    = true;

            try
            {
                FileOperation.CheckCopyFolder(SourcePath + "\\Library", newPath + "\\Library");
                FileOperation.CheckCopyFolder(SourcePath + "\\Resources", newPath + "\\Resources");

                File.Copy(SourcePath + "\\Quasar.log", newPath + "\\Quasar.log", true);
            }
            catch (Exception e)
            {
                proceed = false;
            }

            if (proceed)
            {
                try
                {
                    Directory.Delete(SourcePath + "\\Library", true);
                }
                catch (Exception e)
                {
                    proceed = false;
                }
            }

            if (proceed)
            {
                Properties.Settings.Default.DefaultDir = newPath;
                Properties.Settings.Default.Save();
                ModalEvent Meuh = new ModalEvent()
                {
                    EventName = "MoveInstall",
                    Action    = "LoadOK",
                };

                EventSystem.Publish <ModalEvent>(Meuh);
            }
            else
            {
                ModalEvent Meuh = new ModalEvent()
                {
                    EventName = "MoveInstall",
                    Action    = "LoadKO",
                };

                EventSystem.Publish <ModalEvent>(Meuh);
            }
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: tumGER/Quasar
        /// <summary>
        /// Asks if the user really wants to quit Quasar while it's doing stuff
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AskQuitQuasar(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (MUVM.TabLocked)
            {
                e.Cancel = true;

                ModalEvent meuh = new ModalEvent()
                {
                    Action           = "Show",
                    EventName        = "QuasarClose",
                    Title            = "Are you sure you want to Exit ?",
                    Content          = "Quasar is currently active.\rExiting now will probably result in some errors later on",
                    OkButtonText     = "I'm sure",
                    CancelButtonText = "Nope",
                    Type             = ModalType.OkCancel
                };

                EventSystem.Publish <ModalEvent>(meuh);
            }
        }