private static void DocumentManager_DocumentActivated(object sender, DocumentCollectionEventArgs e)
 {
     if (TOCPalette._ps != null && TOCPalette._showTOC)
     {
         TOCPalette._ps.Visible = (true);
     }
 }
예제 #2
0
        // When a document is created, add our handler to it

        void OnDocumentCreated(
            object sender, DocumentCollectionEventArgs e
            )
        {
            e.Document.ImpliedSelectionChanged +=
                new EventHandler(OnImpliedSelectionChanged);
        }
예제 #3
0
 void DocumentCreatedHandler(object sender, DocumentCollectionEventArgs e)
 {
     if (_thread != null)
     {
         _thread.Abort();
     }
 }
예제 #4
0
        /// <summary>
        ///     TODO
        /// </summary>
        /// <param name="senderObj"></param>
        /// <param name="docBegClsEvtArgs"></param>
        private static void BeginDocClose(object senderObj,
                                          DocumentCollectionEventArgs docBegClsEvtArgs)
        {
            try
            {
                // Get the current document
                var acDocMan = Application.DocumentManager;
                var acDoc    = acDocMan.MdiActiveDocument;

                if (acDoc == null)
                {
                    return;
                }
                acDoc.ImpliedSelectionChanged -= Doc_ImpliedSelectionChanged;

                //RCLEADER
                acDoc.CommandWillStart        -= RcLeader.rcLeader_CommandWillStart;
                acDoc.CommandEnded            -= RcLeader.rcLeader_CommandEnded;
                acDoc.CommandCancelled        -= RcLeader.rcLeader_CommandEnded;
                acDoc.CommandFailed           -= RcLeader.rcLeader_CommandEnded;
                acDoc.Database.ObjectModified -= RcLeader.rcLeader_ObjectModified;

                //AUTOLAYER
                acDoc.CommandWillStart -= RcAutoLayer.autoLayer_CommandWillStart;
                acDoc.CommandEnded     -= RcAutoLayer.autoLayer_CommandEnded;
                acDoc.CommandCancelled -= RcAutoLayer.autoLayer_CommandEnded;
                acDoc.CommandFailed    -= RcAutoLayer.autoLayer_CommandEnded;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);

                throw;
            }
        }
예제 #5
0
        private void documentActivated(object sender, DocumentCollectionEventArgs e)
        {
            PerDocData perDocDatum = null;

            if (!CMNApplication.mDocDataCollection.Contains(e.Document))
            {
                perDocDatum = new PerDocData(e.Document);
                CMNApplication.mDocDataCollection.Add(e.Document, perDocDatum);
            }
            else
            {
                perDocDatum = (PerDocData)CMNApplication.mDocDataCollection[e.Document];
            }
            if (CMNApplication.ESWCmn != null)
            {
                CMNApplication.ESWCmn.CmnControl.CurrentDocData = perDocDatum;
                CMNApplication.ESWCmn.CmnControl.RestoreFromCurrentData(true);
                if (Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Count == 1 && CMNApplication.ESWCmn.CmnControl.mbShouldRestore)
                {
                    CMNApplication.ESWCmn.ESW.Visible = true;
                    CMNApplication.ESWCmn.CmnControl.mbShouldRestore = false;
                }
            }
            W32Util.SetFocusToAcadMainFrame();
        }
 // Token: 0x06000426 RID: 1062 RVA: 0x0002807C File Offset: 0x0002627C
 private static void a(object A_0, DocumentCollectionEventArgs A_1)
 {
     try
     {
         if (!(A_1.Document == null))
         {
             using (A_1.Document.a())
             {
                 AvcPalette.a();
             }
             AvcPalette.b();
             if (AvcPalette.b)
             {
                 AvcPalette.b(A_1.Document);
             }
         }
     }
     catch (CancelException)
     {
         ah.c();
     }
     catch (WarningException ex)
     {
         ah.a(ex.Message);
     }
     catch (Exception a_)
     {
         ah.a(a_, "");
     }
 }
예제 #7
0
        // When a document is destroyed, remove our handler from it

        void OnDocumentToBeDestroyed(
            object sender, DocumentCollectionEventArgs e
            )
        {
            e.Document.ImpliedSelectionChanged -=
                new EventHandler(OnImpliedSelectionChanged);
        }
