Ejemplo n.º 1
0
        private void EditorConfirmDeleteProject_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(DeleteProjectSelector.Text))
            {
                var toRemove = (from p in projects
                                where p.Item1 == DeleteProjectSelector.Text
                                select p).FirstOrDefault();
                projects.Remove(toRemove);

                EditorProjectSelector.Items.Clear();
                QuickProjectSelector.Items.Clear();
                DeleteProjectSelector.Items.Clear();
                for (int p = 0; p < projects.Count; p++)
                {
                    EditorProjectSelector.Items.Add(projects[p].Item1);
                    QuickProjectSelector.Items.Add(projects[p].Item1);
                    if (projects[p].Item1 != "No Project")
                    {
                        DeleteProjectSelector.Items.Add(projects[p].Item1);
                    }
                }

                EditorProjectSelector.SelectedIndex = EditorProjectSelector.FindStringExact("No Project");
                QuickProjectSelector.SelectedIndex  = QuickProjectSelector.FindStringExact("No Project");

                EditorCancelAddProject_Click(sender, e);
            }
        }
Ejemplo n.º 2
0
        private void EditorConfirmAddProject_Click(object sender, EventArgs e)
        {
            if (EditorNewProjectName.Text != "" && !EditorProjectSelector.Items.Contains(EditorNewProjectName.Text))
            {
                int projR = int.Parse(EditorNewProjectColorRGB_R.Value.ToString());
                int projG = int.Parse(EditorNewProjectColorRGB_G.Value.ToString());
                int projB = int.Parse(EditorNewProjectColorRGB_B.Value.ToString());
                Tuple <string, Color> newProject = new Tuple <string, Color>(EditorNewProjectName.Text, Color.FromArgb(projR, projG, projB));
                projects.Add(newProject);

                EditorProjectSelector.Items.Clear();
                QuickProjectSelector.Items.Clear();
                DeleteProjectSelector.Items.Clear();
                for (int p = 0; p < projects.Count; p++)
                {
                    EditorProjectSelector.Items.Add(projects[p].Item1);
                    QuickProjectSelector.Items.Add(projects[p].Item1);
                    if (projects[p].Item1 != "No Project")
                    {
                        DeleteProjectSelector.Items.Add(projects[p].Item1);
                    }
                }

                EditorProjectSelector.SelectedIndex = EditorProjectSelector.FindStringExact(EditorNewProjectName.Text);
                QuickProjectSelector.SelectedIndex  = QuickProjectSelector.FindStringExact(EditorNewProjectName.Text);

                EditorNewProjectName.Text        = "";
                EditorNewProjectColorRGB_R.Value = 0;
                EditorNewProjectColorRGB_G.Value = 0;
                EditorNewProjectColorRGB_B.Value = 0;


                EditorCancelAddProject_Click(sender, e);
            }
        }