コード例 #1
0
        protected override void InitializeFields()
        {
            base.InitializeFields();

            this.text       = new TextPrimitive();
            this.text.Class = "AlertWindowTextCaptionText";

            this.closeButton = new RadButtonElement();
            this.closeButton.SetDefaultValueOverride(RadButtonItem.DisplayStyleProperty, DisplayStyle.Image);
            this.closeButton.ThemeRole = "AlertCloseButton";

            this.pinButton = new RadToggleButtonElement();
            this.pinButton.SetDefaultValueOverride(RadButtonItem.DisplayStyleProperty, DisplayStyle.Image);
            this.pinButton.ThemeRole = "AlertWindowPinButton";

            this.optionsButton = new RadDropDownButtonElement();
            this.optionsButton.ArrowButton.SetDefaultValueOverride(RadElement.VisibilityProperty, ElementVisibility.Collapsed);
            this.optionsButton.ThemeRole = "AlertWindowOptionsButton";

            this.buttonsLayoutPanel            = new StackLayoutPanel();
            this.buttonsLayoutPanel.Class      = "AlertWindowButtonsLayoutPanel";
            this.mainLayoutPanel               = new DockLayoutPanel();
            this.mainLayoutPanel.Class         = "AlertWindowMainLayoutPanel";
            this.mainLayoutPanel.LastChildFill = true;

            this.MinSize = new System.Drawing.Size(0, 15);
        }
コード例 #2
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            this.openFileDialog = new OpenFileDialog();

            this.stack                          = new StackLayoutElement();
            this.stack.Orientation              = Orientation.Horizontal;
            this.stack.StretchVertically        = true;
            this.stack.FitInAvailableSize       = true;
            this.stack.StretchHorizontally      = true;
            this.stack.ShouldHandleMouseInput   = false;
            this.stack.NotifyParentOnMouseInput = true;
            this.stack.ElementSpacing           = 1;

            this.filePathTextBox      = this.CreateFilePathTextBoxElement();
            this.openFileDialogButton = this.CreateOpenFileDialogButtonElement();

            this.stack.Children.Add(this.filePathTextBox);
            this.stack.Children.Add(this.openFileDialogButton);

            this.Children.Add(this.stack);

            this.WireEvents();
        }
コード例 #3
0
        protected override void CreateChildElements()
        {
            this.fillPrimitive               = new FillPrimitive();
            this.fillPrimitive.Class         = "RadMenuItemFillPrimitive";
            this.fillPrimitive.Name          = "MenuButtonItemFill";
            this.fillPrimitive.BackColor     = Color.Empty;
            this.fillPrimitive.GradientStyle = GradientStyles.Solid;
            this.Children.Add((RadElement)this.fillPrimitive);
            this.borderPrimitive       = new BorderPrimitive();
            this.borderPrimitive.Class = "RadMenuItemBorderPrimitive";
            this.borderPrimitive.Name  = "MenuButtonItemBorder";
            this.Children.Add((RadElement)this.borderPrimitive);
            this.buttonElement          = new RadButtonElement();
            this.buttonElement.CanFocus = false;
            this.buttonElement.Click   += new EventHandler(this.buttonElement_Click);
            int num1 = (int)this.buttonElement.ImagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, (RadObject)this, RadButtonItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            int num2 = (int)this.buttonElement.ImagePrimitive.BindProperty(ImagePrimitive.ImageProperty, (RadObject)this, RadButtonItem.ImageProperty, PropertyBindingOptions.TwoWay);
            int num3 = (int)this.buttonElement.ImagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, (RadObject)this, RadButtonItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);

            this.buttonElement.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.Children.Add((RadElement)this.buttonElement);
            int num4  = (int)this.buttonElement.BindProperty(RadItem.TextProperty, (RadObject)this, RadItem.TextProperty, PropertyBindingOptions.TwoWay);
            int num5  = (int)this.SetDefaultValueOverride(RadButtonItem.TextImageRelationProperty, (object)this.buttonElement.TextImageRelation);
            int num6  = (int)this.SetDefaultValueOverride(RadButtonItem.ImageAlignmentProperty, (object)this.buttonElement.ImageAlignment);
            int num7  = (int)this.SetDefaultValueOverride(RadButtonItem.TextAlignmentProperty, (object)this.buttonElement.TextAlignment);
            int num8  = (int)this.buttonElement.BindProperty(RadButtonItem.TextImageRelationProperty, (RadObject)this, RadButtonItem.TextImageRelationProperty, PropertyBindingOptions.TwoWay);
            int num9  = (int)this.buttonElement.BindProperty(RadButtonItem.ImageAlignmentProperty, (RadObject)this, RadButtonItem.ImageAlignmentProperty, PropertyBindingOptions.TwoWay);
            int num10 = (int)this.buttonElement.BindProperty(RadButtonItem.TextAlignmentProperty, (RadObject)this, RadButtonItem.TextAlignmentProperty, PropertyBindingOptions.TwoWay);
        }
