Exemplo n.º 1
0
        private void items_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
        {
            if (operation == ItemsChangeOperation.Inserted)
            {
                ((RadToolStripItem)target).Orientation = this.Orientation;

                if (this.ParentToolStripManager != null)
                {
                    if (this.ParentToolStripManager.ShowOverFlowButton == false)
                    {
                        ((RadToolStripItem)target).OverflowManager.DropDownButton.Visibility = ElementVisibility.Hidden;
                    }
                    else
                    {
                        ((RadToolStripItem)target).OverflowManager.DropDownButton.Visibility = ElementVisibility.Visible;
                    }
                }

                target.SetValue(RadToolStripManager.ToolStripOrientationProperty, this.Orientation);
                foreach (RadElement childElement in target.Children)
                {
                    childElement.SetValue(RadToolStripManager.ToolStripOrientationProperty, this.Orientation);
                }
            }
        }
Exemplo n.º 2
0
        protected virtual void OnItemsChanged(
            RadItemCollection changed,
            RadItem target,
            ItemsChangeOperation operation)
        {
            RadMenuItemBase radMenuItemBase = target as RadMenuItemBase;

            if (radMenuItemBase != null)
            {
                if (operation == ItemsChangeOperation.Inserted || operation == ItemsChangeOperation.Set)
                {
                    radMenuItemBase.HierarchyParent = this.ownerElement as IHierarchicalItem;
                    radMenuItemBase.Owner           = (object)this.ownerElement;
                }
                else if (operation == ItemsChangeOperation.Removed)
                {
                    radMenuItemBase.HierarchyParent = (IHierarchicalItem)null;
                }
            }
            if (operation != ItemsChangeOperation.Inserted || !(radMenuItemBase is RadMenuItem) || radMenuItemBase.Site != null)
            {
                return;
            }
            (radMenuItemBase as RadMenuItem).ShowKeyboardCue = false;
        }
Exemplo n.º 3
0
 protected override void OnChildrenChanged(
     RadElement child,
     ItemsChangeOperation changeOperation)
 {
     base.OnChildrenChanged(child, changeOperation);
     this.canvasSizeInvalidated = true;
 }
        protected virtual void OnItemsChanged(CommandBarStripElement target, ItemsChangeOperation operation)
        {
            if (this.suspendNotifyCount > 0)
            {
                return;
            }

            switch (operation)
            {
            case ItemsChangeOperation.Cleared:
                foreach (CommandBarStripElement item in this)
                {
                    item.SetOwnerCommandBarCollection(null);
                }
                break;

            case ItemsChangeOperation.Inserted:
            case ItemsChangeOperation.Set:
                target.SetOwnerCommandBarCollection(this);
                break;

            case ItemsChangeOperation.Removed:
                target.SetOwnerCommandBarCollection(null);
                break;
            }

            if (this.ItemsChanged != null)
            {
                ItemsChanged(this, target, operation);
            }
        }
