// Should only see this event in view mode, otherwise the // edit button is hidden... private void editButton_Click(object sender, EventArgs e) { // Passing in a copy of the parms in case of cancel or failure so // we have a comparison and restore point reference... this.parmsActive.Copy(this.parmsMaster); using (ConfigureAlgorithm_Edit dlg = new ConfigureAlgorithm_Edit(this.reader, this.parmsActive)) { if (DialogResult.OK == dlg.ShowDialog( )) { Result result = this.parmsActive.store ( LakeChabotReader.MANAGED_ACCESS, this.reader.ReaderHandle ); if (Result.OK == result) { this.parmsMaster.Copy(this.parmsActive); this.setSource(this.parmsMaster); this.displayData( ); } else { // ERR MessageBox.Show ( "Reader Error.\n\nThe Reader was unable to configure the specified settings.\n\nThe follow error occurred: " + result.ToString( ), "Configure Algorithm Error", MessageBoxButtons.OK, MessageBoxIcon.Error ); } } dlg.Close( ); } }
// Should only see this event in view mode, otherwise the // edit button is hidden... private void editButton_Click( object sender, EventArgs e ) { // Passing in a copy of the parms in case of cancel or failure so // we have a comparison and restore point reference... this.parmsActive.Copy( this.parmsMaster ); using ( ConfigureAlgorithm_Edit dlg = new ConfigureAlgorithm_Edit( this.reader, this.parmsActive ) ) { if ( DialogResult.OK == dlg.ShowDialog( ) ) { Result result = this.parmsActive.store ( LakeChabotReader.MANAGED_ACCESS, this.reader.ReaderHandle ); if ( Result.OK == result ) { this.parmsMaster.Copy( this.parmsActive ); this.setSource( this.parmsMaster ); this.displayData( ); } else { // ERR MessageBox.Show ( "Reader Error.\n\nThe Reader was unable to configure the specified settings.\n\nThe follow error occurred: " + result.ToString( ), "Configure Algorithm Error", MessageBoxButtons.OK, MessageBoxIcon.Error ); } } dlg.Close( ); } }