Exemple #1
0
        private void cbxPlatform_SelectionChangeCommitted(object sender, EventArgs e)
        {
            cbxGame.Items.Clear();
            cbxCategory.Items.Clear();
            cbxGame.SelectedItem     = null;
            cbxCategory.SelectedItem = null;

            switch (cbxPlatform.SelectedItem.ToString())
            {
            case "PBTracker": CurrentPlatform = PBTracker.Instance; break;

            case "AllSpeedRuns": CurrentPlatform = AllSpeedRuns.Instance; break;

            case "Splits.io": CurrentPlatform = SplitsIO.Instance; break;

            case "Ge.tt": CurrentPlatform = Gett.Instance; break;

            case "Twitter": CurrentPlatform = Twitter.Instance; break;

            case "Twitch": CurrentPlatform = Twitch.Instance; break;

            case "Congratsio": CurrentPlatform = Congratsio.Instance; break;

            case "Screenshot": CurrentPlatform = Screenshot.Instance; break;

            case "Imgur": CurrentPlatform = Imgur.Instance; break;

            case "Excel": CurrentPlatform = Excel.Instance; break;

            case "Speedrun.com": CurrentPlatform = SpeedrunComRunUploadPlatform.Instance; break;
            }

            CurrentPlatform.Settings = Settings;

            txtNotes.Enabled = btnInsertCategory.Enabled = btnInsertDeltaTime.Enabled = btnInsertGame.Enabled
                                                                                            = btnInsertPB.Enabled = btnInsertSplitName.Enabled = btnInsertSplitTime.Enabled
                                                                                                                                                     = btnInsertStreamLink.Enabled = btnInsertTitle.Enabled = btnPreview.Enabled =
                                                                                                                                                           ((CurrentPlatform == Twitter.Instance || CurrentPlatform == Twitch.Instance || CurrentPlatform == Imgur.Instance) |
                                                                                                                                                            (txtUser.Enabled = ((CurrentPlatform == Congratsio.Instance) | (txtPassword.Enabled =
                                                                                                                                                                                                                                txtVersion.Enabled = cbxCategory.Enabled = cbxGame.Enabled =
                                                                                                                                                                                                                                    (CurrentPlatform == PBTracker.Instance || CurrentPlatform == AllSpeedRuns.Instance)))));

            if (State.CurrentPhase == TimerPhase.NotRunning || State.CurrentPhase == TimerPhase.Ended)
            {
                chkAttachSplits.Enabled = !(CurrentPlatform == Screenshot.Instance || CurrentPlatform == SplitsIO.Instance ||
                                            CurrentPlatform == Twitch.Instance || CurrentPlatform == Excel.Instance || CurrentPlatform == SpeedrunComRunUploadPlatform.Instance);
            }
            else
            {
                chkAttachSplits.Enabled = false;
            }

            if (State.CurrentPhase == TimerPhase.Ended || State.CurrentPhase == TimerPhase.NotRunning ||
                State.CurrentSplitIndex == 0)
            {
                btnInsertDeltaTime.Enabled = btnInsertSplitName.Enabled = btnInsertSplitTime.Enabled = false;
            }

            if (Run.Last().PersonalBestSplitTime[State.CurrentTimingMethod] == null)
            {
                btnInsertPB.Enabled = false;
            }
            if (string.IsNullOrEmpty(Run.GameName))
            {
                btnInsertGame.Enabled = false;
            }
            if (string.IsNullOrEmpty(Run.CategoryName))
            {
                btnInsertCategory.Enabled = false;
            }
            if (string.IsNullOrEmpty(Run.GameName) && string.IsNullOrEmpty(Run.CategoryName))
            {
                btnInsertTitle.Enabled = false;
            }
            txtVideoURL.Enabled =
                CurrentPlatform == PBTracker.Instance ||
                CurrentPlatform == AllSpeedRuns.Instance ||
                CurrentPlatform == Congratsio.Instance;

            RefreshGameList();
            RefreshDescription();
            RefreshNotes();
        }
        private void cbxPlatform_SelectionChangeCommitted(object sender, EventArgs e)
        {
            cbxGame.Items.Clear();
            cbxCategory.Items.Clear();
            cbxGame.SelectedItem = null;
            cbxCategory.SelectedItem = null;

            switch (cbxPlatform.SelectedItem.ToString())
            {
                case "PBTracker": CurrentPlatform = PBTracker.Instance; break;
                case "AllSpeedRuns": CurrentPlatform = AllSpeedRuns.Instance; break;
                case "Splits.io": CurrentPlatform = SplitsIO.Instance; break;
                case "Ge.tt": CurrentPlatform = Gett.Instance; break;
                case "Twitter": CurrentPlatform = Twitter.Instance; break;
                case "Twitch": CurrentPlatform = Twitch.Instance; break;
                case "Congratsio": CurrentPlatform = Congratsio.Instance; break;
                case "Screenshot": CurrentPlatform = Screenshot.Instance; break;
                case "Imgur": CurrentPlatform = Imgur.Instance; break;
                case "Excel": CurrentPlatform = Excel.Instance; break;
                case "Speedrun.com": CurrentPlatform = SpeedrunComRunUploadPlatform.Instance; break;
            }

            CurrentPlatform.Settings = Settings;

            txtNotes.Enabled = btnInsertCategory.Enabled = btnInsertDeltaTime.Enabled = btnInsertGame.Enabled
                = btnInsertPB.Enabled = btnInsertSplitName.Enabled = btnInsertSplitTime.Enabled
                = btnInsertStreamLink.Enabled = btnInsertTitle.Enabled = btnPreview.Enabled =
                ((CurrentPlatform == Twitter.Instance || CurrentPlatform == Twitch.Instance || CurrentPlatform == Imgur.Instance) |
                (txtUser.Enabled = ((CurrentPlatform == Congratsio.Instance) | (txtPassword.Enabled =
                txtVersion.Enabled = cbxCategory.Enabled = cbxGame.Enabled = 
                (CurrentPlatform == PBTracker.Instance || CurrentPlatform == AllSpeedRuns.Instance)))));

            if (State.CurrentPhase == TimerPhase.NotRunning || State.CurrentPhase == TimerPhase.Ended)
                chkAttachSplits.Enabled = !(CurrentPlatform == Screenshot.Instance || CurrentPlatform == SplitsIO.Instance
                    || CurrentPlatform == Twitch.Instance || CurrentPlatform == Excel.Instance || CurrentPlatform == SpeedrunComRunUploadPlatform.Instance);
            else
                chkAttachSplits.Enabled = false;

            if (State.CurrentPhase == TimerPhase.Ended || State.CurrentPhase == TimerPhase.NotRunning
                || State.CurrentSplitIndex == 0)
            {
                btnInsertDeltaTime.Enabled = btnInsertSplitName.Enabled = btnInsertSplitTime.Enabled = false;
            }

            if (Run.Last().PersonalBestSplitTime[State.CurrentTimingMethod] == null)
                btnInsertPB.Enabled = false;
            if (string.IsNullOrEmpty(Run.GameName))
                btnInsertGame.Enabled = false;
            if (string.IsNullOrEmpty(Run.CategoryName))
                btnInsertCategory.Enabled = false;
            if (string.IsNullOrEmpty(Run.GameName) && string.IsNullOrEmpty(Run.CategoryName))
                btnInsertTitle.Enabled = false;
            txtVideoURL.Enabled = 
                CurrentPlatform == PBTracker.Instance 
                || CurrentPlatform == AllSpeedRuns.Instance 
                || CurrentPlatform == Congratsio.Instance;

            RefreshGameList();
            RefreshDescription();
            RefreshNotes();
        }