示例#1
0
        private void RegisterMemoryListView1_DoubleClick(object sender, EventArgs e)
        {
            _listViewDoubleClickCount++;
            if (_listViewDoubleClickCount > 1)
            {
                _listViewDoubleClickCount = 0;
                return;
            }

            if (registerMemoryListView1.SelectedItems.Count != 1)
            {
                return;
            }

            if (registerMemoryListView1.SelectedItems[0].Text == "07")
            {
                return;
            }

            _registerContentChangeDialog = new RegisterContentChangeDialog(registerMemoryListView1.SelectedItems[0].Text,
                                                                           registerMemoryListView1.SelectedItems[0].SubItems[1].Text);
            var dialogResult = _registerContentChangeDialog.ShowDialog();

            if (dialogResult == DialogResult.OK)
            {
                _microController.WriteResultToRegisterWithGivenAddress((int)_registerContentChangeDialog.NewRegisterContent,
                                                                       Convert.ToInt32(registerMemoryListView1.SelectedItems[0].Text, 16));
            }
        }
示例#2
0
        private void WregTextBox_DoubleClick(object sender, EventArgs e)
        {
            if (_microController == null)
            {
                return;
            }

            _registerContentChangeDialog = new RegisterContentChangeDialog("W-Reg",
                                                                           wregTextBox.Text);
            var dialogResult = _registerContentChangeDialog.ShowDialog();

            if (dialogResult == DialogResult.OK)
            {
                _microController.ChangeWorkingRegisterContent((int)_registerContentChangeDialog.NewRegisterContent);
            }
        }