Beispiel #1
0
        public virtual TemplateSet Clone()
        {
            TemplateSet set = new TemplateSet();

            foreach (RowTemplate template in base.List)
            {
                set.Add(template);
            }
            return(set);
        }
Beispiel #2
0
        internal RowTemplate GetTemplate(TemplateSet ts)
        {
            int currentTemplateIndex = this.CurrentTemplateIndex;

            if ((currentTemplateIndex >= 0) && (currentTemplateIndex < ts.Count))
            {
                return(ts[currentTemplateIndex]);
            }
            return(RowTemplate.Default);
        }
Beispiel #3
0
        internal int GetHeight(TemplateSet ts)
        {
            int currentTemplateIndex = this.CurrentTemplateIndex;

            if ((currentTemplateIndex >= 0) && (currentTemplateIndex < ts.Count))
            {
                return(ts[currentTemplateIndex].GetHeight(this));
            }
            return(RowTemplate.Default.Height);
        }
Beispiel #4
0
        internal RowTemplate GetTemplate(Row r, int ix)
        {
            TemplateSet templates = this.m_pParent.Templates;
            int         count     = templates.Count;

            if ((ix >= 0) && (ix < count))
            {
                return(templates[ix]);
            }
            return(RowTemplate.Default);
        }
Beispiel #5
0
        internal RowTemplate GetTemplate(Row r)
        {
            TemplateSet templates            = this.m_pParent.Templates;
            int         count                = templates.Count;
            int         currentTemplateIndex = r.CurrentTemplateIndex;

            if ((currentTemplateIndex >= 0) && (currentTemplateIndex < count))
            {
                return(templates[currentTemplateIndex]);
            }
            return(RowTemplate.Default);
        }
Beispiel #6
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);
        }
Beispiel #7
0
        internal int GetHeight(int i, TemplateSet ts)
        {
            if ((i < 0) || (i >= base.List.Count))
            {
                return(0);
            }
            Row         row      = (Row)base.InnerList[i];
            RowTemplate template = ts[row.CurrentTemplateIndex];

            if (template == null)
            {
                template = RowTemplate.Default;
            }
            if (this.m_bDrawGrid)
            {
                return(template.GetHeight(row) + 1);
            }
            return(template.GetHeight(row));
        }
Beispiel #8
0
 internal int GetHeight(int i, TemplateSet ts)
 {
     if ((i < 0) || (i >= base.List.Count))
     {
         return 0;
     }
     Row row = (Row) base.InnerList[i];
     RowTemplate template = ts[row.CurrentTemplateIndex];
     if (template == null)
     {
         template = RowTemplate.Default;
     }
     if (this.m_bDrawGrid)
     {
         return (template.GetHeight(row) + 1);
     }
     return template.GetHeight(row);
 }
Beispiel #9
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;
 }
Beispiel #10
0
 internal RowTemplate GetTemplate(TemplateSet ts)
 {
     int currentTemplateIndex = this.CurrentTemplateIndex;
     if ((currentTemplateIndex >= 0) && (currentTemplateIndex < ts.Count))
     {
         return ts[currentTemplateIndex];
     }
     return RowTemplate.Default;
 }
Beispiel #11
0
 internal int GetHeight(TemplateSet ts)
 {
     int currentTemplateIndex = this.CurrentTemplateIndex;
     if ((currentTemplateIndex >= 0) && (currentTemplateIndex < ts.Count))
     {
         return ts[currentTemplateIndex].GetHeight(this);
     }
     return RowTemplate.Default.Height;
 }
Beispiel #12
0
 public virtual TemplateSet Clone()
 {
     TemplateSet set = new TemplateSet();
     foreach (RowTemplate template in base.List)
     {
         set.Add(template);
     }
     return set;
 }
Beispiel #13
0
 protected override void Dispose(bool disposing)
 {
     if (this.m_TouchScrollingTimer != null)
     {
         this.m_TouchScrollingTimer.Dispose();
         this.m_TouchScrollingTimer = null;
     }
     if (this.m_dbConnector != null)
     {
         this.m_dbConnector.Dispose();
         this.m_dbConnector = null;
     }
     if (this.m_rcRows != null)
     {
         this.m_rcRows.Parent = null;
     }
     this.m_rcRows = null;
     if (this.m_tsCurrent != null)
     {
         this.m_tsCurrent.Changed -= new GridEventHandler(this.OnChange);
         this.m_tsCurrent.Parent = null;
     }
     this.m_tsCurrent = null;
     BackBufferManager.Release();
     if (this.m_alLinks != null)
     {
         this.m_alLinks.Clear();
     }
     this.m_alLinks = null;
     if (this.m_alTooltips != null)
     {
         this.m_alTooltips.Clear();
     }
     this.m_alTooltips = null;
     if (this.m_alButtons != null)
     {
         this.m_alButtons.Clear();
     }
     this.m_alButtons = null;
     Utility.Dispose();
     Resco.Controls.AdvancedList.Mapping.DisposeEmptyMapping();
     RowTemplate.DisposeDefaultRowTemplate();
     ImageCache.GlobalCache.Clear();
     if (sBrushes != null)
     {
         sBrushes.Clear();
     }
     sBrushes = null;
     this.RemoveActiveHandlers();
     if (this.m_rHeader != null)
     {
         this.m_rHeader.Parent = null;
     }
     this.m_rHeader = null;
     if (this.m_rFooter != null)
     {
         this.m_rFooter.Parent = null;
     }
     this.m_rFooter = null;
     this.OnChangeHandler = null;
     this.OnRowRemovedHandler = null;
     if (this.m_gradientBackColor != null)
     {
         this.m_gradientBackColor.PropertyChanged -= new EventHandler(this.m_gradientBackColor_PropertyChanged);
     }
     this.m_gradientBackColor = null;
     if (sPen != null)
     {
         sPen.Dispose();
     }
     sPen = null;
     if (sPixel != null)
     {
         sPixel.Dispose();
     }
     sPixel = null;
     GC.Collect();
     base.Dispose(disposing);
 }