예제 #8
0
        /// <summary>обработчик смены активного документа</summary>
        private static void OnDocumentBecameCurrent(object sender, DocumentCollectionEventArgs e)
        {
            if (current_doc_var == e.Document)              /// обрабатывается событие только для вновь текущего документа
            /// нужно попробовать заменить на проверку
            /// dm.MdiActiveDocument == e.Document

            {
                return;
            }
            else
            {
                current_doc_var = e.Document;
            }


            if ((palette_window.links_control.lock_data_grid_trigger) ||
                (!palette_window.palette_set.Visible))
            {
                return;
            }

            if (no_handle_selection)
            {
                no_handle_selection = false;
                return;
            }

            HandleSelectedFDO(current_doc_var);
        }
예제 #9
0
 void appDocumentActivated(object sender, DocumentCollectionEventArgs e)
 {
     if (pallete != null)
     {
         pallete.InitDataList();
     }
 }
예제 #10
0
        private void OnDocumentBecameCurrent(object sender, DocumentCollectionEventArgs e)
        {
            // If the current document is not equal to this.Document, close the map clean panel.
            if (e.Document == Document)
            {
                if (_panelPreviousVisible != null && _panelPreviousVisible.Value)
                {
                    ShowMapCleanPanel(show: true, recordState: false);
                }

                if (_actionPalettePreviousVisible != null && _actionPalettePreviousVisible.Value)
                {
                    ShowActionPalette(show: true, recordState: false);
                }
            }
            else
            {
                // If the current document is equal to this.Document, show the map clean panel.
                if (AllPaletteSets.IsPaletteSetVisible(PaletteSetType.MapClean))
                {
                    _panelPreviousVisible = true;
                    ShowMapCleanPanel(show: false, recordState: false);
                }

                if (AllPaletteSets.IsPaletteSetVisible(PaletteSetType.ActionSequence))
                {
                    _actionPalettePreviousVisible = true;
                    ShowActionPalette(show: false, recordState: false);
                }
            }
        }
예제 #11
0
 private void OnDocumentToBeDeactivated(object sender, DocumentCollectionEventArgs e)
 {
     if (e.Document == Document)
     {
         _transientGraphicsMgr.ClearTransientGraphics();
     }
 }
예제 #12
0
        private void Docs_DocumentActivated(object sender, DocumentCollectionEventArgs e)
        {
            Ribbon.AddRibbon();
            var docs = AcadApp.DocumentManager;

            docs.DocumentActivated -= Docs_DocumentActivated;
        }
예제 #13
0
        /// <summary>
        /// 文档打开时的事件
        /// </summary>
        /// <param name="senderObj"></param>
        /// <param name="e"></param>
        static private void DocumentManager_DocumentCreated(object senderObj, DocumentCollectionEventArgs e)
        {
            if (!Project.CheckValiad())
            {
                return;
            }

            if (e.Document != null)
            {
                hideOldCol(e.Document);
                //初始化数据库
                Initialize.Database.Init(e.Document);
                //添加自定义实体的右键菜单
                Initialize.ContextMenu.Init();

                Initialize.ProjectTree.Init();

                Initialize.Controls.Init();
                //添加自定义cad数据库事件
                Events.DatabaseEvents DE = new DatabaseEvents();
                DE.AddEvent();
                //添加自定义cad交互事件
                Events.EditorEvents EE = new EditorEvents();
                EE.AddEvent();
            }
        }
예제 #14
0
 private static void DocumentCreated(object sender, DocumentCollectionEventArgs e)
 {
     if (e.Document != null)
     {
         DocumentDataObject.AddDocument(e.Document);
     }
 }
예제 #15
0
        private void callback_DocumentCreated(Object sender, DocumentCollectionEventArgs e)
        {
            DocumentCollection docs = (DocumentCollection)sender;
            Document           doc  = docs.MdiActiveDocument;

            docWatcher = new EM_DocumentEvents();
            docWatcher.addDoc(ref doc);
        }
예제 #16
0
 private void OnDocumentToBeDestroyed(object sender, DocumentCollectionEventArgs e)
 {
     // If the document is equal to this.Document, hide the map clean panel.
     if (e.Document == Document)
     {
         this.End();
     }
 }
