示例#1
0
 public CustomizeCellEventArgs(Resco.Controls.AdvancedComboBox.Cell cell, object data, ListItem dataItem)
 {
     this.m_cell = cell.Clone();
     this.m_cell.Owner = cell.Owner;
     this.m_data = data;
     this.m_dataItem = dataItem;
 }
示例#2
0
 public CellEventArgs(ListItem i, Resco.Controls.AdvancedComboBox.Cell c, int ii, int ci, int yoff)
     : base(i, ii, yoff)
 {
     this.CellIndex = ci;
     this.Cell = c;
     if (c != null)
     {
         this.CellData = c[i, ci];
     }
     else
     {
         this.CellData = null;
     }
 }
示例#3
0
 public LinkEventArgs(ListItem item, Cell c, int ri, int ci, int yoff)
     : base(item, c, ri, ci, yoff)
 {
     this.Target = ((LinkCell) base.Cell).GetLink(base.CellData);
 }
示例#4
0
 public ListItem(ListItem toCopy)
     : this(toCopy.TemplateIndex, toCopy.SelectedTemplateIndex, toCopy.AlternateTemplateIndex, toCopy.TextBoxTemplateIndex, toCopy, toCopy.FieldNames)
 {
 }
示例#5
0
 public int Add(ListItem item)
 {
     if (item.Parent != null)
     {
         throw new ApplicationException("ListItem can't be in more collections");
     }
     return base.List.Add(item);
 }
示例#6
0
 protected override void OnRemoveComplete(int index, object value)
 {
     base.OnRemoveComplete(index, value);
     for (int i = index; i < base.Count; i++)
     {
         ListItem item1 = this[i];
         item1.m_index--;
     }
     ListItem item = value as ListItem;
     if (item != null)
     {
         if (this.Parent != null)
         {
             this.Parent.OnItemRemoved(item, index);
         }
         item.Parent = null;
         if (this.m_selectedItem == item)
         {
             this.m_selectedItem = null;
         }
     }
 }
示例#7
0
 protected override void OnClearComplete()
 {
     base.OnClearComplete();
     this.LastDrawnItem = 0;
     this.LastDrawnItemOffset = 0;
     this.m_selectedItem = null;
     if (this.m_parent != null)
     {
         this.m_parent.OnClear(this);
     }
     this.OnChanged(this, ComboBoxEventArgsType.Refresh, ComboBoxArgs.Default);
 }
示例#8
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)));
        }
示例#9
0
 internal ItemTemplate GetTemplate(ListItem item, int ix)
 {
     TemplateSet templates = this.m_parent.Templates;
     int count = templates.Count;
     if ((ix < 0) || (ix >= count))
     {
         return this.m_parent.DefaultTemplates[item.Selected ? 1 : 0];
     }
     return templates[ix];
 }
示例#10
0
 internal ItemTemplate GetTemplate(ListItem item)
 {
     TemplateSet templates = this.m_parent.Templates;
     int count = templates.Count;
     int currentTemplateIndex = item.CurrentTemplateIndex;
     if ((currentTemplateIndex < 0) || (currentTemplateIndex >= count))
     {
         return this.m_parent.DefaultTemplates[item.Selected ? 1 : 0];
     }
     return templates[currentTemplateIndex];
 }
示例#11
0
 public void Remove(ListItem item)
 {
     base.List.Remove(item);
 }
示例#12
0
 public void Insert(int index, ListItem item)
 {
     if (item.Parent != null)
     {
         throw new ApplicationException("ListItem can't be in more collections");
     }
     base.List.Insert(index, item);
 }
示例#13
0
 public int IndexOf(ListItem item)
 {
     return base.List.IndexOf(item);
 }
示例#14
0
 public bool Contains(ListItem value)
 {
     return base.List.Contains(value);
 }