Beispiel #14
0
 public AdvancedList()
 {
     this.OnChangeHandler = new OnChangeDelegate(this.OnChangeSafe);
     this.OnRowRemovedHandler = new OnRowRemovedDelegate(this.OnRowRemovedSafe);
     this.m_templateIndex = 0;
     this.m_selectedTemplateIndex = 0;
     this.m_activeTemplateIndex = -1;
     this.m_alternateTemplateIndex = -1;
     this.m_dbConnector = new Resco.Controls.AdvancedList.DataConnector();
     this.m_connector = this.m_dbConnector;
     this.m_rcRows = new RowCollection(this);
     this.m_rcRows.Changed += new GridEventHandler(this.OnChange);
     this.m_tsCurrent = new TemplateSet();
     this.m_tsCurrent.Parent = this;
     this.m_tsCurrent.Changed += new GridEventHandler(this.OnChange);
     BackBufferManager.AddRef();
     this.m_colorKey = Color.FromArgb(0xff, 0, 0xff);
     this.m_brushKey = new SolidBrush(this.m_colorKey);
     this.m_imgAttr = new ImageAttributes();
     this.m_imgAttr.SetColorKey(this.m_colorKey, this.m_colorKey);
     base.BackColor = SystemColors.ControlDark;
     this.m_BackColor = new SolidBrush(this.BackColor);
     this.m_vScrollWidth = 0;
     this.m_iScrollWidth = 13;
     this.ButtonClick = null;
     this.LinkClick = null;
     this.CellClick = null;
     this.RowSelect = null;
     this.HeaderClick = null;
     this.ActiveRowChanged = null;
     this.Scroll = null;
     this.m_rHeader = new Resco.Controls.AdvancedList.HeaderRow();
     this.m_rHeader.Parent = this.m_rcRows;
     this.m_rFooter = new Resco.Controls.AdvancedList.HeaderRow();
     this.m_rFooter.Parent = this.m_rcRows;
     this.m_iActualRowIndex = 0;
     this.m_iTopmostRowOffset = 0;
     this.m_iDocumentHeight = 0;
     this.m_iExpectedRows = -1;
     this.m_iVScrollPrevValue = 0;
     this.m_toolTipType = Resco.Controls.AdvancedList.ToolTipType.Triangle;
     using (Graphics graphics = base.CreateGraphics())
     {
         TooltipWidth = (int) (DefaultTooltipWidth * (graphics.DpiX / 96f));
         point1 = new Point(0, 0);
         point2 = new Point(0, -TooltipWidth);
         point3 = new Point(-TooltipWidth, 0);
         this.m_ToolTip = null;
         this.m_scaleFactorY = graphics.DpiY / 96f;
     }
     this.m_Timer = new Timer();
     this.m_Timer.Enabled = false;
     this.m_Timer.Interval = 500;
     this.m_Timer.Tick += new EventHandler(this.OnTimerTick);
     this.m_bShowingToolTip = false;
     this.m_iSelectedCellIndex = -1;
     this.m_TouchScrollingTimer = new Timer();
     this.m_TouchScrollingTimer.Enabled = false;
     this.m_TouchScrollingTimer.Interval = 50;
     this.m_TouchScrollingTimer.Tick += new EventHandler(this.OnTouchScrollingTimerTick);
     this.m_bStartingTouchScroll = false;
     this.m_bEnableTouchScrolling = false;
     this.m_TouchAutoScrollDiff = 0;
     this.m_touchSensitivity = 8;
     this.m_touchScrollDirection = Resco.Controls.AdvancedList.TouchScrollDirection.Inverse;
     this.m_nRowsLoaded = 0;
     this.m_nRowsInserted = 0;
     this.m_bFocusOnClick = false;
     this.m_gradientBackColor = new GradientColor(FillDirection.Horizontal);
     this.m_gradientBackColor.PropertyChanged += new EventHandler(this.m_gradientBackColor_PropertyChanged);
 }