protected override void OnClick()
 {
     if (Enabled)
     {
         try
         {
             using (var form = new TransectToolForm())
             {
                 form.ShowDialog();
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(GetType() + " encountered a problem.\n\n" + ex,
                             "Unhandled Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
 public ImportTransRndPntsForm(TransectToolForm form)
 {
     InitializeComponent();
     m_TransectToolForm = form;
     m_NPS = NPSGlobal.Instance;
 }
        /// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            NPSGlobal NPS;

            NPS = NPSGlobal.Instance;

            //make sure the NPS objects were all init okay
            if (string.IsNullOrEmpty(NPS.InitErrorMessage) == false)
            {
                System.Windows.Forms.MessageBox.Show(NPS.InitErrorMessage);
                return;
            }

            //show straightline form
            using (TransectToolForm form = new TransectToolForm())
            {
                form.ShowDialog();
            }
        }