Example #1
0
        static List <IBlameLine> MakeLines(string[] fileLines, FileVersionInfoBase fileVersionInfo)
        {
            var result = new List <IBlameLine>();

            foreach (string line in fileLines)
            {
                result.Add(new BlameLine(fileVersionInfo, line));
            }
            return(result);
        }
Example #2
0
 static void ApplyDelta(List <IBlameLine> annotation, DiffStringItem[] delta, FileVersionInfoBase fileVersionInfo)
 {
     foreach (DiffStringItem item in delta)
     {
         if (item.DeletedA > 0)
         {
             annotation.RemoveRange(item.StartB, item.DeletedA);
         }
         if (item.InsertedB > 0)
         {
             annotation.InsertRange(item.StartB, new List <string>(item.Inserted).ConvertAll(x => (IBlameLine) new BlameLine(fileVersionInfo, x)));
         }
     }
 }
Example #3
0
 public void AddItem(int index, FileVersionInfo info)
 {
     if (index == 0)
     {
         baseData       = GetFileLines(info.Data);
         historyInfo[0] = new FileVersionInfoBase(info);
     }
     else
     {
         string[] revisionData = GetFileLines(info.Data);
         deltas[index - 1]  = StringsDiff.DiffStringLines(revisionData, baseData, SpacesAction);
         historyInfo[index] = new FileVersionInfoBase(info);
         baseData           = revisionData;
     }
 }
Example #4
0
 public FileVersionInfoBase(FileVersionInfoBase copy) : this(copy.Version, copy.Date, copy.User, copy.Comment)
 {
 }
Example #5
0
 public BlameLine(FileVersionInfoBase versionInfo, string sourceLine)
 {
     this.versionInfo = versionInfo;
     this.sourceLine  = sourceLine;
 }