예제 #1
0
        protected virtual void OnItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
        {
            ItemChangedDelegate handler = this.ItemsChanged;

            if (handler != null)
            {
                handler(changed, target, operation);
            }
        }
예제 #2
0
 public AlertInfo(
     string contentText,
     string captionText,
     Image alertImage,
     RadItemCollection alertButtons)
     : this(contentText, captionText, alertImage)
 {
     this.alertButtons = alertButtons;
 }
예제 #3
0
 protected virtual void ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
 {
     if (operation == ItemsChangeOperation.Inserted ||
         operation == ItemsChangeOperation.Set ||
         operation == ItemsChangeOperation.Removed)
     {
         this.UpdateArrow();
     }
 }
예제 #4
0
        private void commandTabs_ItemsChanged(
            RadItemCollection changed,
            RadItem target,
            ItemsChangeOperation operation)
        {
            if (operation == ItemsChangeOperation.Inserted && target != null)
            {
                target.RadPropertyChanged += new RadPropertyChangedEventHandler(this.tabStrip_RadPropertyChanged);
                if (!this.IsInValidState(true))
                {
                    return;
                }
                RadRibbonBar control = this.ElementTree.Control as RadRibbonBar;
                if (control == null)
                {
                    return;
                }
                control.RibbonBarElement.InvalidateMeasure(true);
                control.RibbonBarElement.UpdateLayout();
                control.RibbonBarElement.RibbonCaption.CaptionLayout.InvalidateMeasure();
                control.RibbonBarElement.RibbonCaption.CaptionLayout.InvalidateArrange();
                control.RibbonBarElement.RibbonCaption.CaptionLayout.UpdateLayout();
            }
            else
            {
                switch (operation)
                {
                case ItemsChangeOperation.Removed:
                    target.RadPropertyChanged -= new RadPropertyChangedEventHandler(this.tabStrip_RadPropertyChanged);
                    if (!this.IsInValidState(true))
                    {
                        break;
                    }
                    RadRibbonBar control1 = this.ElementTree.Control as RadRibbonBar;
                    if (control1 == null)
                    {
                        break;
                    }
                    control1.RibbonBarElement.InvalidateMeasure(true);
                    control1.RibbonBarElement.UpdateLayout();
                    control1.RibbonBarElement.RibbonCaption.CaptionLayout.InvalidateMeasure();
                    control1.RibbonBarElement.RibbonCaption.CaptionLayout.InvalidateArrange();
                    control1.RibbonBarElement.RibbonCaption.CaptionLayout.UpdateLayout();
                    break;

                case ItemsChangeOperation.Clearing:
                    using (RadItemCollection.RadItemEnumerator enumerator = this.tabItems.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            enumerator.Current.RadPropertyChanged -= new RadPropertyChangedEventHandler(this.tabStrip_RadPropertyChanged);
                        }
                        break;
                    }
                }
            }
        }
        private void items_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
        {
            bool flag = operation == ItemsChangeOperation.Inserted || operation == ItemsChangeOperation.Set;

            if (flag)
            {
                target.AddBehavior(new BubbleBarMouseOverBehavior());
            }
        }
