private void Workspace_DocumentOpened(object sender, DocumentEventArgs e)
 {
     lock (_gate)
     {
         _openDocumentContexts.Add(e.Document.Id, Task.Run(() => GetConventionContextAsync(e.Document.FilePath, CancellationToken.None)));
     }
 }
		void HandleDocumentClosed (object sender, DocumentEventArgs e)
		{
			if (e.Document == null || e.Document.Editor == null || e.Document.Editor.Parent == null) return;

			e.Document.Editor.Parent.ButtonReleaseEvent -= HandleButtonReleaseEvent;
			e.Document.Editor.Parent.MotionNotifyEvent -= HandleMotionNotifyEvent;
		}
            private void OnDocumentActiveContextChanged(object sender, DocumentEventArgs e)
            {
                var document = SubjectBuffer.AsTextContainer().GetOpenDocumentInCurrentContext();

                if (document != null && document.Id == e.Document.Id)
                {
                    this.RaiseChanged();
                }
            }
 private void OnDocumentOpened(object sender, DocumentEventArgs e)
 {
     InvokeBelowInputPriority(() =>
     {
         if (!_isDisposed)
         {
             SetReadOnly(e.Document);
         }
     });
 }
 private void OnDocumentClosed(object sender, DocumentEventArgs e)
 {
     // The buffer is gone by now, so we don't need to remove the read-only region from it, just clean up our dictionary.
     InvokeBelowInputPriority(() =>
     {
         if (_readOnlyRegions != null)
         {
             _readOnlyRegions.Remove(e.Document.Id);
         }
     });
 }
        private void Workspace_DocumentClosed(object sender, DocumentEventArgs e)
        {
            lock (_gate)
            {
                if (_openDocumentContexts.TryGetValue(e.Document.Id, out var contextTask))
                {
                    _openDocumentContexts.Remove(e.Document.Id);

                    // Ensure we dispose the context, which we'll do asynchronously
                    contextTask.ContinueWith(
                        t => t.Result.Dispose(),
                        CancellationToken.None,
                        TaskContinuationOptions.OnlyOnRanToCompletion,
                        TaskScheduler.Default);
                }
            }
        }
Exemple #7
0
		void HandleDocumentOpened (object sender, DocumentEventArgs e)
		{
			if (!(e.Document.Project is DotNetProject) || !e.Document.IsFile)
				return;
			string ext = e.Document.FileName;
			if (!ext.EndsWith (".addin.xml") && !ext.EndsWith (".addin"))
				return;
			
			var data = AddinData.GetAddinData ((DotNetProject)e.Document.Project);
			if (data != null) {
				IWorkbenchWindow window = e.Document.Window;
				var adesc = data.AddinRegistry.ReadAddinManifestFile (e.Document.FileName);
				
				window.AttachViewContent (new ExtensionEditorView (adesc, data));
				window.AttachViewContent (new ExtensionPointsEditorView (adesc, data));
			}
			
		}
 void CANAPEProject_DocumentAdded(object sender, DocumentEventArgs e)
 {
     AddEntryToTree(e.Document);
 }
Exemple #9
0
 private void OnActiveContextChanged(object sender, DocumentEventArgs e)
 {
     // REVIEW: it would be nice for changed event to pass in both old and new document.
     OnSuggestedActionsChanged(e.Document.Project.Solution.Workspace, e.Document.Id, e.Document.Project.Solution.WorkspaceVersion);
 }
 private void events_DocumentClosing(DocumentEventArgs ea)
 {
     UpdateMarkerList();
 }
Exemple #11
0
 private void OnDocumentClosed(object sender, DocumentEventArgs e)
 {
     var asyncToken = _listener.BeginAsyncOperation("OnDocumentClosed");
     _eventProcessingQueue.ScheduleTask(
         () => EnqueueWorkItemAsync(e.Document, InvocationReasons.DocumentClosed), _shutdownToken).CompletesAsyncOperation(asyncToken);
 }
Exemple #12
0
 /// <summary>
 /// The event handler that occurs before you save the document.
 /// </summary>
 /// <param name="args"></param>
 protected override void SavingDocumentEventHandler(DocumentEventArgs args)
 {
     VariablesEventHandler();
 }
 private void Colorizer_Plugin_DocumentActivated(DocumentEventArgs ea)
 {
     _paintableElements.Clear();
 }
Exemple #14
0
 private void OnDocumentClosed(object?sender, DocumentEventArgs e)
 {
     _eventProcessingQueue.ScheduleTask("OnDocumentClosed",
                                        () => EnqueueDocumentWorkItemAsync(e.Document.Project, e.Document.Id, e.Document, InvocationReasons.DocumentClosed), _shutdownToken);
 }
Exemple #15
0
 /// <summary>
 /// Rebuilds the list of documents after a document is opened or closed
 /// </summary>
 private void HandleDocumentOpenedOrClosed(object sender, DocumentEventArgs e)
 {
     RebuildDocumentList();
 }
