Exemple #1
0
 public static void DrawTable(XmlNode tableNode, Graphics g, int x, int y)
 {
     try
     {
         CommonDrawOp.DrawHead(tableNode, g, x, y);
         XmlCommomOp.SetXmlAttribute(tableNode, "left", string.Concat(x));
         XmlCommomOp.SetXmlAttribute(tableNode, "top", string.Concat(y));
         int         num        = y;
         XmlNode     xmlNode    = tableNode.SelectNodes("TableHead")[0];
         XmlNodeList childNodes = xmlNode.ChildNodes;
         for (int i = 0; i < childNodes.Count; i++)
         {
             num += int.Parse(childNodes[i].Attributes["height"].Value);
         }
         CommonDrawOp.DrawTableBody(tableNode, g, x, num);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #2
0
        public static bool DrawBorder(Graphics g, int _left, int _top, int _width, int _height, Border _border, out int _newleft, out int _newtop)
        {
            bool result;

            try
            {
                if (g == null)
                {
                    throw new NullReferenceException();
                }
                if (_border == null)
                {
                    throw new NullReferenceException();
                }
                _newleft = _left;
                _newtop  = _top;
                if (_border.IsDrawTop)
                {
                    CommonDrawOp.DrawLine(g, _left, _top, _left + _width, _top, _border.TopColor, _border.TopStyle, _border.TopWidth, out _newleft, out _newtop);
                }
                if (_border.IsDrawRight)
                {
                    CommonDrawOp.DrawLine(g, _left + _width, _top, _left + _width, _top + _height, _border.RightColor, _border.RightStyle, _border.RightWidth, out _newleft, out _newtop);
                }
                if (_border.IsDrawBottom)
                {
                    CommonDrawOp.DrawLine(g, _left, _top + _height, _left + _width, _top + _height, _border.BottomColor, _border.BottomStyle, _border.BottomWidth, out _newleft, out _newtop);
                }
                if (_border.IsDrawLeft)
                {
                    CommonDrawOp.DrawLine(g, _left, _top, _left, _top + _height, _border.LeftColor, _border.LeftStyle, _border.LeftWidth, out _newleft, out _newtop);
                }
                result = true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
Exemple #3
0
 public static bool DrawCircleString(Graphics g, string _content, int _left, int _top, int _width, int _height, FontColor _fontcolor, Color _circlecolor, out int _newleft, out int _newtop)
 {
     return(CommonDrawOp.DrawCircleString(g, _content, _left, _top, _width, _height, _fontcolor, _circlecolor, out _newleft, out _newtop, DrawType.Circle));
 }