Ejemplo n.º 1
0
        private static TablixCorner CreateTablixCorner()
        {
            var textRuns1 = new TextRuns(new TextRun {
                Value = "Group", FontWeight = FontWeight.Bold
            });

            textRuns1.Add(new TextRun {
                Value = "", FontFamily = "Wingdings"
            });
            var textRuns2 = new TextRuns(new TextRun {
                Value = "", FontFamily = "Wingdings"
            });

            textRuns2.Add(new TextRun {
                Value = "Period", FontWeight = FontWeight.Bold
            });

            var textbox = new Textbox(new Paragraph(textRuns1))
            {
                TextboxStyle = new TextboxStyle()
            };

            textbox.AddParagraph(new Paragraph(textRuns2));
            return
                (new TablixCorner(
                     new TablixCornerRows(new TablixCornerRow(new TablixCornerCell(new CellContents(textbox))))));
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="text"></param>
        /// <param name="font"></param>
        /// <param name="color"></param>
        public ScrollerText(string text, Font font, Color color)
            : base()
        {
            int pos = 0;

            // Break the text up if it contains CR/LF pairs.
            while ((pos = text.IndexOf("\r\n")) > -1)
            {
                TextRuns.Add(new TextRun(text.Substring(0, pos), font, color));
                TextRuns.Add(TextRun.EndOfLine);
                pos += 2;
                text = text.Substring(pos, text.Length - pos);
            }

            TextRuns.Add(new TextRun(text, font, color));
        }
Ejemplo n.º 3
0
        public override bool Equals(object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return(false);
            }

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

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

            bool textRunsEqual = TextRuns.SequenceEqual(o.TextRuns);

            // Return true if the fields match:
            return(Location.Equals(o.Location) &&
                   Alignment.Equals(o.Alignment) &&
                   textRunsEqual);
        }
Ejemplo n.º 4
0
 public override int GetHashCode()
 {
     return(Location.GetHashCode()
            ^ Alignment.GetHashCode()
            ^ TextRuns.GetHashCode());
 }