private void LoadEntryDetails() { NixMemoryEntry currentEntry = (NixMemoryEntry)SelectedEntry; if (currentEntry == null) { currentEntry = new NixMemoryEntry(); } sshConnectionDetails = currentEntry.SSHConnection; txtSSHConnection.Text = SSHConnectionDetails.FormatSSHConnection(sshConnectionDetails); cboLinuxMemoryType.SelectedIndex = (int)currentEntry.MemoryType; warningNumericUpDown.SaveValueSet((decimal)currentEntry.WarningValue); errorNumericUpDown.SaveValueSet((decimal)currentEntry.ErrorValue); }
private void cmdOK_Click(object sender, EventArgs e) { NixMemoryEntry selectedEntry; if (SelectedEntry == null) { SelectedEntry = new NixMemoryEntry(); } selectedEntry = (NixMemoryEntry)SelectedEntry; selectedEntry.MemoryType = (LinuxMemoryType)cboLinuxMemoryType.SelectedIndex; selectedEntry.SSHConnection = sshConnectionDetails; selectedEntry.WarningValue = (double)warningNumericUpDown.Value; selectedEntry.ErrorValue = (double)errorNumericUpDown.Value; DialogResult = System.Windows.Forms.DialogResult.OK; Close(); }