Пример #1
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);
 }
Пример #2
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);
 }