コード例 #4
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
            StackLayoutElement stackLayoutElement1 = new StackLayoutElement();

            stackLayoutElement1.Orientation         = Orientation.Vertical;
            stackLayoutElement1.StretchHorizontally = true;
            stackLayoutElement1.StretchVertically   = true;
            this.titleElement = this.CreateTitleElement();
            this.actionsBar   = this.CreateActionsBarElement();
            this.ok           = this.CreateOkButton();
            this.cancel       = this.CreateCancelButton();
            StackLayoutElement stackLayoutElement2 = new StackLayoutElement();

            stackLayoutElement2.Orientation = Orientation.Horizontal;
            stackLayoutElement2.Children.Add((RadElement)this.ok);
            stackLayoutElement2.Children.Add((RadElement)this.cancel);
            this.actionsBar.Children.Add((RadElement)stackLayoutElement2);
            this.currentValueElement = this.CreateCurrentValueElement();
            stackLayoutElement1.Children.Add((RadElement)this.titleElement);
            stackLayoutElement1.Children.Add(this.CreateMainElement());
            stackLayoutElement1.Children.Add((RadElement)this.currentValueElement);
            stackLayoutElement1.Children.Add((RadElement)this.actionsBar);
            this.Children.Add((RadElement)stackLayoutElement1);
        }
コード例 #5
0
 protected override void CreateChildElements()
 {
     base.CreateChildElements();
     this.button        = new RadButtonElement();
     this.button.Click += new EventHandler(this.Button_Click);
     this.Children.Add((RadElement)this.button);
 }
コード例 #6
0
        protected override void CreateChildElements()
        {
            // fill
            this.fillPrimitive               = new FillPrimitive();
            this.fillPrimitive.Class         = "RadMenuItemFillPrimitive";
            this.fillPrimitive.Name          = "MenuButtonItemFill";
            this.fillPrimitive.BackColor     = Color.Empty;
            this.fillPrimitive.GradientStyle = GradientStyles.Solid;
            this.Children.Add(this.fillPrimitive);

            // border
            this.borderPrimitive       = new BorderPrimitive();
            this.borderPrimitive.Class = "RadMenuItemBorderPrimitive";
            this.borderPrimitive.Name  = "MenuButtonItemBorder";
            this.Children.Add(this.borderPrimitive);

            this.buttonElement          = new RadButtonElement();
            this.buttonElement.CanFocus = false;
            this.buttonElement.Click   += buttonElement_Click;
            this.buttonElement.ImagePrimitive.BindProperty(ImagePrimitive.ImageIndexProperty, this, RadButtonItem.ImageIndexProperty, PropertyBindingOptions.TwoWay);
            this.buttonElement.ImagePrimitive.BindProperty(ImagePrimitive.ImageProperty, this, RadButtonItem.ImageProperty, PropertyBindingOptions.TwoWay);
            this.buttonElement.ImagePrimitive.BindProperty(ImagePrimitive.ImageKeyProperty, this, RadButtonItem.ImageKeyProperty, PropertyBindingOptions.TwoWay);
            this.buttonElement.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
            this.Children.Add(this.buttonElement);

            this.buttonElement.BindProperty(RadButtonElement.TextProperty, this, RadButtonItem.TextProperty, PropertyBindingOptions.TwoWay);
        }
