Example #1
0
 private void callback_DocumentToBeActivated(Object sender, DocumentCollectionEventArgs e)
 {
     try
     {
         EventsWatcher.documentActivated();
     }
     catch (System.Exception ex)
     {
         Helper.Message(ex);
     }
 }
Example #2
0
 private void callback_DocumentToBeDestroyed(Object sender, DocumentCollectionEventArgs e)
 {
     try
     {
         Document doc = e.Document;
         EventsWatcher.documentToBeDestroyed(ref doc);
     }
     catch (System.Exception ex)
     {
         Helper.Message(ex);
     }
 }
Example #3
0
        private static void callback_OnClick(Object o, EventArgs e)
        {
            try
            {
                EventsWatcher ewForm = new EventsWatcher();

                // The following does not work well. Actually worse, it will cause AutoCAD hang.
                // ewForm.ShowDialog(Autodesk.AutoCAD.ApplicationServices.Application.MainWindow);

                // We need to use the AutoCAD way to show it.
                Application.ShowModalDialog(Application.MainWindow, ewForm);
            }
            catch (System.Exception ex)
            {
                Helper.Message(ex);
            }
        }
Example #4
0
        private static void callback_OnClick(Object o, EventArgs e)
        {
            try
            {
                EventsWatcher ewForm = new EventsWatcher();

                // The following does not work well. Actually worse, it will cause AutoCAD hang.
                // ewForm.ShowDialog(Autodesk.AutoCAD.ApplicationServices.Application.MainWindow);

                // We need to use the AutoCAD way to show it.
                Application.ShowModalDialog(Application.MainWindow, ewForm);
            }
            catch (System.Exception ex)
            {
                Helper.Message(ex);
            }
        }