Example #1
0
        private void InitializeCurrentFontStyles(StyleDefinition styleDefinition)
        {
            UnderlineType underlineType = (UnderlineType)styleDefinition.GetPropertyValue(Span.UnderlineTypeProperty);

            this.radBtnUnderlineStyle.ToggleState = underlineType != UnderlineType.None ? ToggleState.On : ToggleState.Off;

            string fontFamiliy = (string)styleDefinition.GetPropertyValue(Span.FontFamilyProperty);

            this.radDropDownListFont.SuspendSelectionEvents = true;
            this.radDropDownListFont.Text                   = fontFamiliy;
            this.radDropDownListFont.SelectedValue          = fontFamiliy;
            this.radDropDownListFont.SuspendSelectionEvents = false;

            float fontSize = (float)styleDefinition.GetPropertyValue(Span.FontSizeProperty);

            fontSize = (float)Math.Round(Unit.DipToPoint(fontSize), 1);
            this.EnsureFontSize(fontSize.ToString());

            TextStyle fontStyle = (TextStyle)styleDefinition.GetPropertyValue(Span.FontStyleProperty);

            this.radBtnBoldStyle.ToggleState   = fontStyle.HasFlag(TextStyle.Bold) ? ToggleState.On : ToggleState.Off;
            this.radBtnItalicStyle.ToggleState = fontStyle.HasFlag(TextStyle.Italic) ? ToggleState.On : ToggleState.Off;

            bool strikeThrough = (bool)styleDefinition.GetPropertyValue(Span.StrikethroughProperty);

            this.radBtnStrikethrough.ToggleState = strikeThrough ? ToggleState.On : ToggleState.Off;
        }
Example #2
0
        private static string ApplyUnderline(string text, UnderlineType underline)
        {
            switch (underline)
            {
            case UnderlineType.None:
                return(text);

            case UnderlineType.Single:
                var length     = text.Length;
                var underlined = new StringBuilder(length * 2 + 2);
                for (var i = 0; i < length; i++)
                {
                    var c = text[i];
                    underlined.Append(c);
                    if (char.IsSurrogate(c))
                    {
                        underlined.Append(text[i + 1]);
                        if (char.IsLetterOrDigit(text, i))
                        {
                            underlined.Append('\u0332');
                        }
                        i++;
                    }
                    else if (char.IsLetterOrDigit(c))
                    {
                        underlined.Append('\u0332');
                    }
                }
                return(underlined.ToString());

            case UnderlineType.Double:
            default:
                throw new ArgumentException(string.Format("UnderlineType \"{0}\" is not supported!", underline), "underline");
            }
        }
Example #3
0
        internal static void Underline(this Run run, UnderlineType value)
        {
            var runProperties = run.GetOrCreate <RunProperties>(true);
            var prop          = runProperties.GetOrCreate <Underline>();

            prop.Val = Convert.ToUnderlineValues(value);
        }
Example #4
0
        /// <summary>
        /// Appends underlined text to the paragraph
        /// </summary>
        /// <param name="text"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public Paragraph AppendUnderline(string text, UnderlineType value)
        {
            var run = GetRun(text);

            run.Underline(value);

            return(this);
        }
Example #5
0
 public XlsxFont(
     int fontSize                = 11,
     FontType fontType           = FontType.Calibri,
     bool bold                   = false,
     bool italic                 = false,
     UnderlineType underlineType = UnderlineType.None)
 {
     Size          = fontSize;
     FontType      = fontType;
     Bold          = bold;
     Italic        = italic;
     UnderlineType = underlineType;
 }
Example #6
0
        private void InitializeCurrentFontStyles(StyleDefinition styleDefinition)
        {
            UnderlineType underlineType = (UnderlineType)styleDefinition.GetPropertyValue(Span.UnderlineTypeProperty);

            string fontFamiliy = (string)styleDefinition.GetPropertyValue(Span.FontFamilyProperty);

            float fontSize = (float)styleDefinition.GetPropertyValue(Span.FontSizeProperty);

            fontSize = (float)Math.Round(Unit.DipToPoint(fontSize), 1);

            TextStyle fontStyle     = (TextStyle)styleDefinition.GetPropertyValue(Span.FontStyleProperty);
            bool      strikeThrough = (bool)styleDefinition.GetPropertyValue(Span.StrikethroughProperty);
        }