コード例 #7
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            this.converter = TypeDescriptor.GetConverter(typeof(Color));

            this.stack                          = new StackLayoutElement();
            this.stack.Orientation              = Orientation.Horizontal;
            this.stack.StretchVertically        = true;
            this.stack.FitInAvailableSize       = true;
            this.stack.StretchHorizontally      = true;
            this.stack.ShouldHandleMouseInput   = false;
            this.stack.NotifyParentOnMouseInput = true;
            this.stack.ElementSpacing           = 1;

            this.colorBox          = this.CreateColorBoxElement();
            this.colorTextBox      = this.CreateColorTextBoxElement();
            this.colorPickerButton = this.CreateColorPickerButtonElement();

            this.stack.Children.Add(this.colorBox);
            this.stack.Children.Add(this.colorTextBox);
            this.stack.Children.Add(this.colorPickerButton);

            this.Children.Add(this.stack);

            this.WireEvents();
        }
コード例 #8
0
        private void OnRadQuickAccessBar_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
        {
            if (operation == ItemsChangeOperation.Inserted)
            {
                if (this.overFlowButton != null)
                {
                    if (!this.IsDesignMode)
                    {
                        this.overFlowButton.Visibility = ElementVisibility.Visible;
                    }
                    else
                    {
                        this.overFlowButton.Visibility = ElementVisibility.Hidden;
                    }
                }

                target.MaxSize = new Size(0, 18);
                target.SetDefaultValueOverride(RadItem.PaddingProperty, new Padding(2, 1, 2, 2));

                if (target.GetType() == typeof(RadButtonElement))
                {
                    RadButtonElement buttonElement = target as RadButtonElement;

                    buttonElement.Class = "RibbonBarButtonElement";
                    buttonElement.BorderElement.Class     = "ButtonInRibbonBorder";
                    buttonElement.ButtonFillElement.Class = "ButtonInRibbonFill";
                }
            }

            this.RefreshItems();
        }
コード例 #9
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            this.dockLayout = new DockLayoutPanel();
            this.dockLayout.StretchHorizontally = true;
            this.dockLayout.StretchVertically   = false;

            this.label = new RadLabelElement();
            this.label.SetValue(DockLayoutPanel.DockProperty, (this.RightToLeft) ? Dock.Right : Dock.Left);
            this.label.Class    = "FooterDate";
            this.label.TextWrap = false;

            this.todayButtonElement      = new RadButtonElement();
            this.todayButtonElement.Text = "Today";
            this.todayButtonElement.SetValue(DockLayoutPanel.DockProperty, (this.RightToLeft) ? Dock.Left : Dock.Right);
            this.todayButtonElement.Margin = new Padding(5, 0, 5, 0);
            this.todayButtonElement.Click += new EventHandler(todayButtonElement_Click);

            this.clearButtonElement      = new RadButtonElement();
            this.clearButtonElement.Text = "Clear";
            this.clearButtonElement.SetValue(DockLayoutPanel.DockProperty, (this.RightToLeft) ? Dock.Left : Dock.Right);
            this.clearButtonElement.Margin     = new Padding(5, 0, 5, 0);
            this.clearButtonElement.Visibility = ElementVisibility.Visible;
            this.clearButtonElement.Click     += new EventHandler(clearButtonElement_Click);

            this.dockLayout.Children.Add(this.todayButtonElement);
            this.dockLayout.Children.Add(this.clearButtonElement);
            this.dockLayout.Children.Add(this.label);

            this.Children.Add(this.dockLayout);
        }
