private void SetRepairMode()
 {
     btnPlay.Dispatcher.BeginInvoke(new Action(delegate()
     {
         btnPlay.Background = Brushes.OrangeRed;
         btnPlay.Content    = "Update";
         launcherMode       = ELauncherMode.Repair;
     }));
 }
示例#2
0
        /// <summary>
        /// Sets the launcher mode and updates UI elements to match
        /// </summary>
        /// <param name="newMode">The new mode.</param>
        /// <param name="isInProgress">If set to <c>true</c>, the selected mode is in progress.</param>
        /// <exception cref="ArgumentOutOfRangeException">
        /// Will be thrown if the <see cref="ELauncherMode"/> passed to the function is not a valid value.
        /// </exception>
        private void SetLauncherMode(ELauncherMode newMode, bool isInProgress)
        {
            // Set the global launcher mode
            this.Mode = newMode;

            // Set the UI elements to match
            switch (newMode)
            {
            case ELauncherMode.Install:
            {
                if (isInProgress)
                {
                    this.MainButton.Sensitive = false;
                    this.MainButton.Label     = LocalizationCatalog.GetString("Installing...");
                }
                else
                {
                    this.MainButton.Sensitive = true;
                    this.MainButton.Label     = LocalizationCatalog.GetString("Install");
                }
                break;
            }

            case ELauncherMode.Update:
            {
                if (isInProgress)
                {
                    this.MainButton.Sensitive = false;
                    this.MainButton.Label     = LocalizationCatalog.GetString("Updating...");
                }
                else
                {
                    this.MainButton.Sensitive = true;
                    this.MainButton.Label     = LocalizationCatalog.GetString("Update");
                }
                break;
            }

            case ELauncherMode.Repair:
            {
                if (isInProgress)
                {
                    this.MainButton.Sensitive = false;
                    this.MainButton.Label     = LocalizationCatalog.GetString("Repairing...");
                }
                else
                {
                    this.MainButton.Sensitive = true;
                    this.MainButton.Label     = LocalizationCatalog.GetString("Repair");
                }
                break;
            }

            case ELauncherMode.Launch:
            {
                if (isInProgress)
                {
                    this.MainButton.Sensitive = false;
                    this.MainButton.Label     = LocalizationCatalog.GetString("Launching...");
                }
                else
                {
                    this.MainButton.Sensitive = true;
                    this.MainButton.Label     = LocalizationCatalog.GetString("Launch");
                }
                break;
            }

            case ELauncherMode.Inactive:
            {
                this.MenuRepairItem.Sensitive = false;

                this.MainButton.Sensitive = false;
                this.MainButton.Label     = LocalizationCatalog.GetString("Inactive");
                break;
            }

            default:
            {
                throw new ArgumentOutOfRangeException(nameof(newMode), "An invalid launcher mode was passed to SetLauncherMode.");
            }
            }

            if (isInProgress)
            {
                this.MenuRepairItem.Sensitive    = false;
                this.MenuReinstallItem.Sensitive = false;
            }
            else
            {
                this.MenuRepairItem.Sensitive    = true;
                this.MenuReinstallItem.Sensitive = true;
            }
        }