Exemplo n.º 5
0
        protected override void OnItemsChanged(RadItem target, ItemsChangeOperation operation)
        {
            switch (operation)
            {
            case ItemsChangeOperation.Cleared:
                foreach (RadItem item in this)
                {
                    item.SetOwnerCollection(null);
                }
                break;

            case ItemsChangeOperation.Inserted:
            case ItemsChangeOperation.Set:
                target.SetOwnerCollection(this);
                break;

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

            //no need to raise notifications in Dispose life cycle
            if (this.owner != null && (this.owner.ElementState == ElementState.Disposing || this.owner.ElementState == ElementState.Disposed))
            {
                return;
            }

            base.OnItemsChanged(target, operation);
        }
Exemplo n.º 6
0
        private void items_ItemsChanged(
            RadItemCollection changed,
            RadItem target,
            ItemsChangeOperation operation)
        {
            RadGalleryItem radGalleryItem = (RadGalleryItem)target;

            switch (operation)
            {
            case ItemsChangeOperation.Inserted:
                radGalleryItem.Click      += new EventHandler(this.galleryItem_Clicked);
                radGalleryItem.MouseHover += new EventHandler(this.item_MouseHover);
                if (this.GetBitState(35184372088832L))
                {
                    radGalleryItem.AddBehavior((PropertyChangeBehavior)this.zoomBehavior);
                }
                radGalleryItem.Owner = this;
                radGalleryItem.StretchHorizontally = false;
                radGalleryItem.StretchVertically   = false;
                break;

            case ItemsChangeOperation.Removed:
                radGalleryItem.Click      -= new EventHandler(this.galleryItem_Clicked);
                radGalleryItem.MouseHover -= new EventHandler(this.item_MouseHover);
                break;
            }
            this.SetUpDownButtons();
        }
Exemplo n.º 7
0
        protected override void OnChildrenChanged(RadElement child, ItemsChangeOperation changeOperation)
        {
            base.OnChildrenChanged(child, changeOperation);

            RadDropDownMenuElement menuElement = this.FindAncestor <RadDropDownMenuElement>();

            if (menuElement == null)
            {
                return;
            }

            if (changeOperation == ItemsChangeOperation.Inserted || changeOperation == ItemsChangeOperation.Set)
            {
                DropDownPosition position = (DropDownPosition)menuElement.GetValue(RadDropDownMenuElement.DropDownPositionProperty);
                foreach (RadElement element in child.ChildrenHierarchy)
                {
                    element.SetValue(RadDropDownMenuElement.DropDownPositionProperty, position);
                }
            }

            //This is needed after adding the scrolling support in RadDropDownMenuElement.
            //since when adding items the scroll layout panel does not invalidate its parent's layout
            //and thus wrong size of the RadDropDownMenu is calculated, we need to invalidate the
            //main element's layout explicitly to force recalculation of the popup's size.
            //This behavior is needed only when adding items in design mode.
            menuElement.InvalidateMeasure();
        }
Exemplo n.º 8
0
 private void strips_ItemsChanged(
     CommandBarStripElementCollection changed,
     CommandBarStripElement target,
     ItemsChangeOperation operation)
 {
     if (operation == ItemsChangeOperation.Inserted || operation == ItemsChangeOperation.Set)
     {
         target.Orientation = this.Orientation;
         if (this.owner != null)
         {
             this.owner.StripInfoHolder.AddStripInfo(target);
         }
     }
     if ((operation == ItemsChangeOperation.Removed || operation == ItemsChangeOperation.Setting) && this.owner != null)
     {
         this.owner.StripInfoHolder.RemoveStripInfo(target);
     }
     if (operation == ItemsChangeOperation.Clearing && this.owner != null)
     {
         foreach (CommandBarStripElement strip in this.Strips)
         {
             this.owner.StripInfoHolder.RemoveStripInfo(strip);
         }
     }
     if (this.Parent == null)
     {
         return;
     }
     this.Parent.Invalidate();
 }
Exemplo n.º 9
0
        private void items_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
        {
            RadGalleryItem item = target as RadGalleryItem;

            if (item != null)
            {
                switch (operation)
                {
                case ItemsChangeOperation.Inserted:
                    item.Click      += new EventHandler(galleryItem_Clicked);
                    item.MouseHover += new EventHandler(item_MouseHover);
                    if (this.GetBitState(ZoomItemsStateKey))
                    {
                        item.AddBehavior(this.zoomBehavior);
                    }
                    item.Owner = this;
                    item.StretchHorizontally = false;
                    item.StretchVertically   = false;

                    break;

                case ItemsChangeOperation.Removed:
                    item.Click      -= new EventHandler(galleryItem_Clicked);
                    item.MouseHover -= new EventHandler(item_MouseHover);
                    break;
                }
            }
            this.SetUpDownButtons();
        }
Exemplo n.º 10
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);
        }
        protected override void OnChildrenChanged(RadElement child, ItemsChangeOperation changeOperation)
        {
            base.OnChildrenChanged(child, changeOperation);

            if (changeOperation == ItemsChangeOperation.Inserted)
            {
                RadItem item = child as RadItem;
                if (item != null)
                {
                    item.Click += new EventHandler(item_Click);
                }
            }
            if (changeOperation == ItemsChangeOperation.Removed)
            {
                RadItem item = child as RadItem;
                if (item != null)
                {
                    item.Click -= new EventHandler(item_Click);
                }
            }
            if (changeOperation == ItemsChangeOperation.Clearing)
            {
                foreach (RadElement element in this.Children)
                {
                    RadItem item = element as RadItem;
                    if (item != null)
                    {
                        item.Click -= new EventHandler(item_Click);
                    }
                }
            }
        }
Exemplo n.º 12
0
 void items_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
 {
     if (operation == ItemsChangeOperation.Inserted || operation == ItemsChangeOperation.Set)
     {
         target.AddBehavior(new BubbleBarMouseOverBehavior());
     }
 }
Exemplo n.º 13
0
 protected override void OnChildrenChanged(
     RadElement child,
     ItemsChangeOperation changeOperation)
 {
     base.OnChildrenChanged(child, changeOperation);
     this.BitState[137438953472L] = true;
 }