Example #7
0
        /// <summary>
        /// Makes a paragraph text underlined
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public Paragraph Underline(UnderlineType value)
        {
            if (Runs.Count() == 0)
            {
                var paragraphProperties        = paragraph.GetOrCreate <ParagraphProperties>();
                var paragraphMarkRunProperties = paragraphProperties.GetOrCreate <ParagraphMarkRunProperties>();

                Underline Underline = paragraphMarkRunProperties.GetOrCreate <Underline>();
                Underline.Val = Convert.ToUnderlineValues(value);
            }
            else
            {
                foreach (var run in Runs)
                {
                    run.Underline(value);
                }
            }

            return(this);
        }
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            UnderlineType type = (UnderlineType)item;

            switch (type)
            {
            case UnderlineType.Single: return(SingleLineTemplate);

            case UnderlineType.Double: return(DoubleLineTemplate);

            case UnderlineType.Thick: return(ThickLineTemplate);

            case UnderlineType.Dotted: return(DottedLineTemplate);

            case UnderlineType.Dash: return(DashLineTemplate);

            case UnderlineType.DotDash: return(DotDashLineTemplate);

            case UnderlineType.DotDotDash: return(DotDotDashLineTemplate);

            default: return(NoneLineTemplate);
            }
        }
Example #9
0
        /// <summary>
        /// maybe later FontSchemeValues fontScheme = FontSchemeValues.None,
        /// and uint colorSchemeId = 0
        /// </summary>
        /// <param name="size"></param>
        /// <param name="fontName"></param>
        /// <param name="fontFamilyId"></param>
        /// <param name="bold"></param>
        /// <param name="italic"></param>
        /// <param name="underlineValue"></param>
        /// <returns></returns>
        private uint GetFont(double size, string fontName, int fontFamilyId, bool bold, bool italic, UnderlineType underlineType, string fontColor)
        {
            UnderlineValues underlineValue;

            switch (underlineType)
            {
            case UnderlineType.SingleLine:
                underlineValue = UnderlineValues.Single;
                break;

            case UnderlineType.DoubleLine:
                underlineValue = UnderlineValues.Double;
                break;

            case UnderlineType.None:
                underlineValue = UnderlineValues.None;
                break;

            default:
                throw new Exception("Unknown Underline Type");
            }

            //Check font type exists and return index
            uint fontIndex = 0;

            foreach (var fnt in ActualFonts.ChildElements.OfType <Font>())
            {
                if (fnt.FontSize.Val == size &&
                    fnt.FontName.Val == fontName &&
                    fnt.FontFamilyNumbering.Val == fontFamilyId &&
                    fnt.Bold.Val == bold &&
                    fnt.Italic.Val == italic &&
                    fnt.Underline.Val.Value == underlineValue &&
                    (string.IsNullOrEmpty(fontColor) || fnt.Color == null || fnt.Color.Rgb == fontColor))
                {
                    return(fontIndex);
                }
                fontIndex++;
            }

            //if not exists create new font and append to actual fonts
            SetFont(size, fontName, fontFamilyId, bold, italic, underlineValue, fontColor);
            return(fontIndex);
        }
