private void documentService_DocumentClosed(object sender, DocumentEventArgs e) { if (e.Document.Is<DiagramDocument>()) { foreach (var circuitControl in _controls.ToArray()) { if (circuitControl.Key == e.Document) { UnregisterControl(circuitControl.Key, circuitControl.Value.First); } } } }
private void SkinEditor_SkinChanged(object sender, DocumentEventArgs e) { using (Stream stream = m_skinEditor.GetCurrentSkin()) { string skinFile = UnsavedSkinString; if (e.Document != null && e.Document.Uri != null) skinFile = e.Document.Uri.LocalPath; OpenSkinFile(stream, skinFile); if (ActiveSkin != null) { // Success! This means the editor is not shutting down and is still editing a valid skin. ApplyActiveSkin(); } else { // Either revert to the previous skin or reset to the original no-skin look. if (!OpenAndApplySkin(MruSkinFile)) ResetSkin(); } } }
private void documentService_DocumentOpened(object sender, DocumentEventArgs e) { if (m_liveConnectService != null) m_liveConnectService.Send("Timeline Editor opened: " + e.Document.Uri.OriginalString); }
private void documentService_DocumentSaved(object sender, DocumentEventArgs e) { if ( SourceControlService == null) return; if (RefreshStatusOnSave) SourceControlService.RefreshStatus(e.Document.Uri); if (e.Kind != DocumentEventType.SavedAs) return; if (SourceControlService.GetStatus(e.Document.Uri) == SourceControlStatus.NotControlled) { string message = string.Format("Add document {0} to version control?".Localize(), e.Document.Uri.AbsolutePath); DialogResult result = MessageBox.Show(GetDialogOwner(), message, "Add document to Version Control".Localize(), MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { SourceControlService.Add(e.Document.Uri); } } }
private void documentService_DocumentClosed(object sender, DocumentEventArgs e) { if (e.Document.Is<DomNode>()) { var docNode = e.Document.Cast<DomNode>(); docNode.AttributeChanged -= OnDocumentNodeAttributeChanged; docNode.ChildRemoved -= docNode_ChildRemoved; // close all subgraph controls in this document foreach (var circuitControl in m_circuitNodeControls.ToArray()) { if (circuitControl.Key.Lineage.Contains(docNode)) { UnregisterControl(circuitControl.Key, circuitControl.Value.First); } } } }
private void documentService_DocumentOpened(object sender, DocumentEventArgs e) { if (e.Document.Is<DomNode>()) { var docNode = e.Document.Cast<DomNode>(); docNode.AttributeChanged += OnDocumentNodeAttributeChanged; docNode.ChildRemoved += docNode_ChildRemoved; } }
private void documentService_DocumentOpened(object sender, DocumentEventArgs e) { }
protected virtual void OnSkinChanged() { var e = new DocumentEventArgs(m_activeDocument);// a null active document is OK SkinChanged.Raise(this, e); }
private void documentService_DocumentSaved(object sender, DocumentEventArgs e) { if (e.Kind != DocumentEventType.SavedAs || SourceControlService == null) return; if (SourceControlService.GetStatus(e.Document.Uri) == SourceControlStatus.NotControlled) { string message = "Add document ".Localize() + e.Document.Uri.AbsolutePath + " to version control?".Localize(); var result = MessageBoxes.Show(message, " Add document to Version Control".Localize(), MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { SourceControlService.Add(e.Document.Uri); } } }
private void documentService_DocumentSaved(object sender, DocumentEventArgs e) { if (e.Kind != DocumentEventType.SavedAs || SourceControlService == null) return; if (SourceControlService.GetStatus(e.Document.Uri) == SourceControlStatus.NotControlled) { string message = string.Format("Add document {0} to version control?".Localize(), e.Document.Uri.AbsolutePath); var result = MessageBoxes.Show(message, "Add Document to Version Control".Localize("this is the title of a dialog box that is asking a question"), MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { SourceControlService.Add(e.Document.Uri); } } }