コード例 #10
0
        private bool ChangeImages(RadButtonElement button, bool display)
        {
            if ((button.SmallImage == null) &&
                (button.SmallImageIndex == -1) &&
                (button.SmallImageKey == string.Empty))
            {
                return(false);
            }

            if (!display)
            {
                button.UseSmallImageList = true;
                this.PreserveOldImage(button);

                if (button.SmallImage != null)
                {
                    button.Image = button.SmallImage;
                }
                else if (button.SmallImageIndex != -1)
                {
                    button.ImageIndex = button.SmallImageIndex;
                }
                else if (button.SmallImageKey != string.Empty)
                {
                    button.ImageKey = button.SmallImageKey;
                }
            }
            else
            {
                button.UseSmallImageList = false;
                this.RestoreOldImage(button);
            }

            return(true);
        }
コード例 #11
0
ファイル: RadButtonBase.cs プロジェクト: configare/hispeed
        /// <summary>
        /// Override this method to create custom main element. By default the main element is an instance of
        /// RadButtonElement.
        /// </summary>
        /// <returns>Instance of the one-and-only child of the root element of RadButton.</returns>
        protected virtual RadButtonElement CreateButtonElement()
        {
            RadButtonElement res = new RadButtonElement();

            res.UseNewLayoutSystem = true;
            return(res);
        }
コード例 #12
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;
 }
コード例 #13
0
 protected override void CreateChildElements()
 {
     base.CreateChildElements();
     this.acceptButton = this.CreateAcceptButton();
     this.cancelButton = this.CreateCancelButton();
     this.Children.Add((RadElement)this.acceptButton);
     this.Children.Add((RadElement)this.cancelButton);
     this.HideAcceptAndCancelButtons();
 }
コード例 #14
0
        protected virtual RadButtonElement CreateCancelButton()
        {
            RadButtonElement radButtonElement = new RadButtonElement();

            radButtonElement.Padding = new Padding(3);
            radButtonElement.Text    = LocalizationProvider <ChatLocalizationProvider> .CurrentProvider.GetLocalizedString("OverlayCancel");

            return(radButtonElement);
        }
コード例 #15
0
 protected override void DisposeManagedResources()
 {
     if (this.button != null)
     {
         this.button.Click -= new EventHandler(this.Button_Click);
     }
     base.DisposeManagedResources();
     this.button = (RadButtonElement)null;
 }
コード例 #16
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
            this.editorButton = (RadButtonElement) new PropertyGridUITypeEditorButtonElement();
            int num = (int)this.editorButton.SetValue(DockLayoutPanel.DockProperty, (object)Dock.Right);

            this.editorButton.Click += new EventHandler(this.editorButton_Click);
            this.editorService       = new PropertyGridUITypeEditor(this);
        }
コード例 #17
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            this.backgroundFill               = new FillPrimitive();
            this.backgroundFill.Class         = "SplitterFill";
            this.backgroundFill.GradientStyle = GradientStyles.Solid;
            this.backgroundFill.SmoothingMode = SmoothingMode.Default;
            this.Children.Add(this.backgroundFill);

            SplitterLayout layout = new SplitterLayout(this);

            this.Children.Add(layout);

            prevSplitterButton       = new RadButtonElement();
            prevSplitterButton.Class = "SplitterThumb";
            layout.Children.Add(prevSplitterButton);

            FillPrimitive prevThumbFill = new FillPrimitive();

            prevThumbFill.Class = "SplitterThumbFill";
            prevSplitterButton.Children.Add(prevThumbFill);

            prevSplitterArrow           = new ArrowPrimitive();
            prevSplitterArrow.MinSize   = new Size(4, 4);
            prevSplitterArrow.Direction = ArrowDirection.Left;
            prevSplitterArrow.Alignment = ContentAlignment.MiddleCenter;
            prevSplitterArrow.Class     = "SplitterThumbArrow";
            prevSplitterButton.Children.Add(prevSplitterArrow);

            BorderPrimitive prevThumbBorder = new BorderPrimitive();

            prevThumbBorder.Class = "SplitterThumbBorder";
            prevSplitterButton.Children.Add(prevThumbBorder);

            nextSplitterButton       = new RadButtonElement();
            nextSplitterButton.Class = "SplitterThumb";
            layout.Children.Add(nextSplitterButton);

            FillPrimitive nextThumbFill = new FillPrimitive();

            nextThumbFill.Class = "SplitterThumbFill";
            nextSplitterButton.Children.Add(nextThumbFill);

            nextSplitterArrow           = new ArrowPrimitive();
            nextSplitterArrow.MinSize   = new Size(4, 4);
            nextSplitterArrow.Direction = ArrowDirection.Right;
            nextSplitterArrow.Alignment = ContentAlignment.MiddleCenter;
            nextSplitterArrow.Class     = "SplitterThumbArrow";
            nextSplitterButton.Children.Add(nextSplitterArrow);

            BorderPrimitive nextThumbBorder = new BorderPrimitive();

            nextThumbBorder.Class = "SplitterThumbBorder";
            nextSplitterButton.Children.Add(nextThumbBorder);
        }
