예제 #1
0
        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 _);
        }
예제 #2
0
 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?"
             )
         );
 }
예제 #3
0
        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 _);
            }
        }