Пример #1
0
        private void AddBtn_Click(object sender, EventArgs e)
        {
            if (NoteMap == null)
            {
                return;
            }

            MapNoteDetails dlg = new MapNoteDetails
            {
                MapNoteItem = new MapNoteItem()
                {
                    KeyName           = "New Note Map",
                    TriggerNoteNumber = 64,
                    OutputNoteNumber  = 64
                }
            };

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                if (NoteMap.Contains(dlg.MapNoteItem.TriggerNoteNumber))
                {
                    NoteMap.Remove(NoteMap[dlg.MapNoteItem.TriggerNoteNumber]);
                }

                NoteMap.Add(dlg.MapNoteItem);
                FillList();
            }
        }
Пример #2
0
        private void EditBtn_Click(object sender, EventArgs e)
        {
            if (NoteMap == null)
            {
                return;
            }

            if (MapListVw.SelectedItems.Count > 0)
            {
                MapNoteDetails dlg = new MapNoteDetails
                {
                    MapNoteItem = (MapNoteItem)MapListVw.SelectedItems[0].Tag
                };

                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    FillList();
                }
            }
        }
Пример #3
0
        private void MapListVw_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (NoteMap == null)
            {
                return;
            }

            ListViewHitTestInfo hitInfo = MapListVw.HitTest(e.Location);

            if (hitInfo.Item != null)
            {
                hitInfo.Item.Selected = true;

                MapNoteDetails dlg = new MapNoteDetails
                {
                    MapNoteItem = (MapNoteItem)hitInfo.Item.Tag
                };

                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    FillList();
                }
            }
        }