示例#1
0
        internal int Draw(Graphics gr, TemplateSet ts, int xOffset, int width, int yOffset, int ymax, int iRow, int iRowOffset, ref bool resetScrollbar)
        {
            int num   = yOffset + iRowOffset;
            int count = base.List.Count;

            this.LastDrawnRowOffset = num;
            this.LastDrawnRow       = iRow;
            while (this.LastDrawnRow < count)
            {
                Row row = null;
                if ((this.LastDrawnRow >= 0) && (this.LastDrawnRow < base.InnerList.Count))
                {
                    row = base.InnerList[this.LastDrawnRow] as Row;
                }
                if (row != null)
                {
                    RowTemplate template = row.GetTemplate(ts);
                    int         height   = 0;
                    int         num4     = -1;
                    if (template.CustomizeCells(row))
                    {
                        num4 = template.GetHeight(row);
                        row.ResetCachedBounds();
                    }
                    height = template.GetHeight(row);
                    if ((num4 >= 0) && (height != num4))
                    {
                        resetScrollbar = true;
                    }
                    if ((num + height) >= 0)
                    {
                        template.Draw(gr, xOffset, num, row, width, height);
                    }
                    this.LastDrawnRowOffset = num;
                    num += height;
                    if (this.m_bDrawGrid)
                    {
                        gr.DrawLine(this.m_penBorder, xOffset, num, width + xOffset, num);
                        num++;
                    }
                    if (num > ymax)
                    {
                        return(num);
                    }
                }
                this.LastDrawnRow++;
            }
            this.LastDrawnRowOffset = num;
            return(num);
        }
示例#2
0
        internal void OnRowChange(object sender, RowEventArgsType e, object oParam)
        {
            object      obj2     = oParam;
            Row         r        = (Row)sender;
            RowTemplate template = this.GetTemplate(r);

            switch (e)
            {
            case RowEventArgsType.Selection:
            {
                if (!r.Selected)
                {
                    if (this.m_cSelected > 0)
                    {
                        this.m_cSelected--;
                    }
                    if (r != this.m_rActive)
                    {
                        break;
                    }
                    this.m_rActive = null;
                    return;
                }
                bool flag = (bool)oParam;
                if (this.m_rActive != null)
                {
                    this.m_rActive.ChangeSelection(this.Parent.MultiSelect, false, false);
                }
                if (!flag)
                {
                    this.m_cSelected = this.m_pParent.MultiSelect ? (this.m_cSelected + 1) : 1;
                }
                this.m_rActive = r;
                return;
            }

            case RowEventArgsType.TemplateIndex:
            {
                int num = 0;
                num = -this.GetTemplate(r, (int)oParam).GetHeight(r);
                r.ResetCachedBounds();
                num += template.GetHeight(r);
                this.OnChanged(base.List.IndexOf(r), GridEventArgsType.Resize, num);
                return;
            }

            default:
                if (template.AutoHeight)
                {
                    int actualHeight = r.ActualHeight;
                    r.ResetCachedBounds();
                    int height = template.GetHeight(r);
                    if (height != actualHeight)
                    {
                        this.OnChanged(base.List.IndexOf(r), GridEventArgsType.Resize, height - actualHeight);
                        return;
                    }
                }
                this.Changed(base.List.IndexOf(sender), GridEventArgsType.RowChange, obj2);
                break;
            }
        }
示例#3
0
 private int CustomizeHeaderFooter(RowTemplate t, Row r, ref bool bResetScrollbar)
 {
     int num2 = -1;
     if (t.CustomizeCells(r))
     {
         num2 = t.GetHeight(r);
         r.ResetCachedBounds();
     }
     int height = t.GetHeight(r);
     if ((num2 >= 0) && (height != num2))
     {
         bResetScrollbar = true;
     }
     return height;
 }