コード例 #1
0
        public bool TrySaveToFile(string path)
        {
            var snapshot = _historyTextBuffer.CurrentSnapshot;
            var content  = _entries.GetEntries().Select(e => e.Span.GetText(snapshot).Replace(BlockSeparator, LineSeparator)).ToArray();

            try {
                _fileSystem.FileWriteAllLines(path, content);
                return(true);
            } catch (Exception) {
                // Failure to save .RHistory isn't critical
                return(false);
            }
        }
コード例 #2
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;
         }
     }
 }
コード例 #3
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;
     }
 }
コード例 #4
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);
     }
 }
コード例 #5
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;
         }
     }
 }
コード例 #6
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;
     }
 }
コード例 #7
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);
     }
 }