예제 #17
0
        //Zeichnung aktiviert
        public void docColDocAct(object senderObj, DocumentCollectionEventArgs docColDocAcrEvtArgs)
        {
            myRegistry.regIO objRegIO   = new myRegistry.regIO();
            string           Basislayer = (string)objRegIO.readValue("blocks", "Basislayer");

            myAutoCAD.myLayer objLayer = myAutoCAD.myLayer.Instance;
            objLayer.refresh();
        }
 private static void Documents_DocumentCreated(object sender, DocumentCollectionEventArgs e)
 {
     if (e.Document != null)
     {
         e.Document.ImpliedSelectionChanged -= Document_ImpliedSelectionChanged;
         e.Document.ImpliedSelectionChanged += Document_ImpliedSelectionChanged;
     }
 }
예제 #19
0
 void DocumentManager_DocumentCreated(object sender, DocumentCollectionEventArgs e)
 {
     _initMainTab();
     if (!_ribbonTab.IsVisible)
     {
         _ribbonTab.IsVisible = true;
     }
     ComponentManager.Ribbon.UpdateLayout();
 }
예제 #20
0
 private void OnDocumentCreated(object sender, DocumentCollectionEventArgs e)
 {
     GetSettingsFromDocument();
     SetSettingsToDocument();
     if (CADProxy.DocumentManager.Count == 1 && Get.CADKitPalette.PaletteState)
     {
         Get.CADKitPalette.Visible = true;
     }
 }
예제 #21
0
        private void callback_DocumentActivated(Object sender, DocumentCollectionEventArgs e)
        {
            DocumentCollection docs = (DocumentCollection)sender;
            Document           doc  = docs.MdiActiveDocument;

            docWatcher = new EM_DocumentEvents();
            docWatcher.addDoc(ref doc);
            EM_Global.DrawingUnits = Base_Tools45.Misc.getCurrAnnoScale();
        }
예제 #22
0
        private void OnDocumentActivated(object sender, DocumentCollectionEventArgs e)
        {
            if (e.Document == null)
            {
                return;
            }

            Application.DocumentManager.DocumentActivated -= OnDocumentActivated;
            Execute(_command, e.Document);
        }
예제 #23
0
 private void DocumentManagerOnDocumentToBeDestroyed(object sender, DocumentCollectionEventArgs e)
 {
     if (_stores.ContainsKey(e.Document.Name))
     {
         _stores.Remove(e.Document.Name);
     }
     else
     {
         _logger.LogError("Document does not exist");
     }
 }
예제 #24
0
 private void DocumentManagerOnDocumentCreated(object sender, DocumentCollectionEventArgs e)
 {
     if (_stores.ContainsKey(e.Document.Name))
     {
         _logger.LogError("Document already exists");
     }
     else
     {
         CreateStoresOnDocument(e.Document);
     }
 }
        private void Application_DocumentActivated(object sender, DocumentCollectionEventArgs e)
        {
            // Triggered when a document window is activated. This will happen automatically if a document is newly created or opened.
            var appEvent = new ApplicationEvent()
            {
                Type        = ApplicationEvent.EventType.DocumentOpened,
                DynamicInfo = GetStreamsInFile()
            };

            NotifyUi(appEvent);
        }
예제 #26
0
 private void callback_DocumentToBeActivated(Object sender, DocumentCollectionEventArgs e)
 {
     try
     {
         EventsWatcher.documentActivated();
     }
     catch (System.Exception ex)
     {
         Helper.Message(ex);
     }
 }
예제 #27
0
 private void callback_DocumentActivated(Object sender, DocumentCollectionEventArgs e)
 {
     try
     {
         EventsWatcher.documentActivated();
     }
     catch (System.Exception ex)
     {
         Helper.Message(ex);
     }
 }
예제 #28
0
        public static void DcDocumentCreated(object sender, DocumentCollectionEventArgs e)
        {
            var doc = e.Document;

            if (!doc.IsReadOnly)
            {
                return;
            }

            doc.SendStringToExecute("ReOpenDocReadOnly ", false, false, true);
        }
예제 #29
0
 static void OnDocumentBecameCurrent(object sender, DocumentCollectionEventArgs args)
 {
     if (args.Document != null)
     {
         var paletteSetTypes = new PaletteSetType[] { PaletteSetType.MapClean };
         AllPaletteSets.RestoreVisibility(paletteSetTypes, args.Document);
     }
     else
     {
         AllPaletteSets.ClosePalettes();
     }
 }