예제 #6
0
        private void CaptionArrange(SizeF finalSize)
        {
            RadItemCollection contextualTabGroups = (RadItemCollection)this.RibbonBarElement.ContextualTabGroups;
            RectangleF        finalRect           = new RectangleF();

            finalRect.Width  = this.captionTextElement.DesiredSize.Width;
            finalRect.Height = this.captionTextElement.DesiredSize.Height;
            if (contextualTabGroups.Count > 0 && this.showTabGroups)
            {
                ContextualTabGroup leftMostGroup;
                ContextualTabGroup rightMostGroup;
                if ((leftMostGroup = this.GetLeftMostGroup(this.IsDesignMode)) == null || (rightMostGroup = this.GetRightMostGroup(this.IsDesignMode)) == null)
                {
                    this.captionTextElement.Arrange(new RectangleF((float)(((double)finalSize.Width - (double)this.captionTextElement.DesiredSize.Width) / 2.0), (float)(((double)finalSize.Height - (double)this.captionTextElement.DesiredSize.Height) / 2.0), this.captionTextElement.DesiredSize.Width, this.captionTextElement.DesiredSize.Height));
                }
                else
                {
                    float leftCaptionSpace  = this.GetLeftCaptionSpace(finalSize);
                    float rightCaptionSpace = this.GetRightCaptionSpace(finalSize);
                    finalRect.Y = (float)(((double)finalSize.Height - (double)this.captionTextElement.DesiredSize.Height) / 2.0);
                    if ((double)leftCaptionSpace > (double)rightCaptionSpace)
                    {
                        if (!this.RightToLeft)
                        {
                            finalRect.X = (float)((double)leftCaptionSpace / 2.0 - (double)this.captionTextElement.DesiredSize.Width / 2.0);
                            this.captionTextElement.Arrange(finalRect);
                        }
                        else
                        {
                            Rectangle rectangle = new Rectangle(leftMostGroup.BoundingRectangle.Location, Size.Add(leftMostGroup.BoundingRectangle.Size, leftMostGroup.Margin.Size));
                            finalRect.X = (float)((double)rectangle.X + (double)leftMostGroup.DesiredSize.Width + (double)leftCaptionSpace / 2.0 - (double)this.captionTextElement.DesiredSize.Width / 2.0);
                        }
                        this.captionTextElement.Arrange(finalRect);
                    }
                    else
                    {
                        if (!this.RightToLeft)
                        {
                            float num = (float)new Rectangle(rightMostGroup.BoundingRectangle.Location, Size.Add(rightMostGroup.BoundingRectangle.Size, rightMostGroup.Margin.Size)).X + rightMostGroup.DesiredSize.Width;
                            finalRect.X = (float)((double)num + (double)rightCaptionSpace / 2.0 - (double)this.captionTextElement.DesiredSize.Width / 2.0);
                        }
                        else
                        {
                            finalRect.X = (float)((double)rightCaptionSpace / 2.0 - (double)this.captionTextElement.DesiredSize.Width / 2.0);
                        }
                        this.captionTextElement.Arrange(finalRect);
                    }
                }
            }
            else
            {
                finalRect.X = (float)(((double)finalSize.Width - (double)this.captionTextElement.DesiredSize.Width) / 2.0);
                finalRect.Y = (float)(((double)finalSize.Height - (double)this.captionTextElement.DesiredSize.Height) / 2.0);
                this.captionTextElement.Arrange(finalRect);
            }
        }
예제 #7
0
 protected override void InitializeFields()
 {
     base.InitializeFields();
     this.tabItems           = new RadItemCollection();
     this.tabItems.ItemTypes = new System.Type[1]
     {
         typeof(RibbonTab)
     };
     this.tabItems.ItemsChanged += new ItemChangedDelegate(this.commandTabs_ItemsChanged);
 }
예제 #8
0
 private void Items_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
 {
     if (operation == ItemsChangeOperation.Inserted)
     {
         RadMenuItemBase menuItem = target as RadMenuItemBase;
         if (menuItem != null)
         {
             menuItem.OwnerControl = this.menu;
         }
     }
 }
예제 #9
0
 private void items_ItemsChanged(RadItemCollection changed, RadItem tartet, ItemsChangeOperation operation)
 {
     if (operation == ItemsChangeOperation.Inserted)
     {
         RadToolStripElement element = tartet as RadToolStripElement;
         if (element != null)
         {
             element.Orientation = this.Orientation;
         }
     }
 }
예제 #10
0
 protected virtual void ItemsChanged(
     RadItemCollection changed,
     RadItem target,
     ItemsChangeOperation operation)
 {
     if (operation != ItemsChangeOperation.Inserted && operation != ItemsChangeOperation.Set && (operation != ItemsChangeOperation.Removed && operation != ItemsChangeOperation.Clearing) && operation != ItemsChangeOperation.Cleared)
     {
         return;
     }
     this.UpdateArrow();
 }
예제 #11
0
 private void items_ItemsChanged(
     RadItemCollection changed,
     RadItem target,
     ItemsChangeOperation operation)
 {
     if (target == null)
     {
         return;
     }
     target.NotifyParentOnMouseInput = true;
 }
 public CommandTabsUITypeEditorForm(IDesignerHost host, RadItemCollection value)
 {
     InitializeComponent();
     this.host = host;
     this.initialCollection = new RadItemCollection(value);
     this.newlyAddedItems   = new RadItemCollection();
     this.collection        = value;
     this.radListBoxTabItems.SelectedIndexChanged += new EventHandler(radListBoxTabItems_SelectedIndexChanged);
     this.radListBoxTabItems.SelectionMode         = SelectionMode.MultiExtended;
     this.LoadListBoxItems();
 }
예제 #13
0
 void Items_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
 {
     if (target != null)
     {
         this.AddTextToListBox(string.Format("Element {0} is {1}", target.ToString(), operation.ToString()));
     }
     else
     {
         this.AddTextToListBox(string.Format("Element is {0}", operation.ToString()));
     }
 }