示例#3
0
        /// <summary>
        /// Sets the launcher mode and updates UI elements to match
        /// </summary>
        /// <param name="newMode">New mode.</param>
        /// <param name="bInProgress">If set to <c>true</c>, the selected mode is in progress.</param>
        private void SetLauncherMode(ELauncherMode newMode, bool bInProgress)
        {
            //set the global launcher mode
            Mode = newMode;

            //set the UI elements to match
            switch (newMode)
            {
            case ELauncherMode.Install:
            {
                if (bInProgress)
                {
                    PrimaryButton.Sensitive = false;
                    PrimaryButton.Label     = LocalizationCatalog.GetString("Installing...");
                }
                else
                {
                    PrimaryButton.Sensitive = true;
                    PrimaryButton.Label     = LocalizationCatalog.GetString("Install");
                }
                break;
            }

            case ELauncherMode.Update:
            {
                if (bInProgress)
                {
                    PrimaryButton.Sensitive = false;
                    PrimaryButton.Label     = LocalizationCatalog.GetString("Updating...");
                }
                else
                {
                    PrimaryButton.Sensitive = true;
                    PrimaryButton.Label     = LocalizationCatalog.GetString("Update");
                }
                break;
            }

            case ELauncherMode.Repair:
            {
                if (bInProgress)
                {
                    PrimaryButton.Sensitive = false;
                    PrimaryButton.Label     = LocalizationCatalog.GetString("Repairing...");
                }
                else
                {
                    PrimaryButton.Sensitive = true;
                    PrimaryButton.Label     = LocalizationCatalog.GetString("Repair");
                }
                break;
            }

            case ELauncherMode.Launch:
            {
                if (bInProgress)
                {
                    PrimaryButton.Sensitive = false;
                    PrimaryButton.Label     = LocalizationCatalog.GetString("Launching...");
                }
                else
                {
                    PrimaryButton.Sensitive = true;
                    PrimaryButton.Label     = LocalizationCatalog.GetString("Launch");
                }
                break;
            }

            case ELauncherMode.Inactive:
            {
                PrimaryButton.Sensitive = false;
                PrimaryButton.Label     = LocalizationCatalog.GetString("Inactive");
                break;
            }

            default:
            {
                throw new ArgumentOutOfRangeException("newMode", "Invalid mode was passed to SetLauncherMode");
            }
            }
        }
示例#4
0
        /// <summary>
        /// Sets the launcher mode and updates UI elements to match
        /// </summary>
        /// <param name="newMode">New mode.</param>
        /// <param name="bInProgress">If set to <c>true</c>, the selected mode is in progress.</param>
        private void SetLauncherMode(ELauncherMode newMode, bool bInProgress)
        {
            //set the global launcher mode
            Mode = newMode;

            //set the UI elements to match
            switch (newMode)
            {
            case ELauncherMode.Install:
            {
                if (bInProgress)
                {
                    PrimaryButton.Enabled = false;
                    PrimaryButton.Text    = LocalizationCatalog.GetString("installingLabel");
                }
                else
                {
                    PrimaryButton.Enabled = true;
                    PrimaryButton.Text    = LocalizationCatalog.GetString("installLabel");
                }
                break;
            }

            case ELauncherMode.Update:
            {
                if (bInProgress)
                {
                    PrimaryButton.Enabled = false;
                    PrimaryButton.Text    = LocalizationCatalog.GetString("updatingLabel");
                }
                else
                {
                    PrimaryButton.Enabled = true;
                    PrimaryButton.Text    = LocalizationCatalog.GetString("updateLabel");
                }
                break;
            }

            case ELauncherMode.Repair:
            {
                if (bInProgress)
                {
                    PrimaryButton.Enabled = false;
                    PrimaryButton.Text    = LocalizationCatalog.GetString("repairingLabel");
                }
                else
                {
                    PrimaryButton.Enabled = true;
                    PrimaryButton.Text    = LocalizationCatalog.GetString("repairLabel");
                }
                break;
            }

            case ELauncherMode.Launch:
            {
                if (bInProgress)
                {
                    PrimaryButton.Enabled = false;
                    PrimaryButton.Text    = LocalizationCatalog.GetString("launchingLabel");
                }
                else
                {
                    PrimaryButton.Enabled = true;
                    PrimaryButton.Text    = LocalizationCatalog.GetString("launchLabel");
                }
                break;
            }

            default:
            {
                throw new ArgumentOutOfRangeException("Invalid mode was passed to SetLauncherMode");
            }
            }
        }
