Beispiel #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            int idx = 0;

            foreach (var p in PaletteManager.GetPaletteNames())
            {
                if (p.ToLower().StartsWith("palette"))
                {
                    string ns = p.Substring(7);
                    int    n;

                    if (int.TryParse(ns, out n))
                    {
                        idx = Math.Max(n, idx);
                    }
                }
            }

            if (InputWindow.Show("팔레트이름을 입력해주세요", $"Palette{idx + 1}") == DialogResult.OK)
            {
                string name = InputWindow.Result.Trim();

                if (name.Length > 0)
                {
                    if (!CheckPalette(name))
                    {
                        return;
                    }

                    AddPalette(name);
                }
            }
        }
Beispiel #2
0
        private void MRename_Click(object sender, EventArgs e)
        {
            if (InputWindow.Show("변경할 이름을 설정해주세요", selectedPaletteName) == DialogResult.OK)
            {
                string name = InputWindow.Result.Trim();

                if (!CheckPalette(name))
                {
                    return;
                }

                PaletteManager.RenamePalette(selectedPaletteName, name);
                lvPalette.Items[selectedPalette].Text = name;

                SavePaletteList();

                selectedPaletteName = name;
            }
        }