public void DrawGroupLine(NodeRendererEventArgs e)
        {
            Color lineColor = e.Color;
            Node node = e.Node;

            if (lineColor.IsEmpty || lineColor.A == 0 || node.Cells.Count == 0) return;
            Graphics g = e.Graphics;

            Rectangle r = node.Bounds;
            
            Cell lastCell = node.Cells[node.Cells.Count - 1];
            if (lastCell.CheckBoxVisible && CellLayout.GetCheckBoxHorizontalAlign(lastCell.CheckBoxAlignment, true, eView.Tile) == eHorizontalAlign.Right)
            {
                r.Width -= (lastCell.CheckBoxBounds.Right - r.X) + LineMargin;
                r.X = lastCell.CheckBoxBounds.Right + LineMargin;
            }
            else if (!lastCell.ImageBoundsRelative.IsEmpty && CellLayout.GetHorizontalAlign(lastCell.ImageAlignment, true, eView.Tile) == eHorizontalAlign.Right)
            {
                r.Width -= (lastCell.ImageBounds.Right - r.X) + LineMargin;
                r.X = lastCell.ImageBounds.Right + LineMargin;
            }
            else if (e.Style.TextAlignment == eStyleTextAlignment.Near)
            {
                Rectangle textBounds = lastCell.TextBounds;
                if (lastCell.TextMarkupBody == null)
                    textBounds.Width = TextDrawing.MeasureString(g, lastCell.Text, e.Style.Font).Width;
                r.Width -= (textBounds.Right - r.X) + LineMargin;
                r.X = textBounds.Right + LineMargin;
            }
            else 
                return;

            using (Pen pen = new Pen(lineColor, 1))
            {
                g.DrawLine(pen, r.X, r.Y + r.Height / 2, r.Right, r.Y + r.Height / 2);
            }
        }
示例#2
0
		/// <summary>
		/// Raises RenderNodeBackground event.
		/// </summary>
		/// <param name="e">Event arguments.</param>
		protected virtual void OnRenderNodeBackground(NodeRendererEventArgs e)
		{
			if(RenderNodeBackground!=null)
				RenderNodeBackground(this,e);
		}
示例#3
0
		/// <summary>
		/// Draws node background. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
		/// do not want default rendering to occur do not call the base implementation. You can call OnRenderNodeBackground method so events can occur.
		/// </summary>
		/// <param name="e">Information provided for rendering.</param>
		public virtual void DrawNodeBackground(NodeRendererEventArgs e)
		{
			OnRenderNodeBackground(e);
		}
示例#4
0
 /// <summary>
 /// Raises RenderNodeBackground event.
 /// </summary>
 /// <param name="e">Event arguments.</param>
 protected virtual void OnRenderTileGroupLine(NodeRendererEventArgs e)
 {
     if (RenderTileGroupLine != null)
         RenderTileGroupLine(this, e);
 }
示例#5
0
 /// <summary>
 /// Draws node group line when in tile view. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
 /// do not want default rendering to occur do not call the base implementation. You can call OnRenderTileGroupLine method so events can occur.
 /// </summary>
 /// <param name="e">Information provided for rendering.</param>
 public virtual void DrawTileGroupLine(NodeRendererEventArgs e)
 {
     OnRenderTileGroupLine(e);
 }