Example #10
0
 internal static DocumentFormat.OpenXml.Wordprocessing.UnderlineValues ToUnderlineValues(UnderlineType value)
 {
     return((DocumentFormat.OpenXml.Wordprocessing.UnderlineValues)((int)value));
 }
        /*
         *  Win2DのCanvasControlの描画
         */
        private void Win2DCanvas_Draw(Microsoft.Graphics.Canvas.UI.Xaml.CanvasControl sender, Microsoft.Graphics.Canvas.UI.Xaml.CanvasDrawEventArgs args)
        {
            Debug.WriteLine("<<--- Draw");

            DrawList.Clear();
            if (double.IsNaN(LineHeight))
            {
                // 最初の場合

                // 1行の高さを計算します。
                Rect M_rc = new CanvasTextLayout(args.DrawingSession, "M", TextFormat, float.MaxValue, float.MaxValue).LayoutBounds;
                LineHeight = M_rc.Height;

                // 空白の幅を計算します。
                Rect sp_M_rc = new CanvasTextLayout(args.DrawingSession, " M", TextFormat, float.MaxValue, float.MaxValue).LayoutBounds;
                SpaceWidth = sp_M_rc.Width - M_rc.Width;
            }

            // ビューの幅と高さ
            float view_w = (float)Win2DCanvas.ActualWidth;
            float view_h = (float)Win2DCanvas.ActualHeight;

            // ビュー内に表示する行数
            ViewLineCount = (int)(view_h / LineHeight);

            // フォーカスの有無によって枠の色を変えます。
            if (OverlappedButton.FocusState == FocusState.Unfocused)
            {
                // フォーカスがない場合

                args.DrawingSession.DrawRectangle(0, 0, view_w, view_h, Colors.Gray, 1);
            }
            else
            {
                // フォーカスがある場合

                args.DrawingSession.DrawRectangle(0, 0, view_w, view_h, Colors.Blue, 1);
            }

            // ビュー内の先頭行のインデックス
            int start_line_idx = (int)(EditScroll.VerticalOffset / LineHeight);

            // 現在行
            int line_idx = 0;

            // 文字の現在位置
            int pos;

            for (pos = 0; pos < Chars.Count && line_idx < start_line_idx; pos++)
            {
                if (Chars[pos].Chr == LF)
                {
                    line_idx++;
                    if (line_idx == start_line_idx)
                    {
                        pos++;
                        break;
                    }
                }
            }

            float x_start = (float)ViewPadding.X;
            float y       = (float)ViewPadding.Y;

            int sel_start = SelStart;
            int sel_end   = SelEnd;

            for (; ; pos++)
            {
                StringWriter line_sw = new StringWriter();

                float x = x_start;

                int start_pos = pos;
                for (; pos < Chars.Count;)
                {
                    StringWriter sw = new StringWriter();

                    UnderlineType under_line = Chars[pos].Underline;
                    bool          selected   = (sel_start <= pos && pos < sel_end);

                    int phrase_start_pos = pos;
                    for (; pos < Chars.Count && Chars[pos].Chr != LF && Chars[pos].Underline == under_line && (sel_start <= pos && pos < sel_end) == selected; pos++)
                    {
                        sw.Write(Chars[pos].Chr);
                    }
                    //String str = new string((from c in Chars select c.Chr).ToArray());
                    String str = sw.ToString();

                    line_sw.Write(str);

                    Size sz = MeasureText(str, TextFormat);

                    float xe = (float)(x + sz.Width);
                    float yb = (float)(y + sz.Height);
                    if (selected)
                    {
                        args.DrawingSession.FillRectangle(x, y, (float)sz.Width, (float)sz.Height, Colors.Blue);
                        args.DrawingSession.DrawText(str, x, y, Colors.White, TextFormat);
                    }
                    else
                    {
                        args.DrawingSession.DrawText(str, x, y, Colors.Black, TextFormat);

                        switch (under_line)
                        {
                        case UnderlineType.None:
                        case UnderlineType.Undefined:
                            break;

                        case UnderlineType.Wave:
                            args.DrawingSession.DrawLine(x, yb, xe, yb, Colors.Blue, 1);
                            break;

                        case UnderlineType.Thick:
                            args.DrawingSession.DrawLine(x, yb, xe, yb, Colors.Black, 1);
                            break;

                        case UnderlineType.Thin:
                            args.DrawingSession.DrawLine(x, yb, xe, yb, Colors.Green, 1);
                            break;

                        default:
                            Debug.WriteLine("unknown under-line {0}", under_line);
                            break;
                        }
                    }

                    DrawList.Add(new TShape(x, y, sz, phrase_start_pos, pos + 1));

                    x += (float)sz.Width;

                    if (Chars.Count <= pos || Chars[pos].Chr == LF)
                    {
                        break;
                    }
                }

                String line_str = line_sw.ToString();

                // 挿入カーソルの位置を得ます。
                int cursor_pos;
                if (DropPos != -1)
                {
                    // ドロップ先がある場合

                    // ドロップ先に挿入カーソルを描画します。
                    cursor_pos = DropPos;
                }
                else
                {
                    // ドロップ先がない場合

                    // 現在の選択位置に挿入カーソルを描画します。
                    cursor_pos = SelCurrent;
                }

                if (OverlappedButton.FocusState != FocusState.Unfocused && start_pos <= cursor_pos && cursor_pos <= pos)
                {
                    Size current_sz = MeasureText(line_str.Substring(0, cursor_pos - start_pos), TextFormat);

                    float x1 = (float)(x_start + current_sz.Width);
                    float y0 = y;
                    float y1 = (float)(y + current_sz.Height);

                    args.DrawingSession.DrawLine(x1, y0, x1, y1, Colors.Blue, 1);
                }

                line_idx++;
                if (ViewLineCount <= line_idx - start_line_idx)
                {
                    break;
                }

                // 現在の行の高さを計算して、yに加算します。
                y += (float)MeasureText(line_str, TextFormat).Height;

                if (Chars.Count <= pos)
                {
                    // 文書の最後の場合

                    break;
                }
            }
        }
 /*
  *  コンストラクタ
  */
 public TChar(char c)
 {
     Chr       = c;
     Underline = UnderlineType.Undefined;
 }