示例#5
0
        /// <summary>
        /// Sets the launcher mode and updates UI elements to match
        /// </summary>
        /// <param name="newMode">New mode.</param>
        /// <param name="bInProgress">If set to <c>true</c>, the selected mode is in progress.</param>
        private void SetLauncherMode(ELauncherMode newMode, bool bInProgress)
        {
            //set the global launcher mode
            Mode = newMode;

            //set the UI elements to match
            switch (newMode)
            {
                case ELauncherMode.Install:
                    {
                        if (bInProgress)
                        {
                            PrimaryButton.Enabled = false;
                            PrimaryButton.Text = LocalizationCatalog.GetString("installingLabel");
                        }
                        else
                        {
                            PrimaryButton.Enabled = true;
                            PrimaryButton.Text = LocalizationCatalog.GetString("installLabel");
                        }
                        break;
                    }
                case ELauncherMode.Update:
                    {
                        if (bInProgress)
                        {
                            PrimaryButton.Enabled = false;
                            PrimaryButton.Text = LocalizationCatalog.GetString("updatingLabel");
                        }
                        else
                        {
                            PrimaryButton.Enabled = true;
                            PrimaryButton.Text = LocalizationCatalog.GetString("updateLabel");
                        }
                        break;
                    }
                case ELauncherMode.Repair:
                    {
                        if (bInProgress)
                        {
                            PrimaryButton.Enabled = false;
                            PrimaryButton.Text = LocalizationCatalog.GetString("repairingLabel");
                        }
                        else
                        {
                            PrimaryButton.Enabled = true;
                            PrimaryButton.Text = LocalizationCatalog.GetString("repairLabel");
                        }
                        break;
                    }
                case ELauncherMode.Launch:
                    {
                        if (bInProgress)
                        {
                            PrimaryButton.Enabled = false;
                            PrimaryButton.Text = LocalizationCatalog.GetString("launchingLabel");
                        }
                        else
                        {
                            PrimaryButton.Enabled = true;
                            PrimaryButton.Text = LocalizationCatalog.GetString("launchLabel");
                        }
                        break;
                    }
                default:
                    {
                        throw new ArgumentOutOfRangeException("Invalid mode was passed to SetLauncherMode");
                    }
            }
        }
示例#6
0
        /// <summary>
        /// Sets the launcher mode and updates UI elements to match
        /// </summary>
        /// <param name="newMode">New mode.</param>
        /// <param name="bInProgress">If set to <c>true</c>, the selected mode is in progress.</param>
        private void SetLauncherMode(ELauncherMode newMode, bool bInProgress)
        {
            //set the global launcher mode
            Mode = newMode;

            //set the UI elements to match
            switch (newMode)
            {
                case ELauncherMode.Install:
                {
                    if (bInProgress)
                    {
                        PrimaryButton.Sensitive = false;
                        PrimaryButton.Label = Mono.Unix.Catalog.GetString("Installing...");
                    }
                    else
                    {
                        PrimaryButton.Sensitive = true;
                        PrimaryButton.Label = Mono.Unix.Catalog.GetString("Install");
                    }
                    break;
                }
                case ELauncherMode.Update:
                {
                    if (bInProgress)
                    {
                        PrimaryButton.Sensitive = false;
                        PrimaryButton.Label = Mono.Unix.Catalog.GetString("Updating...");
                    }
                    else
                    {
                        PrimaryButton.Sensitive = true;
                        PrimaryButton.Label = Mono.Unix.Catalog.GetString("Update");
                    }
                    break;
                }
                case ELauncherMode.Repair:
                {
                    if (bInProgress)
                    {
                        PrimaryButton.Sensitive = false;
                        PrimaryButton.Label = Mono.Unix.Catalog.GetString("Repairing...");
                    }
                    else
                    {
                        PrimaryButton.Sensitive = true;
                        PrimaryButton.Label = Mono.Unix.Catalog.GetString("Repair");
                    }
                    break;
                }
                case ELauncherMode.Launch:
                {
                    if (bInProgress)
                    {
                        PrimaryButton.Sensitive = false;
                        PrimaryButton.Label = Mono.Unix.Catalog.GetString("Launching...");
                    }
                    else
                    {
                        PrimaryButton.Sensitive = true;
                        PrimaryButton.Label = Mono.Unix.Catalog.GetString("Launch");
                    }
                    break;
                }
                default:
                {
                    throw new ArgumentOutOfRangeException ("newMode", "Invalid mode was passed to SetLauncherMode");
                }
            }
        }
 private void SetPlayMode()
 {
     btnPlay.Background = Brushes.Green;
     btnPlay.Content    = "Play";
     launcherMode       = ELauncherMode.Play;
 }
 private void SetInstallMode()
 {
     btnPlay.Background = Brushes.Yellow;
     btnPlay.Content    = "Install";
     launcherMode       = ELauncherMode.Install;
 }