private void selectLens(string alias, string selectedLensName) { TabPage existingLensTabPage = ( editorPaneTC .TabPages.Cast <TabPage>() .FirstOrDefault( tp => lensTabTextToLensName(tp.Text) == selectedLensName ) ); if (existingLensTabPage != default(TabPage)) { editorPaneTC.SelectedTab = existingLensTabPage; return; } if ( !UserDialogUtils.obtainConfirmation( "Unrecognized LiveCam Lens Reference", $"Add Lens '{selectedLensName}' to LiveCam '{alias}'?" ) ) { return; } editorPaneTC.SelectedTab = addNewLensTabPage(selectedLensName); TryUpdateLiveCam(out _); }
private bool IsLosingChangesOkay() { if (initialKmlLiveCam.Equals(kmlLiveCam) && !textChanged) { return(true); } return( UserDialogUtils.obtainConfirmation( "Confirm Abandon Changes", "Changes will be lost.\nDo you wish to continue?" ) ); }
private void deleteBT_Click(object sender, EventArgs e) { TabPage currentLensTab = editorPaneTC.SelectedTab; if (currentLensTab == null) { return; } if ( UserDialogUtils.obtainConfirmation( "Confirm Deletion of Lens", $"Delete Lens '{currentLensTab.Text}'?", MessageBoxIcon.Warning ) ) { editorPaneTC.TabPages.Remove(currentLensTab); TryUpdateLiveCam(out _); } }