Exemplo n.º 1
0
        protected override void OnItemsChanged(RadItem target, ItemsChangeOperation operation)
        {
            switch (operation)
            {
            case ItemsChangeOperation.Inserted:
            case ItemsChangeOperation.Set:
                target.SetOwnerCollection(this);
                break;

            case ItemsChangeOperation.Removed:
                target.SetOwnerCollection((RadItemOwnerCollection)null);
                break;

            case ItemsChangeOperation.Cleared:
                using (RadItemCollection.RadItemEnumerator enumerator = this.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        enumerator.Current.SetOwnerCollection((RadItemOwnerCollection)null);
                    }
                    break;
                }
            }
            if (this.owner != null && (this.owner.ElementState == ElementState.Disposing || this.owner.ElementState == ElementState.Disposed))
            {
                return;
            }
            base.OnItemsChanged(target, operation);
        }
Exemplo n.º 2
0
        private void OnItemsChanged(
            RadItemCollection changed,
            RadItem target,
            ItemsChangeOperation operation)
        {
            if (this.IsDisposing || this.IsDisposed)
            {
                return;
            }
            switch (operation)
            {
            case ItemsChangeOperation.Inserted:
                target.Disposing += new EventHandler(this.OnItem_Disposing);
                break;

            case ItemsChangeOperation.Removed:
                target.Disposing -= new EventHandler(this.OnItem_Disposing);
                break;

            case ItemsChangeOperation.Clearing:
                using (RadItemCollection.RadItemEnumerator enumerator = changed.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        enumerator.Current.Disposing -= new EventHandler(this.OnItem_Disposing);
                    }
                    break;
                }
            }
        }
Exemplo n.º 3
0
        public bool Contains(string text)
        {
            RadItemCollection.RadItemEnumerator iterator = this.Items.GetEnumerator();
            while (iterator.MoveNext())
            {
                if ((iterator.Current as RadComboBoxItem).Text == text)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 4
0
        public bool ContainText(string text)
        {
            RadItemCollection.RadItemEnumerator it = this.Items.GetEnumerator();
            while (it.MoveNext())
            {
                if (it.Current.Text != null && it.Current.Text.ToUpper() == text.ToUpper())
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 5
0
        public int FindString(string text)
        {
            int i = 0;

            RadItemCollection.RadItemEnumerator iterator = this.Items.GetEnumerator();
            while (iterator.MoveNext())
            {
                if ((iterator.Current as RadComboBoxItem).Text.ToUpper() == text.ToUpper())
                {
                    return(i);
                }

                ++i;
            }

            return(-1);
        }
        private void OnItemsChanged(
            RadItemCollection changed,
            RadItem target,
            ItemsChangeOperation operation)
        {
            switch (operation)
            {
            case ItemsChangeOperation.Inserted:
                RadMenuItemBase radMenuItemBase1 = target as RadMenuItemBase;
                if (radMenuItemBase1 == null)
                {
                    break;
                }
                radMenuItemBase1.DropDownOpening += new CancelEventHandler(this.OnMenuItem_DropDownOpening);
                break;

            case ItemsChangeOperation.Removed:
                RadMenuItemBase radMenuItemBase2 = target as RadMenuItemBase;
                if (radMenuItemBase2 == null)
                {
                    break;
                }
                radMenuItemBase2.DropDownOpening -= new CancelEventHandler(this.OnMenuItem_DropDownOpening);
                break;

            case ItemsChangeOperation.Clearing:
                using (RadItemCollection.RadItemEnumerator enumerator = changed.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        RadItem current = enumerator.Current;
                        if (current is RadMenuItemBase)
                        {
                            ((RadMenuItemBase)current).DropDownOpening -= new CancelEventHandler(this.OnMenuItem_DropDownOpening);
                        }
                    }
                    break;
                }
            }
        }