/// <summary> /// Produce a description that may be useful in debugging event handling and the undo manager. /// </summary> /// <returns></returns> public override string ToString() { string str = PresentationName + ": " + SubHint.ToString(NumberFormatInfo.InvariantInfo); if (Object != null) { str = str + " " + Object.ToString(); IGoLabeledPart goLabeledPart = Object as IGoLabeledPart; if (goLabeledPart != null) { str = str + " \"" + goLabeledPart.Text + "\""; } } if (IsBeforeChanging) { str += " (before)"; } str += ";"; if (OldInt != 0) { str = str + " " + OldInt.ToString(NumberFormatInfo.InvariantInfo); } if (OldValue != null) { str = str + " (" + OldValue.ToString() + ")"; } if (OldRect != default(RectangleF)) { str = str + " [" + OldRect.X.ToString(NumberFormatInfo.InvariantInfo) + "," + OldRect.Y.ToString(NumberFormatInfo.InvariantInfo) + " " + OldRect.Width.ToString(NumberFormatInfo.InvariantInfo) + "x" + OldRect.Height.ToString(NumberFormatInfo.InvariantInfo) + "]"; } str += " -->"; if (NewInt != 0) { str = str + " " + NewInt.ToString(NumberFormatInfo.InvariantInfo); } if (NewValue != null) { str = str + " (" + NewValue.ToString() + ")"; } if (NewRect != default(RectangleF)) { str = str + " [" + NewRect.X.ToString(NumberFormatInfo.InvariantInfo) + "," + NewRect.Y.ToString(NumberFormatInfo.InvariantInfo) + " " + NewRect.Width.ToString(NumberFormatInfo.InvariantInfo) + "x" + NewRect.Height.ToString(NumberFormatInfo.InvariantInfo) + "]"; } return(str); }
public int Compare(GoObject x, GoObject y) { IGoLabeledPart goLabeledPart = x as IGoLabeledPart; IGoLabeledPart goLabeledPart2 = y as IGoLabeledPart; if (goLabeledPart != null) { if (goLabeledPart2 != null) { return(string.Compare(goLabeledPart.Text, goLabeledPart2.Text, ignoreCase: true, CultureInfo.CurrentCulture)); } return(1); } if (goLabeledPart2 != null) { return(-1); } return(0); }