Beispiel #1
0
 /// <summary>
 /// Find differences between list of classes.
 /// </summary>
 /// <param name="classes1">First list of classes.</param>
 /// <param name="classes2">Seconf list of classes.</param>
 /// <param name="changes"><c>List</c> containing changes in classes.</param>
 private void diffToClasses(IEnumerable <IClass> classes1, IEnumerable <IClass> classes2, List <SourceChange> changes)
 {
     foreach (IClass element in classes1)
     {
         IClass gClass = ProjectContentCopy.GetClass(classes2, element.FullyQualifiedName, element.TypeParameters.Count);
         if (gClass != null)
         {
             // For classes in both this.classes and cont
             diffToClass(element, gClass, changes);
         }
         else
         {
             // For classes in this.classes and not in cont.
             SourceChange classRemoved = new SourceChange(element, element, SourceChangeMember.Class, SourceChangeAction.Removed);
             changes.Add(classRemoved);
         }
     }
     // For classes in cont and not in this.classes.
     foreach (IClass element in classes2)
     {
         IClass gClass = ProjectContentCopy.GetClass(classes2, element.FullyQualifiedName, element.TypeParameters.Count);
         if (gClass == null)
         {
             SourceChange classRemoved = new SourceChange(element, element, SourceChangeMember.Class, SourceChangeAction.Created);
             changes.Add(classRemoved);
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// Returns class by <c>fullyQualifiedName</c> and <c>typeParameterCount</c>.
 /// </summary>
 public new IClass GetClass(string fullyQualifiedName, int typeParameterCount)
 {
     return(ProjectContentCopy.GetClass(this, fullyQualifiedName, typeParameterCount));
 }