private void TextView_Closed(object sender, EventArgs e) { IWpfTextView textView = sender as IWpfTextView; if (textView != null) { if (textView.BufferGraph != null) { textView.BufferGraph.GraphBuffersChanged -= OnGraphBuffersChanged; } IProjectionBuffer pb = textView.TextBuffer as IProjectionBuffer; if (pb != null) { pb.SourceBuffersChanged -= OnSourceBuffersChanged; } textView.Closed -= TextView_Closed; ReplCommandController controller = ReplCommandController.FromTextView(textView); if (controller != null) { controller.Dispose(); } } }
public bool TryHandleCommand(IImmutableSet <IProjectTree> nodes, long commandId, bool focused, long commandExecuteOptions, IntPtr variantArgIn, IntPtr variantArgOut) { if (commandId == RPackageCommandId.icmdSetDirectoryHere) { var path = nodes.GetSelectedFolderPath(_unconfiguredProject); if (!string.IsNullOrEmpty(path)) { var o = new object(); var interactiveWorkflow = _interactiveWorkflowProvider.GetOrCreate(); var controller = ReplCommandController.FromTextView(interactiveWorkflow.ActiveWindow.TextView); controller.Invoke(RGuidList.RCmdSetGuid, RPackageCommandId.icmdSetWorkingDirectory, path, ref o); return(true); } } return(false); }