Inheritance: System.EventArgs
示例#1
0
 protected virtual void OnDisabledItemSelected(object sender, IndexEventArgs e)
 {
     if (DisabledItemSelected != null)
     {
         DisabledItemSelected(sender, e);
     }
 }
示例#2
0
        protected override void OnSelectedIndexChanged(EventArgs e)
        {
            int currentSelectedIndex = SelectedIndex;
            List<int> selectedDisabledIndices = new List<int>();

            for (int i = 0; i < SelectedIndices.Count; i++)
            {
                if (disabledIndices.Contains(SelectedIndices[i]))
                {
                    selectedDisabledIndices.Add(SelectedIndices[i]);
                    SelectedIndices.Remove(SelectedIndices[i]);
                }
            }
            foreach (int index in selectedDisabledIndices)
            {
                IndexEventArgs args = new IndexEventArgs(index);
                OnDisabledItemSelected(this, args);
            }
            if (currentSelectedIndex == SelectedIndex)
                base.OnSelectedIndexChanged(e);
        }