Ejemplo n.º 1
0
 internal void OnChanged(object sender, ComboBoxEventArgsType e, ComboBoxArgs args)
 {
     if (this.Changed != null)
     {
         this.Changed(sender, e, args);
     }
 }
Ejemplo n.º 2
0
 protected virtual void OnItemChanged(object sender, ItemEventArgsType e, ComboBoxArgs args)
 {
     this.ResetCachedBounds();
     if (this.ItemChanged != null)
     {
         this.ItemChanged(sender, e, args);
     }
 }
Ejemplo n.º 3
0
        internal void OnItemChange(object sender, ItemEventArgsType e, ComboBoxArgs args)
        {
            ListItem     item     = (ListItem)sender;
            ItemTemplate template = this.GetTemplate(item);

            switch (e)
            {
            case ItemEventArgsType.Selection:
                if (this.m_selectedItem != null)
                {
                    ListItem selectedItem = this.m_selectedItem;
                    this.m_selectedItem = null;
                    if (selectedItem != item)
                    {
                        selectedItem.Selected = false;
                    }
                }
                this.m_selectedItem = item;
                return;

            case ItemEventArgsType.TemplateIndex:
            {
                ComboBoxIndexChangedArgs args2 = args as ComboBoxIndexChangedArgs;
                if (args2 == null)
                {
                    throw new ArgumentException("Wrong argument type. args must be of type ComboBoxIndexChangedArgs.", "args");
                }
                int d = -this.GetTemplate(item, args2.OldTemplateIndex).GetHeight(item);
                item.ResetCachedBounds();
                d += template.GetHeight(item);
                this.OnChanged(this, ComboBoxEventArgsType.Resize, new ComboBoxScrollArgs(d, base.List.IndexOf(item)));
                return;
            }
            }
            if (template.AutoHeight)
            {
                int actualHeight = item.ActualHeight;
                item.ResetCachedBounds();
                int height = template.GetHeight(item);
                if (height != actualHeight)
                {
                    this.OnChanged(this, ComboBoxEventArgsType.Resize, new ComboBoxScrollArgs(height - actualHeight, base.List.IndexOf(item)));
                    return;
                }
            }
            this.OnChanged(this, ComboBoxEventArgsType.ItemChange, new ComboBoxScrollArgs(0, base.List.IndexOf(item)));
        }
Ejemplo n.º 4
0
 internal virtual void OnChange(object sender, ComboBoxEventArgsType e, ComboBoxArgs args)
 {
     if (this.Changed != null)
     {
         this.Changed(sender, e, args);
     }
 }
Ejemplo n.º 5
0
 protected virtual void OnItemChanged(object sender, ItemEventArgsType e, ComboBoxArgs args)
 {
     this.ResetCachedBounds();
     if (this.ItemChanged != null)
     {
         this.ItemChanged(sender, e, args);
     }
 }
Ejemplo n.º 6
0
        internal void OnItemChange(object sender, ItemEventArgsType e, ComboBoxArgs args)
        {
            ListItem item = (ListItem) sender;
            ItemTemplate template = this.GetTemplate(item);
            switch (e)
            {
                case ItemEventArgsType.Selection:
                    if (this.m_selectedItem != null)
                    {
                        ListItem selectedItem = this.m_selectedItem;
                        this.m_selectedItem = null;
                        if (selectedItem != item)
                        {
                            selectedItem.Selected = false;
                        }
                    }
                    this.m_selectedItem = item;
                    return;

                case ItemEventArgsType.TemplateIndex:
                {
                    ComboBoxIndexChangedArgs args2 = args as ComboBoxIndexChangedArgs;
                    if (args2 == null)
                    {
                        throw new ArgumentException("Wrong argument type. args must be of type ComboBoxIndexChangedArgs.", "args");
                    }
                    int d = -this.GetTemplate(item, args2.OldTemplateIndex).GetHeight(item);
                    item.ResetCachedBounds();
                    d += template.GetHeight(item);
                    this.OnChanged(this, ComboBoxEventArgsType.Resize, new ComboBoxScrollArgs(d, base.List.IndexOf(item)));
                    return;
                }
            }
            if (template.AutoHeight)
            {
                int actualHeight = item.ActualHeight;
                item.ResetCachedBounds();
                int height = template.GetHeight(item);
                if (height != actualHeight)
                {
                    this.OnChanged(this, ComboBoxEventArgsType.Resize, new ComboBoxScrollArgs(height - actualHeight, base.List.IndexOf(item)));
                    return;
                }
            }
            this.OnChanged(this, ComboBoxEventArgsType.ItemChange, new ComboBoxScrollArgs(0, base.List.IndexOf(item)));
        }
Ejemplo n.º 7
0
        private void OnChangeSafe(object sender, ComboBoxEventArgsType e, ComboBoxArgs args)
        {
            if (this.m_iUpdateCounter <= 0)
            {
                if ((args.UpdateRange & ComboBoxUpdateRange.Box) != ((ComboBoxUpdateRange) 0))
                {
                    switch (e)
                    {
                        case ComboBoxEventArgsType.Repaint:
                            this.m_bIsChange = true;
                            break;

                        case ComboBoxEventArgsType.Refresh:
                        {
                            ComboBoxRefreshArgs args2 = args as ComboBoxRefreshArgs;
                            if (args2 != null)
                            {
                                if (((this.m_textBoxItem != null) && args2.ResetBounds) && ((args2.Template == null) || (args2.Template == this.TextBoxTemplate)))
                                {
                                    this.m_textBoxItem.ResetCachedBounds();
                                }
                                this.CalculateTextBoxArea();
                                this.m_bIsChange = true;
                            }
                            break;
                        }
                    }
                    base.Invalidate();
                }
                if (((args.UpdateRange & ComboBoxUpdateRange.List) != ((ComboBoxUpdateRange) 0)) && (this.m_list != null))
                {
                    this.m_list.OnListChange(sender, e, args);
                }
            }
        }
Ejemplo n.º 8
0
 private void OnChange(object sender, ComboBoxEventArgsType e, ComboBoxArgs args)
 {
     if (this.InvokeRequired && (this.OnChangeHandler != null))
     {
         base.Invoke(this.OnChangeHandler, new object[] { sender, e, args });
     }
     else
     {
         this.OnChangeSafe(sender, e, args);
     }
 }