예제 #14
0
        void dropDownMenuElement_DropDownClosing(object sender, RadPopupClosingEventArgs args)
        {
            RadItemCollection items = ((RadMenuItem)this.dropDownMenuElement.Items.Last).Items;

            for (int i = 0; i < items.Count; ++i)
            {
                if (items[i].ContainsMouse)
                {
                    args.Cancel = true;
                }
            }
        }
예제 #15
0
        private void dropDownMenuElement_DropDownClosing(object sender, RadPopupClosingEventArgs args)
        {
            RadItemCollection items = (RadItemCollection)this.addRemoveButtonsMenuItem.Items;

            for (int index = 0; index < items.Count; ++index)
            {
                if (items[index].ContainsMouse)
                {
                    args.Cancel = true;
                }
            }
        }
예제 #16
0
        private void ItemsChanged(RadItemCollection changed, RadElement target, ItemsChangeOperation operation)
        {
            RadItem item = target as RadItem;

            if (item != null)
            {
                if (operation == ItemsChangeOperation.Inserted || operation == ItemsChangeOperation.Set)
                {
                    item.Margin = new Padding(1, 1, 1, 1);
                }
            }
        }
예제 #17
0
 private void Items_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
 {
     if (this.panelBar.CurrentStyle is ExplorerBarStyle)
     {
         RadPanelBarGroupElement group = target as RadPanelBarGroupElement;
         if (target != null)
         {
             target.RadPropertyChanged += new RadPropertyChangedEventHandler(target_RadPropertyChanged);
             group.ShowCaptionButton(true);
             UpdateGroupsUI();
         }
     }
 }
예제 #18
0
        protected override void InitializeFields()
        {
            base.InitializeFields();

            this.AutoSizeMode = RadAutoSizeMode.FitToAvailableSize;

            this.tabItems           = new RadItemCollection();
            this.tabItems.ItemTypes = new Type[] { typeof(RibbonTab) };
#pragma warning disable 0618
            this.tabItems.ExcludedTypes = new Type[] { typeof(RadRibbonBarCommandTab) };
#pragma warning restore 0618
            this.tabItems.ItemsChanged += new ItemChangedDelegate(commandTabs_ItemsChanged);
        }
예제 #19
0
 private void items_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
 {
     this.groupStates.Clear();
     if (operation == ItemsChangeOperation.Inserted)
     {
         if (target is RadPanelBarGroupElement)
         {
             this.SetStyle();
             this.CurrentStyle.SyncHostedPanels(new RadPanelBarGroupElement[] { target as RadPanelBarGroupElement },
                                                (target as RadPanelBarGroupElement).EnableHostControlMode);
         }
     }
 }
예제 #20
0
        private void ItemsChanged(
            RadItemCollection changed,
            RadElement target,
            ItemsChangeOperation operation)
        {
            RadItem radItem = target as RadItem;

            if (radItem == null || operation != ItemsChangeOperation.Inserted && operation != ItemsChangeOperation.Set)
            {
                return;
            }
            radItem.Margin = new Padding(1, 1, 1, 1);
        }
예제 #21
0
        protected virtual void OnItemsChanged(
            RadItemCollection changed,
            RadItem target,
            ItemsChangeOperation operation)
        {
            ItemChangedDelegate itemsChanged = this.ItemsChanged;

            if (itemsChanged == null)
            {
                return;
            }
            itemsChanged(changed, target, operation);
        }
예제 #22
0
 protected override void CreateChildElements()
 {
     base.CreateChildElements();
     this.items          = new RadItemCollection();
     this.timer          = new Timer();
     this.timer.Interval = 3000;
     if (this.Site == null)
     {
         this.timer.Tick += new EventHandler(this.timer_Tick);
         this.timer.Start();
     }
     this.ClipDrawing = true;
 }
예제 #23
0
        protected override void OnItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
        {
            base.OnItemsChanged(changed, target, operation);

            if (operation == ItemsChangeOperation.Inserted)
            {
                RadMenuItemBase menuItemBase = target as RadMenuItemBase;

                if (menuItemBase != null)
                {
                    menuItemBase.IsMainMenuItem = false;
                }
            }
        }
