Ejemplo n.º 1
0
 protected override void Dispose(bool disposing)
 {
     if (sBrushes != null)
     {
         sBrushes.Clear();
     }
     sBrushes = null;
     if (disposing && (this.m_list != null))
     {
         this.m_list.Dispose();
         this.m_list = null;
     }
     this.m_items = null;
     this.m_tsCurrent = null;
     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;
     if (this.m_dbConnector != null)
     {
         this.m_dbConnector.Dispose();
         this.m_dbConnector = null;
     }
     this.ButtonClick = null;
     this.CellClick = null;
     this.LinkClick = null;
     this.DropDown = null;
     this.DropDownClosed = null;
     this.SelectedIndexChanged = null;
     this.SelectedValueChanged = null;
     this.ValueMemberChanged = null;
     this.DisplayMemberChanged = null;
     Utility.Dispose();
     Links.Dispose();
     Resco.Controls.AdvancedComboBox.Mapping.DisposeEmptyMapping();
     ImageCache.GlobalCache.Clear();
     GC.Collect();
     base.Dispose(disposing);
 }
Ejemplo n.º 2
0
 public AdvancedComboBox()
 {
     this.OnChangeHandler = new OnChangeDelegate(this.OnChangeSafe);
     this.OnItemRemovedHandler = new OnItemRemovedDelegate(this.OnItemRemovedSafe);
     base.AutoScroll = false;
     base.Size = new Size(100, 0x12);
     this.m_dbConnector = new Resco.Controls.AdvancedComboBox.DataConnector();
     this.m_connector = this.m_dbConnector;
     this.m_bKeyNavigation = true;
     this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.m_list = new AdvancedList(this);
     this.m_list.Capture = false;
     this.m_list.Visible = false;
     this.m_list.TouchScrolling = false;
     this.m_list.BorderStyle = this.BorderStyle;//.set_BorderStyle(this.BorderStyle);
     this.m_list.Size = new Size(0, 0);
     this.m_list.ItemSelect += new ItemEventHandler(this.OnItemSelect);
     this.m_list.Changed += new ComboBoxEventHandler(this.OnChange);
     this.SelectedIndexChanged = null;
     this.SelectedValueChanged = null;
     this.ValueMemberChanged = null;
     this.DisplayMemberChanged = null;
     this.m_items = new ItemCollection(this);
     this.m_items.Changed += new ComboBoxEventHandler(this.OnChange);
     this.m_iExpectedItems = -1;
     this.m_nItemsLoaded = 0;
     this.m_nItemsInserted = 0;
     this.m_selectedItemIndex = -1;
     this.m_iSelectedCellIndex = -1;
     this.m_valueMember = "";
     this.m_displayMember = "";
     this.m_tsCurrent = new TemplateSet();
     this.m_tsCurrent.Parent = this;
     this.m_tsCurrent.Changed += new ComboBoxEventHandler(this.OnChange);
     this.m_textBoxTemplateIndex = 0;
     this.m_templateIndex = 0;
     this.m_selectedTemplateIndex = 0;
     this.m_alternateTemplateIndex = -1;
     this.m_grBackBuffer = null;
     this.m_backBuffer = null;
     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);
     this.UpdateDoubleBuffering();
     base.BackColor = SystemColors.ControlLight;
     this.m_BackColor = new SolidBrush(this.BackColor);
     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;
     point1 = new Point(0, 0);
     point2 = new Point(0, -TooltipWidth);
     point3 = new Point(-TooltipWidth, 0);
     this.CalculateTextBoxArea();
 }