Example #13
0
 /*
  *  コンストラクタ
  */
 public TChar(char c)
 {
     Chr       = c;
     Underline = UnderlineType.Undefined;
     CharType  = ETokenType.Undefined;
 }
Example #14
0
        /// <summary>
        /// Generates the range block part.
        /// </summary>
        /// <param name="rLabel">The r label.</param>
        /// <param name="source">The source.</param>
        /// <param name="rect">The rect.</param>
        /// <param name="part">The part.</param>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        static List <List <GcPrintableControl> > GenerateRangeBlockPart(GcRichLabel rLabel, string source, Windows.Foundation.Rect rect, int part, GcReportContext context)
        {
            List <List <GcPrintableControl> > list = new List <List <GcPrintableControl> >();

            if ((!string.IsNullOrEmpty(source) && !rect.IsEmpty) && ((rect.Width != 0.0) && (rect.Height != 0.0)))
            {
                string        str;
                StringReader  reader         = new StringReader(source);
                int           allHeight      = 0;
                Font          font           = rLabel.Font ?? context.DefaultFont;
                string        fontFamilyName = font.FontFamilyName;
                bool          strikeout      = font.Strikeout;
                double        fontSize       = font.FontSize;
                UnderlineType underline      = font.Underline;
                bool          bold           = font.Bold;
                bool          italic         = font.Italic;
                Brush         foreground     = rLabel.Foreground;
                Image         leftImage      = null;
                switch (part)
                {
                case -1:
                    leftImage = rLabel.LeftImage;
                    break;

                case 0:
                    leftImage = rLabel.CenterImage;
                    break;

                case 1:
                    leftImage = rLabel.RightImage;
                    break;
                }
                while ((str = reader.ReadLine()) != null)
                {
                    List <GcPrintableControl> lists = GenerateRangeBlockLine(rLabel, str, rect, leftImage, ref font, ref fontFamilyName, ref strikeout, ref fontSize, ref underline, ref bold, ref italic, ref foreground);
                    int num3 = AdjustLineByPart(lists, context, part, true, allHeight, rect);
                    list.Add(lists);
                    if ((num3 <= 0) && (lists.Count <= 0))
                    {
                        num3 = (int)Math.Ceiling(context.MeasureNoWrapString("X", font).Height);
                    }
                    allHeight += num3;
                }
                int num4 = 0;
                switch (rLabel.VerticalAlignment)
                {
                case TextVerticalAlignment.General:
                case TextVerticalAlignment.Top:
                case TextVerticalAlignment.Justify:
                    break;

                case TextVerticalAlignment.Center:
                case TextVerticalAlignment.Distributed:
                    num4 = (int)((rect.Height - allHeight) / 2.0);
                    break;

                case TextVerticalAlignment.Bottom:
                    num4 = (int)(rect.Height - allHeight);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
                if (num4 != 0)
                {
                    using (List <List <GcPrintableControl> > .Enumerator enumerator = list.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            foreach (GcPrintableControl local1 in enumerator.Current)
                            {
                                local1.Y += num4;
                            }
                        }
                    }
                }
            }
            return(list);
        }