예제 #30
0
 private void docToBeDestroyed(object sender, DocumentCollectionEventArgs e)
 {
     if (CMNApplication.mDocDataCollection.Contains(e.Document))
     {
         CMNApplication.mDocDataCollection.Remove(e.Document);
     }
     if (CMNApplication.ESWCmn != null && CMNApplication.ESWCmn.ESW.Visible && Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Count == 1)
     {
         CMNApplication.ESWCmn.ESW.Visible = false;
         CMNApplication.ESWCmn.CmnControl.mbShouldRestore = true;
     }
 }
예제 #31
0
        private static void documentActivated(object sender, DocumentCollectionEventArgs e)
        {
            if (m_active != e.Document)
            {
                if (e.Document != null && DocumentActivated != null)
                {
                    DocumentActivated(sender, e);
                }

                m_active = e.Document;
            }
        }
        static void DocumentManager_DocumentBecameCurrent(object sender, DocumentCollectionEventArgs e)
        {
            // DocumentBecameCurrent event fires multiple times for a document switch, it fires first with the new document with isActive = true,
            // then fires with the old document with isActive false and then once again with the new document with isActive = true.
            // Hence we put this double check below of processing only if active and different from the document stored in memory.
            // The world outside the AutoCADManager will only see one event bubbled correctly.
            if (e.Document != null)
            {
                var isActive = e.Document.IsActive;
                if (isActive)
                {
                    var documentThatJustBecameCurrent = e.Document == null ? null : e.Document.Name;

                    if (!String.Equals(documentThatJustBecameCurrent, currentDocument)) //currentDocument is saved from last time around.
                    {
                        currentDocument = documentThatJustBecameCurrent;
                        DocumentChanged(sender, e);
                    }
                }
            }
        }
예제 #33
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);
     }
 }
예제 #34
0
 /// <summary>
 /// Refresh resource tree when active document is changed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void DocumentManager_DocumentActivated(object sender, DocumentCollectionEventArgs e)
 {
     ResourceExplorerPalette.Instance.ExplorerForm.ForceRefresh();
 }
예제 #35
0
 private void _dwgManager_DocumentActivated(object sender, DocumentCollectionEventArgs e)
 {
     try
     {
         if (_ps != null)
         {
             _ps.DocumentActivated();
         }
     }
     catch (System.Exception ex)
     {
         LufsGenplan.AcadApp.AcaEd.WriteMessage("\nERROR: Commands._dwgManager_DocumentActivated() " + ex + "\n");
     }
 }
예제 #36
0
 private void _dwgManager_DocumentCreated(object sender, DocumentCollectionEventArgs e)
 {
     try
     {
         //_logger.Log("DEBUG: created. CreatePaletteSet() . COUNT = " + Application.DocumentManager.Count, Microsoft.Practices.Prism.Logging.Category.Debug, Microsoft.Practices.Prism.Logging.Priority.Low);
         CreatePaletteSet(new ResultBuffer());
         _ps.DocumentCreated();
     }
     catch (System.Exception ex)
     {
         LufsGenplan.AcadApp.AcaEd.WriteMessage("\nERROR: Commands._dwgManager_DocumentCreated() " + ex + "\n");
     }
 }
예제 #37
0
 void DocColl_DocumentCreated(object sender, DocumentCollectionEventArgs e)
 {
     tr.AC_Doc = Application.DocumentManager.MdiActiveDocument;
     findandLink();
 }
예제 #38
0
 void appDocumentActivated(object sender, DocumentCollectionEventArgs e)
 {
   if(pallete != null)
     pallete.InitDataList();
 }    
예제 #39
0
 private void callback_DocumentToBeDestroyed(Object sender, DocumentCollectionEventArgs e)
 {
     try
     {
         if(e.Document != null && e.Document.Window != null)
             WriteLine(String.Format("DocumentToBeDestroyed - {0}", e.Document.Window.Text));
         else
             WriteLine(String.Format("DocumentToBeDestroyed"));
     }
     catch (System.Exception ex)
     {
         Helper.Message(ex);
     }
 }