private static void DocumentManager_DocumentActivated(object sender, DocumentCollectionEventArgs e) { if (TOCPalette._ps != null && TOCPalette._showTOC) { TOCPalette._ps.Visible = (true); } }
// When a document is created, add our handler to it void OnDocumentCreated( object sender, DocumentCollectionEventArgs e ) { e.Document.ImpliedSelectionChanged += new EventHandler(OnImpliedSelectionChanged); }
void DocumentCreatedHandler(object sender, DocumentCollectionEventArgs e) { if (_thread != null) { _thread.Abort(); } }
/// <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; } }
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_, ""); } }
// When a document is destroyed, remove our handler from it void OnDocumentToBeDestroyed( object sender, DocumentCollectionEventArgs e ) { e.Document.ImpliedSelectionChanged -= new EventHandler(OnImpliedSelectionChanged); }
/// <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); }
void appDocumentActivated(object sender, DocumentCollectionEventArgs e) { if (pallete != null) { pallete.InitDataList(); } }
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); } } }
private void OnDocumentToBeDeactivated(object sender, DocumentCollectionEventArgs e) { if (e.Document == Document) { _transientGraphicsMgr.ClearTransientGraphics(); } }
private void Docs_DocumentActivated(object sender, DocumentCollectionEventArgs e) { Ribbon.AddRibbon(); var docs = AcadApp.DocumentManager; docs.DocumentActivated -= Docs_DocumentActivated; }
/// <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(); } }
private static void DocumentCreated(object sender, DocumentCollectionEventArgs e) { if (e.Document != null) { DocumentDataObject.AddDocument(e.Document); } }
private void callback_DocumentCreated(Object sender, DocumentCollectionEventArgs e) { DocumentCollection docs = (DocumentCollection)sender; Document doc = docs.MdiActiveDocument; docWatcher = new EM_DocumentEvents(); docWatcher.addDoc(ref doc); }
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(); } }
//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; } }
void DocumentManager_DocumentCreated(object sender, DocumentCollectionEventArgs e) { _initMainTab(); if (!_ribbonTab.IsVisible) { _ribbonTab.IsVisible = true; } ComponentManager.Ribbon.UpdateLayout(); }
private void OnDocumentCreated(object sender, DocumentCollectionEventArgs e) { GetSettingsFromDocument(); SetSettingsToDocument(); if (CADProxy.DocumentManager.Count == 1 && Get.CADKitPalette.PaletteState) { Get.CADKitPalette.Visible = true; } }
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(); }
private void OnDocumentActivated(object sender, DocumentCollectionEventArgs e) { if (e.Document == null) { return; } Application.DocumentManager.DocumentActivated -= OnDocumentActivated; Execute(_command, e.Document); }
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"); } }
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); }
private void callback_DocumentToBeActivated(Object sender, DocumentCollectionEventArgs e) { try { EventsWatcher.documentActivated(); } catch (System.Exception ex) { Helper.Message(ex); } }
private void callback_DocumentActivated(Object sender, DocumentCollectionEventArgs e) { try { EventsWatcher.documentActivated(); } catch (System.Exception ex) { Helper.Message(ex); } }
public static void DcDocumentCreated(object sender, DocumentCollectionEventArgs e) { var doc = e.Document; if (!doc.IsReadOnly) { return; } doc.SendStringToExecute("ReOpenDocReadOnly ", false, false, true); }
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(); } }
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; } }
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); } } } }
private void callback_DocumentToBeDestroyed(Object sender, DocumentCollectionEventArgs e) { try { Document doc = e.Document; EventsWatcher.documentToBeDestroyed(ref doc); } catch (System.Exception ex) { Helper.Message(ex); } }
/// <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(); }
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"); } }
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"); } }
void DocColl_DocumentCreated(object sender, DocumentCollectionEventArgs e) { tr.AC_Doc = Application.DocumentManager.MdiActiveDocument; findandLink(); }
void appDocumentActivated(object sender, DocumentCollectionEventArgs e) { if(pallete != null) pallete.InitDataList(); }
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); } }