Ejemplo n.º 1
0
 private void LoadBorder(int startIndex, Border border)
 {
     if (UnitsConverter.ConvertBool(GetValueLL("Frame/Left/Line", startIndex)))
     {
         border.Lines         |= BorderLines.Left;
         border.LeftLine.Color = Color.FromName(GetValueLL("Frame/Left/Line/Color=LL.Color", startIndex));
         border.LeftLine.Style = UnitsConverter.ConvertLineType(GetValueLL("Frame/Left/Line/LineType", startIndex));
         border.LeftLine.Width = UnitsConverter.LLUnitsToPixels(GetValueLL("Frame/Left/LineWidth", startIndex));
     }
     if (UnitsConverter.ConvertBool(GetValueLL("Frame/Top/Line", startIndex)))
     {
         border.Lines        |= BorderLines.Top;
         border.TopLine.Color = Color.FromName(GetValueLL("Frame/Top/Line/Color=LL.Color", startIndex));
         border.TopLine.Style = UnitsConverter.ConvertLineType(GetValueLL("Frame/Top/Line/LineType", startIndex));
         border.TopLine.Width = UnitsConverter.LLUnitsToPixels(GetValueLL("Frame/Top/LineWidth", startIndex));
     }
     if (UnitsConverter.ConvertBool(GetValueLL("Frame/Right/Line", startIndex)))
     {
         border.Lines          |= BorderLines.Right;
         border.RightLine.Color = Color.FromName(GetValueLL("Frame/Right/Line/Color=LL.Color", startIndex));
         border.RightLine.Style = UnitsConverter.ConvertLineType(GetValueLL("Frame/Right/Line/LineType", startIndex));
         border.RightLine.Width = UnitsConverter.LLUnitsToPixels(GetValueLL("Frame/Right/LineWidth", startIndex));
     }
     if (UnitsConverter.ConvertBool(GetValueLL("Frame/Bottom/Line", startIndex)))
     {
         border.Lines           |= BorderLines.Bottom;
         border.BottomLine.Color = Color.FromName(GetValueLL("Frame/Bottom/Line/Color=LL.Color", startIndex));
         border.BottomLine.Style = UnitsConverter.ConvertLineType(GetValueLL("Frame/Bottom/Line/LineType", startIndex));
         border.BottomLine.Width = UnitsConverter.LLUnitsToPixels(GetValueLL("Frame/Bottom/LineWidth", startIndex));
     }
 }
Ejemplo n.º 2
0
        private void LoadPictureObject(int startIndex, PictureObject pictureObj)
        {
            LoadComponent(startIndex, pictureObj);
            if (UnitsConverter.ConvertBool(GetValueLL("OriginalSize", startIndex)))
            {
                pictureObj.SizeMode = PictureBoxSizeMode.Normal;
            }
            if (Convert.ToInt32(GetValueLL("Alignment", startIndex)) == 0)
            {
                pictureObj.SizeMode = PictureBoxSizeMode.CenterImage;
            }
            if (UnitsConverter.ConvertBool(GetValueLL("bIsotropic", startIndex)))
            {
                pictureObj.SizeMode = PictureBoxSizeMode.AutoSize;
            }
            else
            {
                pictureObj.SizeMode = PictureBoxSizeMode.StretchImage;
            }
            string filename = GetValueLL("Filename", startIndex);

            if (filename.Equals("<embedded>"))
            {
                // cant find an encoding that use l&l for store images
            }
            else if (!String.IsNullOrEmpty(filename))
            {
                pictureObj.ImageLocation = filename;
            }
            LoadBorder(startIndex, pictureObj.Border);
        }
Ejemplo n.º 3
0
        private Font LoadFont(int startIndex)
        {
            int index = textLL.IndexOf("[Font]", startIndex);
            //if (!UnitsConverter.ConvertBool(GetValueLL("Default", index)))
            //{
            string fontFamily = RemoveQuotes(GetValueLL("FaceName", index));
            float  fontSize   = defaultFont.Size;

            if (GetValueLL("Size", index) != "Null()")
            {
                fontSize = Convert.ToSingle(GetValueLL("Size", index).Replace('.', ','));
            }
            FontStyle fontStyle = FontStyle.Regular;

            if (UnitsConverter.ConvertBool(GetValueLL("Bold", index)))
            {
                fontStyle |= FontStyle.Bold;
            }
            if (UnitsConverter.ConvertBool(GetValueLL("Italic", index)))
            {
                fontStyle |= FontStyle.Italic;
            }
            if (UnitsConverter.ConvertBool(GetValueLL("Underline", index)))
            {
                fontStyle |= FontStyle.Underline;
            }
            if (UnitsConverter.ConvertBool(GetValueLL("Strikeout", index)))
            {
                fontStyle |= FontStyle.Strikeout;
            }
            return(new Font(fontFamily == "Null()" ? defaultFont.FontFamily.Name : fontFamily, fontSize, fontStyle));
            //}
        }
Ejemplo n.º 4
0
        private void LoadDefaultFont()
        {
            string defFontStr = GetValueLL("DefFont=");

            string[] defFontParts = defFontStr.Split(',');
            defFontParts[0]  = defFontParts[0][1].ToString();
            defFontParts[2]  = defFontParts[2][0].ToString();
            defaultTextColor = Color.FromArgb(int.Parse(defFontParts[0]), int.Parse(defFontParts[1]), int.Parse(defFontParts[2]));
            float fontsize = Convert.ToSingle(defFontParts[3].Replace('.', ','));

            defaultFont = new Font(defFontParts.Last().Trim('}'), fontsize, FontStyle.Regular);
            return;

            if (UnitsConverter.ConvertBool(GetValueLL("DefaultFont/Default")))
            {
                string fontFamily = GetValueLL("DefaultFont/FaceName");
                float  fontSize   = DrawUtils.DefaultReportFont.Size;
                try
                {
                    fontSize = Convert.ToSingle(GetValueLL("DefaultFont/Size"));
                }
                catch
                {
                    fontSize = DrawUtils.DefaultReportFont.Size;
                }
                FontStyle fontStyle = FontStyle.Regular;
                if (UnitsConverter.ConvertBool(GetValueLL("DefaultFont/Bold")))
                {
                    fontStyle |= FontStyle.Bold;
                }
                if (UnitsConverter.ConvertBool(GetValueLL("DefaultFont/Italic")))
                {
                    fontStyle |= FontStyle.Italic;
                }
                if (UnitsConverter.ConvertBool(GetValueLL("DefaultFont/Underline")))
                {
                    fontStyle |= FontStyle.Underline;
                }
                if (UnitsConverter.ConvertBool(GetValueLL("DefaultFont/Strikeout")))
                {
                    fontStyle |= FontStyle.Strikeout;
                }
                defaultFont      = new Font(fontFamily, fontSize, fontStyle);
                defaultTextColor = Color.FromName(GetValueLL("DefaultFont/Color=LL.Color"));
            }
        }