Beispiel #1
0
        private void m_docs_DocumentActivated(object sender, DocumentCollectionEventArgs e)
        {
            Document doc = e.Document;

            try
            {
                EM_EventsWatcher.documentActivated(ref doc);
            }
            catch (System.Exception ex)
            {
                BaseObjs.writeDebug(ex.Message + " EM_DocManager.cs: line: 55");
            }
            try
            {
                if (gPalette != null)
                {
                    fGradeFloor = gPalette.pGradeFloor;
                }
                else
                {
                    BaseObjs.writeDebug("gPalette is null");
                }
                if (fGradeFloor == null)
                {
                    BaseObjs.writeDebug("fGradeFloor is null");
                }
                else
                {
                    fGradeFloor.Initialize_Form();
                }
            }
            catch (System.Exception ex)
            {
                BaseObjs.writeDebug(ex.Message + " EM_DocManager.cs: line: 78");
            }
            try
            {
                fGrading = gPalette.pGrading;
                fGrading.Initialize_Form();
            }
            catch (System.Exception ex)
            {
                BaseObjs.writeDebug(ex.Message + " EM_DocManager.cs: line: 87");
            }
        }
Beispiel #2
0
        public void Initialize()
        {
            try
            {
                log.Add("Initialize");
                activeDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
                activeDoc.Editor.WriteMessage("\nEventManager.dll Loaded");

                Autodesk.AutoCAD.ApplicationServices.Core.Application.SystemVariableChanged += callback_SystemVariableChanged;

                //EM_DocActivated.DocumentActivated += callBack_DocumentActivated;

                EM_ContextMenuExtensions.AddMe();
                if (BaseObjs.userName.ToUpper() == "JOHN")
                {
                    EM_ContextMenuExtensions.showOutput();
                }

                EM_EventsWatcher eventWatcher = new EM_EventsWatcher();

                log.Add("EM_Startup");

                gPalette.showPalettes(false);

                try
                {
                    Grading.Grading_CommandDefaults.initializeCommandDefaults();
                }
                catch (System.Exception ex)
                {
                    System.Windows.Forms.MessageBox.Show(ex.Message + "EM_Startup");
                }

                fGrading = gPalette.pGrading;
                fGrading.Initialize_Form();

                fGradeFloor = gPalette.pGradeFloor;
                fGradeFloor.Initialize_Form();
            }
            catch (System.Exception ex)
            {
                BaseObjs.writeDebug(ex.Message + " EM_Startup.cs: line: 77");
            }
        }