コード例 #18
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
            this.StretchVertically  = false;
            this.buttonElement      = new RadButtonElement();
            this.buttonElement.Text = LocalizationProvider <RadTimePickerLocalizationProvider> .CurrentProvider.GetLocalizedString("CloseButtonText");

            this.buttonElement.Click += new EventHandler(this.buttonElement_Click);
            this.buttonElement.StretchHorizontally = false;
            this.Children.Add((RadElement)this.buttonElement);
        }
コード例 #19
0
        protected virtual RadButtonElement CreateColorPickerButtonElement()
        {
            RadButtonElement element = new RadButtonElement();

            element.StretchHorizontally = false;
            element.StretchVertically   = true;
            element.Text   = ". . .";
            element.Click += new EventHandler(ButtonElement_Click);

            return(element);
        }
コード例 #20
0
 protected override void CreateChildElements()
 {
     base.CreateChildElements();
     this.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
     this.fill         = new FillPrimitive();
     this.fill.Class   = "TitleFill";
     this.Children.Add((RadElement)this.fill);
     this.layout = new DockLayoutPanel();
     this.layout.StretchVertically   = true;
     this.layout.StretchHorizontally = true;
     this.layout.LastChildFill       = false;
     this.Children.Add((RadElement)this.layout);
     this.systemButtons                         = new StackLayoutPanel();
     this.systemButtons.ZIndex                  = 10;
     this.systemButtons.Alignment               = ContentAlignment.MiddleRight;
     this.minimizeButton                        = (RadButtonElement) new RadImageButtonElement();
     this.minimizeButton.StretchHorizontally    = false;
     this.minimizeButton.StretchVertically      = false;
     this.minimizeButton.Class                  = "MinimizeButton";
     this.minimizeButton.ButtonFillElement.Name = "MinimizeButtonFill";
     this.minimizeButton.CanFocus               = false;
     this.minimizeButton.ThemeRole              = "MDIStripMinimizeButton";
     this.systemButtons.Children.Add((RadElement)this.minimizeButton);
     this.maximizeButton = (RadButtonElement) new RadImageButtonElement();
     this.maximizeButton.StretchHorizontally = false;
     this.maximizeButton.StretchVertically   = false;
     this.maximizeButton.Class = "MaximizeButton";
     this.maximizeButton.ButtonFillElement.Name = "MaximizeButtonFill";
     this.maximizeButton.CanFocus  = false;
     this.maximizeButton.ThemeRole = "MDIStripMaximizeButton";
     this.systemButtons.Children.Add((RadElement)this.maximizeButton);
     this.closeButton = (RadButtonElement) new RadImageButtonElement();
     this.closeButton.StretchHorizontally = false;
     this.closeButton.StretchVertically   = false;
     this.closeButton.Class = "CloseButton";
     this.closeButton.ButtonFillElement.Name = "CloseButtonFill";
     this.closeButton.CanFocus  = false;
     this.closeButton.ThemeRole = "MDIStripCloseButton";
     this.systemButtons.Children.Add((RadElement)this.closeButton);
     this.mdiFormIcon       = new ImagePrimitive();
     this.mdiFormIcon.Class = "MdiStripIcon";
     this.mdiFormIcon.StretchHorizontally = false;
     this.mdiFormIcon.StretchVertically   = false;
     this.mdiFormIcon.CanFocus            = false;
     this.mdiFormIcon.Margin      = new Padding(1, 1, 0, 0);
     this.mdiFormIcon.MaxSize     = new Size(16, 16);
     this.mdiFormIcon.ImageLayout = ImageLayout.Stretch;
     this.layout.Children.Add((RadElement)this.mdiFormIcon);
     this.layout.Children.Add((RadElement)this.systemButtons);
     DockLayoutPanel.SetDock((RadElement)this.systemButtons, Dock.Right);
     DockLayoutPanel.SetDock((RadElement)this.mdiFormIcon, Dock.Left);
 }
