Exemple #1
0
        public TextFormat GetFormat(double fontSize, Align a, Valign v)
        {
            var name = fontSize.ToString() + "|" + a.ToString() + "|" + v.ToString();

            if (Formats.ContainsKey(name))
            {
                return(Formats[name]);
            }
            if (fontSize <= 0)
            {
                fontSize = 16;
            }
            var format = new TextFormat(new SharpDX.DirectWrite.Factory(),
                                        "Calibri", (float)fontSize)
            {
                TextAlignment =
                    a == Align.Left ? TextAlignment.Leading :
                    a == Align.Right ? TextAlignment.Trailing :
                    TextAlignment.Center,
                ParagraphAlignment =
                    v == Valign.Top ? ParagraphAlignment.Near :
                    v == Valign.Bottom ? ParagraphAlignment.Far :
                    ParagraphAlignment.Center
            };

            Formats[name] = format;
            return(format);
        }
Exemple #2
0
        /// <summary>Assigns all needed attributes to the tag</summary>
        /// <returns>This instance downcasted to base class</returns>
        public virtual IndexedTag attr(
            string id = null,
            string @class = null,
            string style = null,
            string title = null,
            LangCode lang = null,
            string xmllang = null,
            Dir? dir = null,
            string onclick = null,
            string ondblclick = null,
            string onmousedown = null,
            string onmouseup = null,
            string onmouseover = null,
            string onmousemove = null,
            string onmouseout = null,
            string onkeypress = null,
            string onkeydown = null,
            string onkeyup = null,
            Align? align = null,
            char? @char = null,
            Length charoff = null,
            Valign? valign = null
        )
        {
            Id = id;
            Class = @class;
            Style = style;
            Title = title;
            Lang = lang;
            XmlLang = xmllang;
            Dir = dir;
            OnClick = onclick;
            OnDblClick = ondblclick;
            OnMouseDown = onmousedown;
            OnMouseUp = onmouseup;
            OnMouseOver = onmouseover;
            OnMouseMove = onmousemove;
            OnMouseOut = onmouseout;
            OnKeyPress = onkeypress;
            OnKeyDown = onkeydown;
            OnKeyUp = onkeyup;
            Align = align;
            Char = @char;
            CharOff = charoff;
            Valign = valign;

            return this;
        }
Exemple #3
0
        public override void FromTo(ShapeBase shape)
        {
            if (shape == null)
            {
                return;
            }
            base.FromTo(shape);
            ShapeTime other = shape as ShapeTime;

            if (other != null)
            {
                _displayFormat = other._displayFormat;
                _Align         = other._Align;

                _Valign        = other._Valign;
                FrameSizeFixed = other.FrameSizeFixed;
                FontSizeFixed  = other.FontSizeFixed;
            }
        }
        public override void FromTo(ShapeBase shape)
        {
            if (shape == null)
            {
                return;
            }
            base.FromTo(shape);
            ShapeDynamicTextBase other = shape as ShapeDynamicTextBase;

            if (other != null)
            {
                _Align = other._Align;
                //_BitCount = other._BitCount;
                _RollRate      = other._RollRate;
                _RollWay       = other._RollWay;
                _Valign        = other._Valign;
                FrameSizeFixed = other.FrameSizeFixed;
                FontSizeFixed  = other.FontSizeFixed;
            }
        }
Exemple #5
0
 public static TagTr valign(this TagTr tag, Valign value) { tag.Valign = value; return tag; }
Exemple #6
0
        /// <summary>Assigns all needed attributes to the tag</summary>
        /// <returns>This instance downcasted to base class</returns>
        public virtual IndexedTag attr(
            string abbr = null,
            string axis = null,
            string headers = null,
            Scope? scope = null,
            int? rowspan = null,
            int? colspan = null,
            string id = null,
            string @class = null,
            string style = null,
            string title = null,
            LangCode lang = null,
            string xmllang = null,
            Dir? dir = null,
            string onclick = null,
            string ondblclick = null,
            string onmousedown = null,
            string onmouseup = null,
            string onmouseover = null,
            string onmousemove = null,
            string onmouseout = null,
            string onkeypress = null,
            string onkeydown = null,
            string onkeyup = null,
            Align? align = null,
            char? @char = null,
            Length charoff = null,
            Valign? valign = null
        )
        {
            Abbr = abbr;
            Axis = axis;
            Headers = headers;
            Scope = scope;
            RowSpan = rowspan;
            ColSpan = colspan;
            Id = id;
            Class = @class;
            Style = style;
            Title = title;
            Lang = lang;
            XmlLang = xmllang;
            Dir = dir;
            OnClick = onclick;
            OnDblClick = ondblclick;
            OnMouseDown = onmousedown;
            OnMouseUp = onmouseup;
            OnMouseOver = onmouseover;
            OnMouseMove = onmousemove;
            OnMouseOut = onmouseout;
            OnKeyPress = onkeypress;
            OnKeyDown = onkeydown;
            OnKeyUp = onkeyup;
            Align = align;
            Char = @char;
            CharOff = charoff;
            Valign = valign;

            return this;
        }
 public static TagColGroup valign(this TagColGroup tag, Valign value) { tag.Valign = value; return tag; }
Exemple #8
0
 public static TagTfoot valign(this TagTfoot tag, Valign value)
 {
     tag.Valign = value; return(tag);
 }
Exemple #9
0
 public static TagTbody valign(this TagTbody tag, Valign value)
 {
     tag.Valign = value; return(tag);
 }
Exemple #10
0
 public static TagThead valign(this TagThead tag, Valign value)
 {
     tag.Valign = value; return(tag);
 }