Example #1
0
 private void btnAddWaypoint_Click(object sender, EventArgs e)
 {
     try
     {
         bool lastTopMost = this.TopMost;
         this.TopMost = false;
         string node = "";
         if (CavebotTree.SelectedNode != null)
         {
             lastNode = CavebotTree.SelectedNode;
             node     = CavebotTree.SelectedNode.ToString();
         }
         else
         {
             if (lastNode != null)
             {
                 node = lastNode.ToString();
             }
         }
         FrmWaypoint frmWaypoint = new FrmWaypoint(false, node);
         frmWaypoint.ShowDialog();
         UpdateCavebotTree();
         this.TopMost = lastTopMost;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error: btnAddWaypoint: " + ex.Message);
     }
 }
Example #2
0
 private void btnEditWaypoint_Click(object sender, EventArgs e)
 {
     try
     {
         if (CavebotTree.SelectedNode != null)
         {
             lastNode = CavebotTree.SelectedNode;
             bool lastTopMost = this.TopMost;
             this.TopMost = false;
             FrmWaypoint frmWaypoint = new FrmWaypoint(true, CavebotTree.SelectedNode.ToString());
             frmWaypoint.ShowDialog();
             UpdateCavebotTree();
             this.TopMost = lastTopMost;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error: btnEditWaypoint: " + ex.Message);
     }
 }