Exemple #16
0
 private void OnDocumentActiveContextChanged(object sender, DocumentEventArgs e)
 {
     Reanalyze(e.Document.Project.Solution.Workspace, documentIds: SpecializedCollections.SingletonEnumerable(e.Document.Id), highPriority: true);
 }
        void OnDocumentClosed(Document doc)
        {
            var e = new DocumentEventArgs(doc);

            DocumentClosed?.SafeInvoke(this, e);
        }
 void OnDocumentOpened(DocumentEventArgs e)
 {
     DocumentOpened?.SafeInvoke(this, e);
 }
Exemple #19
0
 /// <summary>The document document changed.</summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The e.</param>
 private void DocumentDocumentChanged(object sender, DocumentEventArgs e)
 {
     IsDirty = true;
 }
 void CANAPEProject_DocumentRenamed(object sender, DocumentEventArgs e)
 {
     if (InvokeRequired)
     {
         Invoke(new EventHandler<DocumentEventArgs>(CANAPEProject_DocumentRenamed), sender, e);
     }
     else
     {
         if(_documentToNode.ContainsKey(e.Document.Uuid))
         {
             _documentToNode[e.Document.Uuid].Text = e.Document.Name;
             OnDocumentRenamed(e.Document);
         }
     }
 }
Exemple #21
0
 /// <summary>
 /// The event handler is creating a new document.
 /// </summary>
 /// <param name="args"></param>
 protected override void NewDocumentCreatedEventHandler(DocumentEventArgs args)
 {
     args.Document.AttachPlugin(this);
 }
 private void RhinoDoc_DocumentPropertiesChanged(object sender, DocumentEventArgs e)
 {
     //The document has been changed, we need to look at our doc strings the next time rhino is idle.
     UpdateStrings = true;
 }
		void WorkbenchDocumentClosed (object sender, DocumentEventArgs e)
		{
			e.Document.DocumentParsed -= HandleDocumentParsed;
		}
Exemple #24
0
 private void state_ResolveDocumentClient(object sender, DocumentEventArgs e)
 {
     e.Document.Client = GetTextBox();
 }
Exemple #25
0
 private void events_DocumentSaved(DocumentEventArgs ea) {
     if (Options.Storage.ReadBoolean(Options.GetPageName(), Options.FormatOnSave))
         CodeRush.Command.Execute("Edit.FormatDocument");
 }
 private void OnDocumentOpened(object sender, DocumentEventArgs args)
 {
     EnqueueProcessSnapshotAsync(args.Document.Id);
 }
Exemple #27
0
 private void OnDocumentOpened(object sender, DocumentEventArgs args)
 {
     this.Parse(args.Document);
 }
 private void OnDocumentClosed(object sender, DocumentEventArgs args)
 {
     Rebuild(args.Document.Project.Solution, args.Document.Project.Id);
 }
 private void OnDocumentActiveContextChanged(object sender, DocumentEventArgs e)
 {
     Reanalyze(e.Document.Project.Solution.Workspace, documentIds: SpecializedCollections.SingletonEnumerable(e.Document.Id));
 }
 void tabbedView_DocumentClosed(object sender, DocumentEventArgs e)
 {
     RecreateUserControls(e);
     SetAccordionSelectedElement(e);
 }
 private void DocumentOpened(object?sender, DocumentEventArgs e)
 => _ = TrackActiveSpansAsync(e.Document, _cancellationSource.Token);
Exemple #32
0
 void _editorController_ActiveDocumentChanged(object sender, DocumentEventArgs e)
 {
     _service.ActiveDocument = e.Document;
 }
Exemple #33
0
 private void modelExplorer_DocumentOpening(object sender, DocumentEventArgs e)
 {
     docManager.AddOrActivate(e.Document);
 }
Exemple #34
0
 private void OnCloseDocument(object sender, DocumentEventArgs e)
 {
     IsolateIndex = 0;
 }
 void CANAPEProject_DocumentDeleted(object sender, DocumentEventArgs e)
 {
     //if (InvokeRequired)
     //{
     //    Invoke(new EventHandler<DocumentEventArgs>(CANAPEProject_DocumentDeleted), sender, e);
     //}
     //else
     //{
     //    TreeNode folder = GetFolderNodeForDocument(e.Document);
     //    if (folder != null)
     //    {
     //        foreach (TreeNode node in folder.Nodes)
     //        {
     //            if (node.Tag == e.Document)
     //            {
     //                node.Remove();
     //                break;
     //            }
     //        }
     //    }
     //}
 }
Exemple #36
0
 private void OnDocumentOpened(object sender, DocumentEventArgs e)
 {
     InvokeBelowInputPriority(() => TrackDocument(e.Document.Id));
 }
Exemple #37
0
 /// <summary>
 /// The event handler that occurs before closing the document.
 /// </summary>
 /// <param name="args"></param>
 protected override void ClosingDocumentEventHandler(DocumentEventArgs args)
 {
     //..
 }
Exemple #38
0
        private void OnDocumentChangedDoUpdateContextMenu(object sender, DocumentEventArgs e)
        {
            bool isVisible = (Document.TotalNumberOfLines > ActiveTextAreaControl.TextArea.TextView.VisibleLineCount);

            ActiveTextAreaControl.VScrollBar.Visible = isVisible;
        }
