Ejemplo n.º 1
0
 public Text(ComponentPoint location, TextAlignment alignment, double size, string text)
 {
     Location = location;
     Alignment = alignment;
     var textRun = new TextRun(text, new TextRunFormatting(TextRunFormattingType.Normal, size));
     TextRuns = new List<TextRun>();
     TextRuns.Add(textRun);
 }
Ejemplo n.º 2
0
        public override bool Equals(object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return(false);
            }

            // If parameter cannot be cast to TextRun return false.
            TextRun o = obj as TextRun;

            if ((System.Object)o == null)
            {
                return(false);
            }

            // Return true if the fields match:
            return(Formatting.Equals(o.Formatting) &&
                   Text.Equals(o.Text));
        }
 protected abstract Size MeasureText(TextRun text);