예제 #24
0
        private void items_ItemsChanged(
            RadItemCollection changed,
            RadItem target,
            ItemsChangeOperation operation)
        {
            if (target != null && !typeof(RadTileElement).IsAssignableFrom(target.GetType()))
            {
                throw new ArgumentException("The Items collection accepts only objects or descendants of type RadTileElement");
            }
            RadTileElement tileElement = target as RadTileElement;
            RadControl     control     = this.ElementTree.Control as RadControl;

            if (control != null && control.IsInitializing || this.ElementTree.Control.Site != null)
            {
                return;
            }
            if (this.AutoArrangeNewTiles && tileElement != null && operation == ItemsChangeOperation.Inserted)
            {
                int  num1 = 0;
                int  num2 = 0;
                bool flag = false;
                if (tileElement.GetValueSource(GridLayout.ColumnIndexProperty) > ValueSource.DefaultValue || tileElement.GetValueSource(GridLayout.RowIndexProperty) > ValueSource.DefaultValue)
                {
                    this.UpdateCellCount();
                    this.InvalidateMeasure();
                    return;
                }
                int col = 0;
                while (!flag)
                {
                    for (int row = 0; !flag && row < this.RowsCount; ++row)
                    {
                        if (this.CanPlace(tileElement, row, col))
                        {
                            num1 = row;
                            num2 = col;
                            flag = true;
                        }
                    }
                    ++col;
                }
                tileElement.Column = num2;
                tileElement.Row    = num1;
            }
            this.UpdateCellCount();
            this.InvalidateMeasure();
        }
예제 #25
0
        private void Items_ItemsChanged(
            RadItemCollection changed,
            RadItem target,
            ItemsChangeOperation operation)
        {
            if (operation != ItemsChangeOperation.Inserted)
            {
                return;
            }
            RadMenuItemBase radMenuItemBase = target as RadMenuItemBase;

            if (radMenuItemBase == null)
            {
                return;
            }
            radMenuItemBase.OwnerControl = (Control)this.menu;
        }
        private void ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
        {
            RadMenuItemBase menuItem = target as RadMenuItemBase;

            if (menuItem != null)
            {
                if (operation == ItemsChangeOperation.Inserted || operation == ItemsChangeOperation.Set)
                {
                    menuItem.HierarchyParent = this.OwnerElement as IHierarchicalItem;
                    menuItem.Owner           = this.OwnerElement;
                }
                else if (operation == ItemsChangeOperation.Removed)
                {
                    menuItem.HierarchyParent = null;
                }
            }
        }
예제 #27
0
        protected override void OnItemsChanged(
            RadItemCollection changed,
            RadItem target,
            ItemsChangeOperation operation)
        {
            base.OnItemsChanged(changed, target, operation);
            if (operation != ItemsChangeOperation.Inserted)
            {
                return;
            }
            RadMenuItemBase radMenuItemBase = target as RadMenuItemBase;

            if (radMenuItemBase == null)
            {
                return;
            }
            radMenuItemBase.IsMainMenuItem = false;
        }
예제 #28
0
 private void items_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
 {
     if (operation == ItemsChangeOperation.Inserted)
     {
         this.Children.Add(target);
     }
     else if (operation == ItemsChangeOperation.Cleared)
     {
         for (int i = this.Children.Count - 1; i >= 0; i--)
         {
             FastNavigationItem item = this.Children[i] as FastNavigationItem;
             if (item != null)
             {
                 this.Children.Remove(item);
             }
         }
     }
 }
예제 #29
0
        private void Items_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
        {
            RadPanelBarGroupElement group = target as RadPanelBarGroupElement;

            if (target != null)
            {
                group.ShowCaptionButton(false);
                group.CollapseChildren(false);
                group.horizontalLayout.StretchHorizontally    = true;
                group.verticalLayout.StretchHorizontally      = true;
                group.verticalLayout.StretchVertically        = true;
                group.verticalGroupLayout.StretchHorizontally = true;
                group.verticalGroupLayout.StretchVertically   = true;
                group.StretchVertically   = true;
                group.StretchHorizontally = true;
                //	UpdateGroupsUI();
            }
        }
예제 #30
0
        private void Items_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
        {
            if (target != null)
            {
                if (this.panelBar.CurrentStyle is ListBarStyle)
                {
                    RadPanelBarGroupElement group = (RadPanelBarGroupElement)target;

                    group.horizontalLayout.StretchHorizontally    = true;
                    group.verticalLayout.StretchHorizontally      = true;
                    group.verticalLayout.StretchVertically        = true;
                    group.verticalGroupLayout.StretchHorizontally = true;
                    group.verticalGroupLayout.StretchVertically   = true;
                    group.StretchVertically   = true;
                    group.StretchHorizontally = true;
                }
            }
        }