示例#1
0
 private static void WriteStringBlock (TextWriter writer, char prefix, Range items)
 {
     foreach (object item in items) {
         writer.Write (prefix);
         writer.WriteLine (item.ToString ());
     }
 }
示例#2
0
 private static void WriteCharBlock (TextWriter writer, char prefix, Range items)
 {
     bool newline = true;
     int counter = 0;
     foreach (char c in items) {
         if (c == '\n' && !newline) {
             writer.WriteLine ();
             newline = true;
         }
                         
         if (newline) {
             writer.Write (prefix);
             newline = false;
             counter = 0;
         }
                         
         if (c == '\n') {
             writer.WriteLine ("[newline]");
             newline = true;
         } else {
             writer.Write (c);
             counter++;
             if (counter == 60) {
                 writer.WriteLine ();
                 newline = true;
             }
         }
     }
     if (!newline)
         writer.WriteLine ();
 }
示例#3
0
 private static void WriteBlock (TextWriter writer, char prefix, Range items)
 {
     if (items.Count > 0 && items [0] is char)
         WriteCharBlock (writer, prefix, items);
     else
         WriteStringBlock (writer, prefix, items);
 }
示例#4
0
文件: Merge.cs 项目: nuxleus/Nuxleus
 internal Conflict (Range [] ranges)
 {
     this.ranges = ranges;
 }
示例#5
0
 public ExtendedRange(Range originalRange, Range changedRange, ChangeType changeType)
 {
     OriginalRange = originalRange;
     ChangedRange = changedRange;
     ChangeType = changeType;
 }
示例#6
0
 public Conflict(Range[] ranges)
 {
     this.ranges = ranges;
 }
示例#7
0
 public static string[] GetLinesFromRange(List<string> lines, Range range)
 {
     string[] linesFromRange = new string[range.End - range.Start + 1];
     for (int i = range.Start; i <= range.End; i++)
     {
         linesFromRange[i - range.Start] = lines[i];
     }
     return linesFromRange;
 }