/// <summary> /// Lanza el evento de cambio de documento /// </summary> private void RaiseEventChangeDocument(DockLayoutDocument document) { if (document != null && (document.LayoutContent?.IsActive ?? false)) { ActiveDocumentChanged?.Invoke(this, EventArgs.Empty); } }
private void OnActiveWindowChanged(Window gotFocus, Window _) { if (!gotFocus.Kind.Equals("Document", StringComparison.OrdinalIgnoreCase)) { return; } IDocument document = null; var openWindowPath = System.IO.Path.Combine(gotFocus.Document.Path, gotFocus.Document.Name); if (_documents.TryGetValue(openWindowPath, out var documentPair)) { document = documentPair.Value; // if this document is opened for the first time, then it can be not a RadeonAsm document, but // the parser is initialized after visual buffer initialization, so // it is necessary to force initialize RadeonAsm document var vsTextBuffer = Utils.GetWindowVisualBuffer(gotFocus, _serviceProvider.ServiceProvider); if (vsTextBuffer != null) { var textBuffer = _serviceProvider.EditorAdaptersFactoryService.GetDocumentBuffer(vsTextBuffer); document = GetOrCreateDocument(textBuffer); } } ActiveDocumentChanged?.Invoke(document); }
private void ActiveDocumentPropertyChanged(object sender, PropertyChangedEventArgs e) { if (this.ActiveDocument.Value is MapEditorViewModel) { this.session.CurrentMap.Value = this.ActiveDocument.Value.GetContent() as Map; } ActiveDocumentChanged?.Invoke(this, EventArgs.Empty); }
public override void DeactivateItem(Document item, bool close) { ActiveDocumentChanging?.Invoke(item); base.DeactivateItem(item, close); ActiveDocumentChanged?.Invoke(item); }
public Form CreateMainForm <T>() where T : Form, new() { Form form = new T(); dockPanel = new DockPanel(); dockPanel.Dock = DockStyle.Fill; dockPanel.Theme = theme; form.Controls.Add(dockPanel); dockPanel.ActiveDocumentChanged += (sndr, args) => ActiveDocumentChanged.Fire(dockPanel.ActiveDocument); return(form); }
public int OnBeforeDocumentWindowShow(uint docCookie, int fFirstShow, IVsWindowFrame pFrame) { ThreadHelper.ThrowIfNotOnUIThread(); var activeDocument = GetActiveDocument(); if (activeDocument != _oldActiveDocument) { _oldActiveDocument = activeDocument; ActiveDocumentChanged?.Invoke(); } return(VSConstants.S_OK); }
public override void ActivateItem(Document item) { ActiveDocumentChanging?.Invoke(item); var lastItem = ActiveItem; base.ActivateItem(item); if (!ReferenceEquals(item, lastItem)) { ActiveDocumentChanged?.Invoke(item); } }
void OnDocumentChanged(object s, EventArgs a) { if (activeDocument == workbench.ActiveWorkbenchWindow?.Document) { return; } activeDocument = workbench.ActiveWorkbenchWindow?.Document; foreach (var doc in documents) { doc.UpdateContentVisibility(); } ActiveDocumentChanged?.Invoke(s, new DocumentEventArgs(activeDocument)); if (activeDocument != null) { activeDocument.LastTimeActive = DateTime.Now; activeDocument.GrabFocus(); } }
int IVsSelectionEvents.OnElementValueChanged(uint elementId, object oldValue, object newValue) { ThreadHelper.ThrowIfNotOnUIThread(); // Note: this notification can fire multiple times with different elementId value // when the doc frame changes. Two cases: // [ tool or doc window ] -> [ tool or doc window ] => elementId == SEID_WindowFrame // [ doc window ] -> [ doc window ] => elementId == SEID_DocumentFrame // We are only interested in the second case. See bugs #2079 and #2091. if (elementId == (uint)VSConstants.VSSELELEMID.SEID_DocumentFrame) { ITextDocument activeTextDoc = null; if (newValue != null && newValue is IVsWindowFrame frame) { activeTextDoc = textDocumentProvider.GetFromFrame(frame); } // The "active document" will be null if the last document has just been closed ActiveDocumentChanged?.Invoke(this, new ActiveDocumentChangedEventArgs(activeTextDoc)); } return(VSConstants.S_OK); }
private void DocumentRegistryActiveDocumentChanged(object sender, EventArgs e) { ActiveDocumentChanged.Raise(this, EventArgs.Empty); }
private void OnActiveDocumentChanged(DocumentId e) { ActiveDocumentChanged?.Invoke(this, e); }
/// <summary> /// Raises the <see cref="ActiveDocumentChanged"/> event. /// </summary> /// <param name="eventArgs"> /// <see cref="EventArgs"/> object that provides the arguments for the event. /// </param> ///// <remarks> ///// <strong>Notes to Inheritors:</strong> When overriding ///// <see cref="OnActiveDocumentChanged"/> in a derived class, be sure to call the base ///// class's <see cref="OnActiveDocumentChanged"/> method so that registered delegates ///// receive the event. ///// </remarks> private void OnActiveDocumentChanged(EventArgs eventArgs) { ActiveDocumentChanged?.Invoke(this, eventArgs); }
/// <summary> /// Lanza el evento de cambio de documento /// </summary> private void RaiseEventChangeDocument() { ActiveDocumentChanged?.Invoke(this, new LayoutDockingEventArgs(ActiveDocument)); }
public void SetActiveDocument(DocumentId?newActiveDocumentId) { _activeDocumentId = newActiveDocumentId; ActiveDocumentChanged?.Invoke(this, newActiveDocumentId); }
void MonoDevelop_Ide_IdeApp_Workbench_ActiveDocumentChanged(object sender, EventArgs e) { ActiveDocumentChanged?.Invoke(null, GetActiveDocument()); }
protected virtual void OnActiveDocumentChanged(ActiveDocumentChangedEventArgs e) { ActiveDocumentChanged?.Invoke(this, e); }
private void ActiveDockPropertyChanged(object sender, PropertyChangedEventArgs e) { ActiveDocumentChanged?.Invoke(this, EventArgs.Empty); }
void OnActiveDocumentChanged(object sender, EventArgs e) { ActiveDocumentChanged?.Invoke(this, GetActiveDocument()); }
void OnActiveDocumentChanged(object sender, Gui.DocumentEventArgs e) { ActiveDocumentChanged?.Invoke(this, TryGetActiveDocument()); activeDocument = e.Document; }
private void OnActiveDocumentChanged(TabControl tabControl) { ActiveDocumentChanged?.Invoke(this, new ActiveDocumentChangedEventArgs(this, tabControl)); }
private void documents_ActiveItemChanged(object sender, EventArgs e) { ActiveDocumentChanged.Raise(this, e); }
private void OnActiveDocumentChanged(ActiveDocumentChangedEventArgs e) { ActiveDocumentChanged?.Invoke(this, e); }