Exemple #1
0
        private void RefreshButtons(Project.Project P, bool SelectDefault)
        {
            for (int i = 0; i < Scripts.Count; i++)
            {
                for(int j = 0; j < Scripts[i].Length; j++)
                {
                    Button B = Scripts[i][j];

                    B.Visible = false;
                    B.Text = "";
                    B.Tag = null;
                }
            }

            if (P == null) return;

            for (int i = 0; i < P.Scripts.Count; i++)
            {
                Project.Script S = P.Scripts[i];
                int Cat = S.Cathegory;
                if (Cat > 5) continue;

                if (cbVersion.SelectedIndex > 0)
                {
                    // Фильтр по версии
                    if ((S.Version.CompareTo("any") == 0) ||
                        (S.Version.CompareTo(cbVersion.SelectedItem as string) == 0))
                        AddScriptButton(Cat, S);
                }
                else
                {
                    if(!S.Old)
                        AddScriptButton(Cat, S);
                }

                if (SelectDefault)
                {
                    if (S.DefaultScript)
                    {
                        CurrentScript = S;
                        RefreshSteps(S);
                    }
                }
            }
        }
Exemple #2
0
        private void bScript_Click(object sender, EventArgs e)
        {
            Button B = sender as Button;
            if (B.Tag == null) return;

            CurrentScript = B.Tag as Project.Script;
            RefreshSteps(CurrentScript);
            RefreshButtonColor();

            if (CurrentScript.Autorun) bStart.PerformClick();
        }