Exemple #1
0
        public bool EditMapItemUI()
        {
            MidiNoteMapItem item = Selected;

            if (item != null)
            {
                var dlg = new MapItemForm
                {
                    ItemName      = item.Name,
                    NoteInNumber  = item.NoteInNumber,
                    NoteOutNumber = item.NoteOutNumber
                };

                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    item.Name          = dlg.ItemName;
                    item.NoteInNumber  = (byte)dlg.NoteInNumber;
                    item.NoteOutNumber = (byte)dlg.NoteOutNumber;

                    Refresh(item);

                    return(true);
                }
            }

            return(false);
        }
Exemple #2
0
        public bool NewMapItemUI()
        {
            MapItemForm dlg = new MapItemForm();

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                AddMapItem(dlg.NoteInNumber, dlg.NoteOutNumber, dlg.ItemName);

                return(true);
            }

            return(false);
        }