Exemple #39
0
 /// <summary>
 /// The event handler open the document.
 /// </summary>
 /// <param name="args"></param>
 protected override void DocumentOpenEventHandler(DocumentEventArgs args)
 {
     args.Document.AttachPlugin(this);
 }
Exemple #40
0
 private void PlugIn1_DocumentActivated(DocumentEventArgs ea)
 {
     _ImplementsIDisposable.Clear();
 }
        private void DocEventsOnDocumentOpened(object sender, DocumentEventArgs args)
        {
            try
            {
                var solution = GetSolution();
                if (solution == null)
                    return;

                HandleActivity(args.Document.FileName, false);
            }
            catch (Exception ex)
            {
                Logger.Instance.Error("DocEventsOnDocumentOpened : " + ex.Message);
            }
        }
Exemple #42
0
 private void DocumentOpened(object sender, DocumentEventArgs e)
 {
     _ = DocumentOpenedAsync(e.Document);
 }
		void WorkbenchDocumentOpened (object sender, DocumentEventArgs e)
		{
			e.Document.DocumentParsed += HandleDocumentParsed;
		}
 private void OnDocumentClosed(object?sender, DocumentEventArgs e)
 => ClearVersionMap(e.Document.Project.Solution.Workspace, e.Document.Id);
Exemple #45
0
 private void OnDocumentChanged(object sender, DocumentEventArgs e)
 {
     OnDocumentChanged(e.Document.Id);
 }
Exemple #46
0
 private void RhinoDoc_NewDocument(object sender, DocumentEventArgs e)
 {
     Debug.WriteLine("New document event");
     NotifySpeckleFrame("purge-clients", "", "");
     RemoveAllClients();
 }
            private void DocumentOpened(object sender, DocumentEventArgs e)
            {
                ITextSnapshot snapshot;
                ImmutableArray<ActiveStatementSpan> activeStatements;
                if (_editSession.BaseActiveStatements.TryGetValue(e.Document.Id, out activeStatements) &&
                    TryGetSnapshot(e.Document, out snapshot))
                {
                    lock (_trackingSpans)
                    {
                        TrackActiveSpansNoLock(e.Document, snapshot, activeStatements);
                    }

                    bool leafChanged = activeStatements.Contains(a => (a.Flags & ActiveStatementFlags.LeafFrame) != 0);
                    _service.OnTrackingSpansChanged(leafChanged);
                }
            }
 /// <summary>
 /// Called when Rhino closes the active document
 /// </summary>
 public static void OnCloseDocument(object sender, DocumentEventArgs e)
 {
     DebugWriteMethod();
 }
Exemple #49
0
 private void OnDocumentClosed(object sender, DocumentEventArgs args)
 {
     this.CancelParse(args.Document.Id);
 }
 /// <summary>
 /// Called when the properties of the active document are changed
 /// </summary>
 void OnDocumentPropertiesChanged(object sender, DocumentEventArgs e)
 {
     DebugWriteMethod();
 }
 private void OnDocumentOpened(object sender, DocumentEventArgs e)
 {
     InvokeBelowInputPriority(() => TrackDocument(e.Document.Id));
 }
 private void OnDocumentOpened(object sender, DocumentEventArgs args)
 {
     if (_workspace != null)
     {
         ParseIfThisDocument(null, args.Document.Project.Solution, args.Document.Id);
     }
 }
 private void OnDocumentClosed(object sender, DocumentEventArgs e)
 {
     ClearVersionMap(e.Document.Project.Solution.Workspace, e.Document.Id);
 }
        private static void OnDocumentClosed(object sender, DocumentEventArgs e)
        {
            if (!e.Document.IsFromPrimaryBranch())
            {
                return;
            }

            ConditionalWeakTable<DocumentId, SyntaxTreeIdentifierInfo> infoTable;
            if (cache.TryGetValue(e.Document.Project.Solution.BranchId, out infoTable))
            {
                // remove closed document from primary branch from live cache.
                infoTable.Remove(e.Document.Id);
            }
        }
 private void Document_DocumentChanged(object sender, DocumentEventArgs e)
 {
     textChanged = true;
 }
Exemple #56
0
 private void DocumentChanged(object sender, DocumentEventArgs e)
 {
     // reset markers table
     markersTable.Clear();
     Document.UpdateSegmentListOnDocumentChange(textMarker, e);
 }
 private void OnActiveContextChanged(object sender, DocumentEventArgs e)
 {
     // REVIEW: it would be nice for changed event to pass in both old and new document.
     OnSuggestedActionsChanged(e.Document.Project.Solution.Workspace, e.Document.Id, e.Document.Project.Solution.WorkspaceVersion);
 }
Exemple #58
0
 private void OnDocumentOpened(object sender, DocumentEventArgs args)
 {
     this.Parse(args.Document);
 }
		static void OnDisableConditionalCompilation (DocumentEventArgs e)
		{
			EventHandler<DocumentEventArgs> handler = DisableConditionalCompilation;
			if (handler != null)
				handler (null, e);
		}
Exemple #60
0
 private void OnDocumentClosed(object sender, DocumentEventArgs args)
 {
     this.CancelParse(args.Document.Id);
 }