示例#1
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);
        }
示例#2
0
 private void LoadPageSettings()
 {
     page.PaperWidth  = UnitsConverter.LLUnitsToMillimeters(GetValueLL("PaperFormat.cx"));
     page.PaperHeight = UnitsConverter.LLUnitsToMillimeters(GetValueLL("PaperFormat.cy"));
     page.Landscape   = UnitsConverter.ConvertPaperOrientation(GetValueLL("PaperFormat.Orientation"));
     page.TopMargin   = page.LeftMargin = page.RightMargin = page.BottomMargin = 0.0f;
 }
示例#3
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));
     }
 }
示例#4
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));
            //}
        }
示例#5
0
        private void LoadShapeObject(int startIndex, ShapeObject shapeObj)
        {
            LoadComponent(startIndex, shapeObj);
            int colorIndex = textLL.IndexOf("FgColor", startIndex);

            if (colorIndex >= 0)
            {
                shapeObj.Border.Color = GetColorForShapeObject("FgColor", colorIndex);//Color.FromName(GetValueLL("FgColor=LL.Color", colorIndex));
                shapeObj.Border.Width = UnitsConverter.LLUnitsToPixels(GetValueLL("Width", colorIndex));
                shapeObj.Border.Style = UnitsConverter.ConvertLineType(GetValueLL("LineType", colorIndex));
                shapeObj.FillColor    = GetColorForShapeObject("BkColor", colorIndex);
            }
        }
示例#6
0
        private void LoadRectangle(int startIndex, ShapeObject shapeObj)
        {
            LoadShapeObject(startIndex, shapeObj);
            float curve = UnitsConverter.ConvertRounding(GetValueLL("Rounding", startIndex));

            if (curve == 0)
            {
                shapeObj.Shape = ShapeKind.Rectangle;
            }
            else
            {
                shapeObj.Shape = ShapeKind.RoundRectangle;
                shapeObj.Curve = curve;
            }
        }
示例#7
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"));
            }
        }
示例#8
0
        private void LoadLineObject(int startIndex, LineObject lineObj)
        {
            LoadComponent(startIndex, lineObj);
            int colorIndex = textLL.IndexOf("FgColor", startIndex);

            if (colorIndex >= 0)
            {
                lineObj.Border.Color = Color.FromName(GetValueLL("FgColor=LL.Color", colorIndex));
                lineObj.Border.Style = UnitsConverter.ConvertLineType(GetValueLL("LineType", colorIndex));
                lineObj.Border.Width = UnitsConverter.LLUnitsToPixels(GetValueLL("Width", colorIndex));
            }
            if (lineObj.Width > 0 || lineObj.Height > 0)
            {
                lineObj.Diagonal = true;
            }
            LoadBorder(startIndex, lineObj.Border);
        }
示例#9
0
        private void LoadComponent(int startIndex, ComponentBase comp)
        {
            try
            {
                comp.Name = GetValueLL("Identifier", startIndex);
                if (String.IsNullOrEmpty(comp.Name))
                {
                    comp.CreateUniqueName();
                }
            }
            catch (DuplicateNameException)
            {
                comp.CreateUniqueName();
            }

            comp.Left   = UnitsConverter.LLUnitsToPixels(GetValueLL("Position/Left", startIndex));
            comp.Top    = UnitsConverter.LLUnitsToPixels(GetValueLL("Position/Top", startIndex));
            comp.Width  = UnitsConverter.LLUnitsToPixels(GetValueLL("Position/Width", startIndex));
            comp.Height = UnitsConverter.LLUnitsToPixels(GetValueLL("Position/Height", startIndex));
        }
示例#10
0
        private void LoadTextObject(int startIndex, TextObject textObj)
        {
            // It can be an object without font and text. In list and labels it looks like a gray background
            if (textLL.IndexOf("[Font]", startIndex) == -1)
            {
                return;
            }
            LoadComponent(startIndex, textObj);
            textObj.Font      = LoadFont(startIndex);
            textObj.TextColor = defaultTextColor;
            int fontIndex = textLL.IndexOf("[Font]", startIndex);

            if (GetValueLL("Color", fontIndex) != "Null()")
            {
                textObj.TextColor = Color.FromName(GetValueLL("Color=LL.Color", fontIndex));
            }
            //if (!UnitsConverter.ConvertBool(GetValueLL("Default", fontIndex)))
            //{
            //    textObj.TextColor = Color.FromName(GetValueLL("Color=LL.Color.", fontIndex));
            //}
            textObj.HorzAlign = UnitsConverter.ConvertTextAlign(GetValueLL("Align", fontIndex));
            textObj.Text      = RemoveQuotes(GetValueLL("Text", fontIndex));
            LoadBorder(startIndex, textObj.Border);
        }