コード例 #1
0
        public RHistory(IRInteractiveWorkflowVisual interactiveWorkflow, ITextBuffer textBuffer, IFileSystem fileSystem, IRSettings settings, IEditorOperationsFactoryService editorOperationsFactory, IRtfBuilderService rtfBuilderService, Action dispose)
        {
            _interactiveWorkflow     = interactiveWorkflow;
            _historyTextBuffer       = textBuffer;
            _fileSystem              = fileSystem;
            _editorOperationsFactory = editorOperationsFactory;
            _rtfBuilderService       = rtfBuilderService;
            _dispose = dispose;

            _textBufferIsEditable = new CountdownDisposable(MakeTextBufferReadOnly);
            _isMultiline          = settings.MultilineHistorySelection;

            if (_isMultiline)
            {
                _entries = new MultilineRHistoryEntries();
            }
            else
            {
                _entries = new SinglelineRHistoryEntries();
            }

            _nextEntrySelector      = new SingleEntrySelector(this, false);
            _previousEntrySelector  = new SingleEntrySelector(this, true);
            _rangeUpEntrySelector   = new RangeEntrySelector(this, true);
            _rangeDownEntrySelector = new RangeEntrySelector(this, false);

            MakeTextBufferReadOnly();
        }
コード例 #2
0
 public SinglelineRHistoryEntries(IRHistoryEntries entries) {
     if (entries.IsMultiline) {
         CloneFromMultiline(entries);
     } else { 
         CloneEntries(entries);
     }
 }
コード例 #3
0
 private void CloneFromMultiline(IRHistoryEntries existingEntries) {
     foreach (var existingEntry in existingEntries.GetEntries()) {
         var entriesGroup = AddSinglelineEntries(existingEntry.EntrySpan);
         foreach (var newEntry in entriesGroup) {
             newEntry.IsSelected = existingEntry.IsSelected;
         }
     }
 }
コード例 #4
0
ファイル: RHistoryEntries.cs プロジェクト: zachwieja/RTVS
 protected void CloneEntries(IRHistoryEntries existingEntries)
 {
     foreach (var existingEntry in existingEntries.GetEntries())
     {
         var newEntry = AddEntry(existingEntry.EntrySpan, existingEntry.Span);
         newEntry.IsSelected = existingEntry.IsSelected;
     }
 }
コード例 #5
0
 private void CloneFromSingleline(IRHistoryEntries existingEntries)
 {
     foreach (var entrySpanGroup in existingEntries.GetEntries().GroupBy(e => e.EntrySpan))
     {
         var newEntry = AddMultilineEntry(entrySpanGroup.Key);
         newEntry.IsSelected = entrySpanGroup.Any(e => e.IsSelected);
     }
 }
コード例 #6
0
 private void CloneFromMultiline(IRHistoryEntries existingEntries)
 {
     foreach (var existingEntry in existingEntries.GetEntries())
     {
         var entriesGroup = AddSinglelineEntries(existingEntry.EntrySpan);
         foreach (var newEntry in entriesGroup)
         {
             newEntry.IsSelected = existingEntry.IsSelected;
         }
     }
 }
コード例 #7
0
 public SinglelineRHistoryEntries(IRHistoryEntries entries)
 {
     if (entries.IsMultiline)
     {
         CloneFromMultiline(entries);
     }
     else
     {
         CloneEntries(entries);
     }
 }
コード例 #8
0
ファイル: RHistory.cs プロジェクト: AlexanderSher/RTVS-Old
        public RHistory(IRInteractiveWorkflow interactiveWorkflow, ITextBuffer textBuffer, IFileSystem fileSystem, IRSettings settings, IEditorOperationsFactoryService editorOperationsFactory, IRtfBuilderService rtfBuilderService, Action dispose) {
            _interactiveWorkflow = interactiveWorkflow;
            _historyTextBuffer = textBuffer;
            _fileSystem = fileSystem;
            _editorOperationsFactory = editorOperationsFactory;
            _rtfBuilderService = rtfBuilderService;
            _dispose = dispose;

            _textBufferIsEditable = new CountdownDisposable(MakeTextBufferReadOnly);
            _isMultiline = settings.MultilineHistorySelection;

            if (_isMultiline) {
                _entries = new MultilineRHistoryEntries();
            } else {
                _entries = new SinglelineRHistoryEntries();
            }

            MakeTextBufferReadOnly();
        }
コード例 #9
0
ファイル: RHistoryEntries.cs プロジェクト: Microsoft/RTVS
 protected void CloneEntries(IRHistoryEntries existingEntries) {
     foreach (var existingEntry in existingEntries.GetEntries()) {
         var newEntry = AddEntry(existingEntry.EntrySpan, existingEntry.Span);
         newEntry.IsSelected = existingEntry.IsSelected;
     }
 }
コード例 #10
0
 private void CloneFromSingleline(IRHistoryEntries existingEntries) {
     foreach (var entrySpanGroup in existingEntries.GetEntries().GroupBy(e => e.EntrySpan)) {
         var newEntry = AddMultilineEntry(entrySpanGroup.Key);
         newEntry.IsSelected = entrySpanGroup.Any(e => e.IsSelected);
     }
 }