コード例 #21
0
ファイル: RadButtonBase.cs プロジェクト: configare/hispeed
        protected override void CreateChildItems(RadElement parent)
        {
            if (this.buttonElement == null)
            {
                this.buttonElement = CreateButtonElement();
            }

            this.buttonElement.Click += new EventHandler(ButtonElement_Click);
            this.RootElement.Children.Add(buttonElement);
            this.buttonElement.BindProperty(RadButtonElement.AutoSizeModeProperty, this.RootElement, RootRadElement.AutoSizeModeProperty, PropertyBindingOptions.OneWay);

            base.CreateChildItems(parent);
        }
コード例 #22
0
 protected override void CreateChildElements()
 {
     base.CreateChildElements();
     this.arrow       = new ArrowPrimitive();
     this.arrow.Class = "GroupFieldArrowElement";
     this.Children.Add((RadElement)this.arrow);
     this.removeButton                          = (RadButtonElement) new GridGroupHeaderItemButtonElement();
     this.removeButton.Class                    = "HeaderItemButtonElement";
     this.removeButton.Children[0].Class        = "HeaderItemButtonElementFill";
     this.removeButton.Children[2].Class        = "HeaderItemButtonElementBorder";
     this.removeButton.NotifyParentOnMouseInput = false;
     this.removeButton.Click                   += new EventHandler(this.RemoveButton_Click);
     this.Children.Add((RadElement)this.removeButton);
 }
コード例 #23
0
 protected override void CreateChildElements()
 {
     this.MinSize         = new Size(132, 0);
     this.items           = new RadItemOwnerCollection();
     this.items.ItemTypes = new System.Type[2]
     {
         typeof(BackstageTabItem),
         typeof(BackstageButtonItem)
     };
     this.items.Owner              = (RadElement)this;
     this.backButtonElement        = this.CreateBackButtonElement();
     this.backButtonElement.Click += new EventHandler(this.backButtonElement_Click);
     this.Children.Add((RadElement)this.backButtonElement);
     base.CreateChildElements();
 }
コード例 #24
0
 protected virtual void ResetItemsIsAtUnevenIndexProperty()
 {
     for (int index = 0; index < this.items.Count; ++index)
     {
         if (this.items[index].GetType().Equals(typeof(RadButtonElement)))
         {
             RadButtonElement radButtonElement = this.items[index] as RadButtonElement;
             if ((object)radButtonElement.StateManager.GetType() != (object)typeof(ItemInButtonGroupStateManager))
             {
                 radButtonElement.StateManager = new ItemInButtonGroupStateManager().StateManagerInstance;
             }
             int num = (int)radButtonElement.SetDefaultValueOverride(RadRibbonBarButtonGroup.IsItemAtEndIndexProperty, (object)(index + 1 == this.items.Count));
         }
     }
 }
コード例 #25
0
 private void PreserveOldImage(RadButtonElement button)
 {
     if (button.Image != null)
     {
         button.SetValue(RadButtonElement.LargeImageProperty, button.Image);
     }
     else if (button.ImageIndex != -1)
     {
         button.SetValue(RadButtonElement.LargeImageIndexProperty, button.ImageIndex);
     }
     else if (button.ImageKey == string.Empty)
     {
         button.SetValue(RadButtonElement.LargeImageKeyProperty, button.ImageKey);
     }
 }