Example #15
0
        /// <summary>
        /// Generates the range block line.
        /// </summary>
        /// <param name="rLabel">The r label.</param>
        /// <param name="source">The source.</param>
        /// <param name="rect">The rect.</param>
        /// <param name="image">The image.</param>
        /// <param name="font">The font.</param>
        /// <param name="fontName">Name of the font.</param>
        /// <param name="isStrikethrough">if set to <c>true</c> [is strikethrough].</param>
        /// <param name="fontSize">Size of the font.</param>
        /// <param name="underlineType">Type of the underline.</param>
        /// <param name="isBold">if set to <c>true</c> [is bold].</param>
        /// <param name="isItalic">if set to <c>true</c> [is italic].</param>
        /// <param name="foreground">The foreground.</param>
        /// <returns></returns>
        static List <GcPrintableControl> GenerateRangeBlockLine(GcRichLabel rLabel, string source, Windows.Foundation.Rect rect, Image image, ref Font font, ref string fontName, ref bool isStrikethrough, ref double fontSize, ref UnderlineType underlineType, ref bool isBold, ref bool isItalic, ref Brush foreground)
        {
            List <GcPrintableControl> list = new List <GcPrintableControl>();

            if ((!string.IsNullOrEmpty(source) && !rect.IsEmpty) && ((rect.Width != 0.0) && (rect.Height != 0.0)))
            {
                string str = string.Empty;
                while (!string.IsNullOrEmpty(source))
                {
                    string        str2           = fontName;
                    bool          flag           = isStrikethrough;
                    double        num            = fontSize;
                    UnderlineType single         = underlineType;
                    bool          flag2          = isBold;
                    bool          flag3          = isItalic;
                    Brush         foregroundNext = foreground;
                    int           length         = -1;
                    length = source.IndexOf("&");
                    if (length < 0)
                    {
                        length = source.Length;
                    }
                    str = str + source.Substring(0, length);
                    string       str3       = ((length + 1) < source.Length) ? source.Substring(length + 1, 1) : string.Empty;
                    int          startIndex = -1;
                    bool         flag4      = false;
                    PageInfoType pageNumber = PageInfoType.PageNumber;
                    bool         flag5      = false;
                    int          num4       = 0;
                    try
                    {
                        Match match;
                        switch (str3)
                        {
                        case "1":
                        case "2":
                        case "3":
                        case "4":
                        case "5":
                        case "6":
                        case "7":
                        case "8":
                        case "9":
                        case "0":
                            match = FontSizeRegex.Match(source.Substring(length));
                            if ((!match.Success || !match.Groups["fontSize"].Success) || string.IsNullOrEmpty(match.Groups["fontSize"].Value))
                            {
                                goto Label_079D;
                            }
                            num        = int.Parse(match.Groups["fontSize"].Value);
                            flag4      = true;
                            num4       = 0;
                            startIndex = (length + "&".Length) + match.Groups["fontSize"].Value.Length;
                            if (match.Groups["nextIsNumber"].Success)
                            {
                                startIndex++;
                            }
                            goto Label_07C0;

                        case "K":
                        {
                            match = RgbColorRegex.Match(source.Substring(length));
                            if (!match.Success)
                            {
                                break;
                            }
                            byte r = byte.Parse(match.Groups["red"].Value, (NumberStyles)NumberStyles.AllowHexSpecifier);
                            byte g = byte.Parse(match.Groups["green"].Value, (NumberStyles)NumberStyles.AllowHexSpecifier);
                            byte b = byte.Parse(match.Groups["blue"].Value, (NumberStyles)NumberStyles.AllowHexSpecifier);
                            foregroundNext = new SolidColorBrush(Windows.UI.Color.FromArgb(0xff, r, g, b));
                            flag4          = true;
                            num4           = 0;
                            startIndex     = ((length + "&".Length) + "K".Length) + 6;
                            goto Label_07C0;
                        }

                        case "S":
                            flag       = !flag;
                            flag4      = true;
                            num4       = 0;
                            startIndex = (length + "&".Length) + "S".Length;
                            goto Label_07C0;

                        case "U":
                            if (single != UnderlineType.None)
                            {
                                goto Label_04DA;
                            }
                            single = UnderlineType.Single;
                            goto Label_04E2;

                        case "\"":
                            match = FontRegex.Match(source.Substring(length));
                            if (match.Success)
                            {
                                string str4 = match.Groups["fontName"].Value;
                                string str5 = match.Groups["fontStyle"].Value;
                                if (str4.IndexOf("-") < 0)
                                {
                                    str2  = str4;
                                    flag4 = true;
                                    num4  = 0;
                                }
                                if (str5.IndexOf("-") < 0)
                                {
                                    if (str5.IndexOf("Bold") >= 0)
                                    {
                                        flag2 = true;
                                    }
                                    if (str5.IndexOf("Italic") >= 0)
                                    {
                                        flag3 = true;
                                    }
                                    if (str5.IndexOf("Regular") >= 0)
                                    {
                                        flag2 = flag3 = false;
                                    }
                                    flag4 = true;
                                    num4  = 0;
                                }
                                startIndex = length + match.Value.Length;
                            }
                            goto Label_07C0;

                        case "B":
                            flag2      = !flag2;
                            flag4      = true;
                            num4       = 0;
                            startIndex = (length + "&".Length) + "B".Length;
                            goto Label_07C0;

                        case "I":
                            flag3      = !flag3;
                            flag4      = true;
                            num4       = 0;
                            startIndex = (length + "&".Length) + "I".Length;
                            goto Label_07C0;

                        case "&":
                            str        = str + "&";
                            flag4      = true;
                            num4       = 0;
                            startIndex = length + ("&".Length * 2);
                            goto Label_07C0;

                        case "D":
                            str        = str + "{0}";
                            flag4      = true;
                            num4       = 1;
                            pageNumber = PageInfoType.Date;
                            startIndex = (length + "&".Length) + "D".Length;
                            goto Label_07C0;

                        case "T":
                            str        = str + "{0}";
                            flag4      = true;
                            num4       = 1;
                            pageNumber = PageInfoType.Time;
                            startIndex = (length + "&".Length) + "T".Length;
                            goto Label_07C0;

                        case "P":
                            str        = str + "{0}";
                            flag4      = true;
                            num4       = 1;
                            pageNumber = PageInfoType.PageNumber;
                            startIndex = (length + "&".Length) + "P".Length;
                            goto Label_07C0;

                        case "N":
                            str        = str + "{0}";
                            flag4      = true;
                            num4       = 1;
                            pageNumber = PageInfoType.PageCount;
                            startIndex = (length + "&".Length) + "N".Length;
                            goto Label_07C0;

                        case "G":
                            if (image != null)
                            {
                                flag4 = true;
                                num4  = 0;
                                flag5 = true;
                            }
                            startIndex = (length + "&".Length) + "G".Length;
                            goto Label_07C0;

                        case "F":
                            str        = str + rLabel.WorkbookName;
                            startIndex = (length + "&".Length) + "F".Length;
                            goto Label_07C0;

                        case "A":
                            str        = str + rLabel.WorksheetName;
                            startIndex = (length + "&".Length) + "A".Length;
                            goto Label_07C0;

                        default:
                            goto Label_079D;
                        }
                        if (!ThemeColorRegex.Match(source.Substring(length)).Success)
                        {
                            goto Label_079D;
                        }
                        foregroundNext = rLabel.Foreground;
                        flag4          = true;
                        num4           = 0;
                        startIndex     = ((length + "&".Length) + "K".Length) + 5;
                        goto Label_07C0;
Label_04DA:
                        if (single == UnderlineType.Single)
                        {
                            single = UnderlineType.None;
                        }
Label_04E2:
                        flag4      = true;
                        num4       = 0;
                        startIndex = (length + "&".Length) + "U".Length;
                        goto Label_07C0;
Label_079D:
                        startIndex = length + "&".Length;
                    }
                    catch
                    {
                        startIndex = length + "&".Length;
                    }
Label_07C0:
                    if (startIndex >= source.Length)
                    {
                        source = string.Empty;
                    }
                    else
                    {
                        source = source.Substring(startIndex);
                    }
                    if (!string.IsNullOrEmpty(str) && (flag4 || string.IsNullOrEmpty(source)))
                    {
                        GcLabel label = null;
                        switch (num4)
                        {
                        case 0:
                            label = new GcLabel(str);
                            break;

                        case 1:
                        {
                            GcPageInfo info = new GcPageInfo
                            {
                                Format = str,
                                Type   = pageNumber
                            };
                            label = info;
                            break;
                        }
                        }
                        label.CanGrow    = false;
                        label.CanShrink  = false;
                        label.Foreground = foreground;
                        if ((((font.FontFamilyName != fontName) || (font.Strikeout != isStrikethrough)) || ((font.FontSize != fontSize) || (font.Underline != underlineType))) || ((font.Bold != isBold) || (font.Italic != isItalic)))
                        {
                            font           = new Font(fontName, fontSize);
                            font.Strikeout = isStrikethrough;
                            font.Bold      = isBold;
                            font.Italic    = isItalic;
                            font.Underline = underlineType;
                        }
                        label.Alignment.WordWrap = false;
                        label.Font = font;
                        list.Add(label);
                        str = string.Empty;
                    }
                    if (flag5 && (image != null))
                    {
                        GcImage image2 = new GcImage(image);
                        list.Add(image2);
                        flag5 = false;
                    }
                    fontName        = str2;
                    isStrikethrough = flag;
                    fontSize        = num;
                    underlineType   = single;
                    isBold          = flag2;
                    isItalic        = flag3;
                    foreground      = foregroundNext;
                }
            }
            return(list);
        }
Example #16
0
 public UnderlineDecorator(TextBlock decoratedTextBlock, UnderlineType underline) : base(decoratedTextBlock)
 {
     Underline = underline;
 }