/// <summary> /// Class content comparer /// </summary> private int CompareContent(ClassContent x, ClassContent y) { // Name must match if (!x.Name.Equals(y.Name)) { return(x.Name.CompareTo(y.Name)); } else if (!x.GetType().Equals(y.GetType())) // must be the same type of content { return(-1); } else if (x is Property) // We have already asserted that x and y must be the same type { return(CompareProperty(x as Property, y as Property)); } else if (x is Choice) // Compare choice { return(CompareChoice(x as Choice, y as Choice)); } return(0); }