コード例 #26
0
        private RadButtonElement CreateCancelButton()
        {
            RadButtonElement radButtonElement = new RadButtonElement();

            radButtonElement.Padding = new Padding(5);
            radButtonElement.Click  += (EventHandler)((param0, param1) =>
            {
                if (!this.IsCropping)
                {
                    return;
                }
                this.imageEditorElement.StopCrop(false);
            });
            return(radButtonElement);
        }
コード例 #27
0
 private void CreateBuiltInVisualStyleCommand(Telerik.WinControls.UI.RadButtonElement btnCmd, string key, string text, Color imageColor)
 {
     try
     {
         btnCmd.Tag        = imageColor;
         btnCmd.Text       = text; //Common.TranslateText(Enums.InterFaces.Home, text, Enums.TextType.Labels);
         btnCmd.Image      = CreateColorImage(imageColor, 32, 32);
         btnCmd.SmallImage = CreateColorImage(imageColor, 32, 32);
     }
     catch (Exception ex)
     {
         throw ex;
         //OfficeDialog.OfficeBox.Show(ex.Message, ex.TargetSite.Name.ToString(), MessageBoxButtons.OK, OfficeBoxIcon.Error);
         //Common.LogMessage(ex);
     }
 }
コード例 #28
0
 private void PreserveOldImage(RadButtonElement button)
 {
     if (button.Image != null && button.SmallImage != button.Image)
     {
         int num1 = (int)button.SetValue(RadButtonElement.LargeImageProperty, (object)button.Image);
     }
     if (button.ImageIndex != -1)
     {
         int num2 = (int)button.SetValue(RadButtonElement.LargeImageIndexProperty, (object)button.ImageIndex);
     }
     if (!(button.ImageKey != string.Empty))
     {
         return;
     }
     int num3 = (int)button.SetValue(RadButtonElement.LargeImageKeyProperty, (object)button.ImageKey);
 }
コード例 #29
0
        protected virtual void ResetItemsIsAtUnevenIndexProperty()
        {
            for (int i = 0; i < this.items.Count; i++)
            {
                if (items[i].GetType().Equals(typeof(RadButtonElement)))
                {
                    RadButtonElement buttonElement = this.items[i] as RadButtonElement;

                    if (buttonElement.StateManager.GetType() != typeof(ItemInButtonGroupStateManager))
                    {
                        buttonElement.StateManager = new ItemInButtonGroupStateManager().StateManagerInstance;
                    }

                    buttonElement.SetDefaultValueOverride(RadRibbonBarButtonGroup.IsItemAtEndIndexProperty, i + 1 == this.items.Count);
                }
            }
        }
コード例 #30
0
        private RadItem CloneItem(RadItem item)
        {
            RadItem itemToReturn = null;

            if (item is RadButtonElement)
            {
                itemToReturn      = new RadButtonElement();
                itemToReturn.Text = item.Text;

                if (this.imageList != null)
                {
                    int index = (item as RadButtonElement).ImageIndex;
                    if (index >= 0)
                    {
                        (itemToReturn as RadButtonElement).Image = imageList.Images[index];
                    }
                }
                else
                {
                    (itemToReturn as RadButtonElement).Image = (item as RadButtonElement).Image;
                }
            }


            if (item is RadDropDownButtonElement)
            {
                itemToReturn      = new RadDropDownButtonElement();
                itemToReturn.Text = item.Text;

                if (this.imageList != null)
                {
                    int index = (item as RadDropDownButtonElement).ImageIndex;
                    if (index >= 0)
                    {
                        (itemToReturn as RadDropDownButtonElement).Image = imageList.Images[index];
                    }
                }
                else
                {
                    (itemToReturn as RadDropDownButtonElement).Image = (item as RadDropDownButtonElement).Image;
                }
            }

            return(itemToReturn);
        }