Exemplo n.º 14
0
 private void items_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
 {
     if (target != null)
     {
         target.NotifyParentOnMouseInput = true;
     }
 }
 public RadPageViewItemsChangedEventArgs(
     RadPageViewItem changedItem,
     ItemsChangeOperation operation)
 {
     this.ChangedItem = changedItem;
     this.Operation   = operation;
 }
Exemplo n.º 16
0
 protected override void OnChildrenChanged(
     RadElement child,
     ItemsChangeOperation changeOperation)
 {
     this.collapsibleChildren = (List <CollapsibleElement>)null;
     base.OnChildrenChanged(child, changeOperation);
 }
Exemplo n.º 17
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.º 18
0
 protected override void OnChildrenChanged(
     RadElement child,
     ItemsChangeOperation changeOperation)
 {
     base.OnChildrenChanged(child, changeOperation);
     if (!(child is BorderPrimitive))
     {
         return;
     }
     this.SynchronizeWithParentBorderThickness();
     if (this.childPrimitive == null)
     {
         this.childPrimitive = child as BorderPrimitive;
     }
     else
     {
         if (!(child is BorderPrimitive) || this.childPrimitive != child || changeOperation != ItemsChangeOperation.Removed)
         {
             return;
         }
         this.childPrimitive = (BorderPrimitive)null;
         foreach (RadElement child1 in this.Children)
         {
             if (child1 is BorderPrimitive)
             {
                 this.childPrimitive = child1 as BorderPrimitive;
                 this.SynchronizeWithParentBorderThickness();
                 break;
             }
         }
     }
 }
        protected virtual void OnItemsChanged(
            CommandBarStripElement target,
            ItemsChangeOperation operation)
        {
            if (this.suspendNotifyCount > 0)
            {
                return;
            }
            switch (operation)
            {
            case ItemsChangeOperation.Inserted:
            case ItemsChangeOperation.Set:
                target.SetOwnerCommandBarCollection((CollectionBase)this);
                break;

            case ItemsChangeOperation.Removed:
                target.SetOwnerCommandBarCollection((CollectionBase)null);
                break;

            case ItemsChangeOperation.Cleared:
                using (CommandBarStripElementCollection.CommandBarStripElementEnumerator enumerator = this.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        enumerator.Current.SetOwnerCommandBarCollection((CollectionBase)null);
                    }
                    break;
                }
            }
            if (this.ItemsChanged == null)
            {
                return;
            }
            this.ItemsChanged(this, target, operation);
        }
        private void OnItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
        {
            if (operation == ItemsChangeOperation.Inserted)
            {
                RadMenuItemBase menuItem = target as RadMenuItemBase;

                if (menuItem != null)
                {
                    menuItem.DropDownOpening += new CancelEventHandler(OnMenuItem_DropDownOpening);
                }
            }
            else if (operation == ItemsChangeOperation.Removed)
            {
                RadMenuItemBase menuItem = target as RadMenuItemBase;

                if (menuItem != null)
                {
                    menuItem.DropDownOpening -= new CancelEventHandler(OnMenuItem_DropDownOpening);
                }
            }
            else if (operation == ItemsChangeOperation.Clearing)
            {
                foreach (RadMenuItemBase item in changed)
                {
                    item.DropDownOpening -= new CancelEventHandler(OnMenuItem_DropDownOpening);
                }
            }
        }
Exemplo n.º 21
0
 private void items_ItemsChanged(
     RadItemCollection changed,
     RadItem target,
     ItemsChangeOperation operation)
 {
     this.SetSpacingBetweenItems();
 }
Exemplo n.º 22
0
 protected override void OnChildrenChanged(
     RadElement child,
     ItemsChangeOperation changeOperation)
 {
     this.AsureImageAndCheckElements();
     base.OnChildrenChanged(child, changeOperation);
 }
Exemplo n.º 23
0
        protected override void OnChildrenChanged(RadElement child, ItemsChangeOperation changeOperation)
        {
            base.OnChildrenChanged(child, changeOperation);

            if (child is BorderPrimitive)
            {
                this.SynchronizeWithParentBorderThickness();

                if (this.childPrimitive == null)
                {
                    this.childPrimitive = child as BorderPrimitive;
                }
                else if (child is BorderPrimitive && this.childPrimitive == child &&
                         changeOperation == ItemsChangeOperation.Removed)
                {
                    this.childPrimitive = null;

                    foreach (RadElement item in this.Children)
                    {
                        if (item is BorderPrimitive)
                        {
                            this.childPrimitive = item as BorderPrimitive;
                            this.SynchronizeWithParentBorderThickness();
                            break;
                        }
                    }
                }
            }
        }
