コード例 #1
0
 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);
             }
         }
     }
 }
コード例 #2
0
ファイル: SkinService.cs プロジェクト: sbambach/ATF
 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();
         }
     }
 }
コード例 #3
0
ファイル: TimelineEditor.cs プロジェクト: GeertVL/ATF
 private void documentService_DocumentOpened(object sender, DocumentEventArgs e)
 {
     if (m_liveConnectService != null)
         m_liveConnectService.Send("Timeline Editor opened: " + e.Document.Uri.OriginalString);
 }
コード例 #4
0
ファイル: SourceControlCommands.cs プロジェクト: sbambach/ATF
        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);
                }
            }

        }
コード例 #5
0
        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);
                    }
                }
            }
        }
コード例 #6
0
 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;
     }
 }
コード例 #7
0
 private void documentService_DocumentOpened(object sender, DocumentEventArgs e)
 {
 }
コード例 #8
0
ファイル: SkinEditor.cs プロジェクト: Joxx0r/ATF
 protected virtual void OnSkinChanged()
 {
     var e = new DocumentEventArgs(m_activeDocument);// a null active document is OK
     SkinChanged.Raise(this, e);
 }
コード例 #9
0
        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);
                }
            }
        }
コード例 #10
0
        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);
                }
            }
        }