Exemplo n.º 24
0
        protected override void OnChildrenChanged(RadElement child, ItemsChangeOperation changeOperation)
        {
            base.OnChildrenChanged(child, changeOperation);

            this.BitState[ItemsInvalidatedStateKey]      = true;
            this.BitState[ExtentSizeInvalidatedStateKey] = true;
        }
 private void HiddenItems_ItemsChanged(
     RadItemCollection changed,
     RadItem target,
     ItemsChangeOperation operation)
 {
     this.UpdateHiddenItems();
 }
Exemplo n.º 26
0
        private void ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
        {
            if (operation == ItemsChangeOperation.Inserted ||
                operation == ItemsChangeOperation.Set)
            {
                target.AngleTransform = GetRotationDegree(this.Orientation);
            }

            RadMenuItemBase menuItem = target as RadMenuItemBase;

            if (menuItem != null)
            {
                if (operation == ItemsChangeOperation.Inserted || operation == ItemsChangeOperation.Set)
                {
                    menuItem.Owner = this;
                    if (!this.IsDesignMode)
                    {
                        menuItem.ClickMode = ClickMode.Press;
                    }
                    menuItem.IsMainMenuItem = true;
                }
                else if (operation == ItemsChangeOperation.Removed)
                {
                    menuItem.Deselect();
                    menuItem.Owner = null;
                    if (menuItem.IsPopupShown)
                    {
                        menuItem.HideChildItems();
                    }
                }
            }
        }
Exemplo n.º 27
0
 private void ItemChanged(
     RadItemCollection changed,
     RadItem target,
     ItemsChangeOperation operation)
 {
     this.invalidateCollapsableChildrenCollection = true;
     if (operation != ItemsChangeOperation.Inserted && operation != ItemsChangeOperation.Set)
     {
         return;
     }
     if ((object)target.GetType() == (object)typeof(RadButtonElement))
     {
         RadButtonElement radButtonElement = target as RadButtonElement;
         if (string.IsNullOrEmpty(radButtonElement.Class))
         {
             radButtonElement.Class = "RibbonBarButtonElement";
         }
         radButtonElement.ButtonFillElement.Class = "ButtonInRibbonFill";
         radButtonElement.BorderElement.Class     = "ButtonInRibbonBorder";
         if (this.ElementTree != null)
         {
             this.ElementTree.ApplyThemeToElement((RadObject)radButtonElement);
         }
     }
     else if (target is RadRibbonBarButtonGroup)
     {
         target.MinSize = new Size(22, 22);
     }
     else if (target is RadDropDownListElement)
     {
         target.MinSize           = new Size(140, 0);
         target.StretchVertically = false;
         target.AutoSizeMode      = RadAutoSizeMode.WrapAroundChildren;
     }
     else if ((object)target.GetType() == (object)typeof(RadRadioButtonElement))
     {
         target.MinSize           = new Size(20, 0);
         target.StretchVertically = false;
         target.AutoSizeMode      = RadAutoSizeMode.WrapAroundChildren;
     }
     else if (target is RadTextBoxElement)
     {
         target.MinSize      = new Size(140, 0);
         target.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
         Padding padding = target.Padding;
         padding.Left   = 0;
         padding.Right  = 0;
         target.Padding = padding;
     }
     else if (target is RadGalleryElement)
     {
         target.Padding = new Padding(2, 2, 0, 0);
     }
     else if ((object)target.GetType() == (object)typeof(RadCheckBoxElement))
     {
         target.StretchVertically = false;
     }
     target.NotifyParentOnMouseInput = true;
 }
Exemplo n.º 28
0
 protected virtual void OnItemsChanged(RadItem target, ItemsChangeOperation operation)
 {
     if (this.suspendNotifyCount > 0 || this.ItemsChanged == null)
     {
         return;
     }
     this.ItemsChanged(this, target, operation);
 }
Exemplo n.º 29
0
 protected override void OnChildrenChanged(RadElement child, ItemsChangeOperation changeOperation)
 {
     base.OnChildrenChanged(child, changeOperation);
     if (this.Children.Count > 1)
     {
         throw new InvalidOperationException("ForceSizeLayoutPanel must have maximum one child");
     }
 }
Exemplo n.º 30
0
 protected override void OnChildrenChanged(RadElement child, ItemsChangeOperation changeOperation)
 {
     base.OnChildrenChanged(child, changeOperation);
     if (changeOperation == ItemsChangeOperation.Inserted)
     {
         child.ZIndex = this.ZIndex;
     }
 }