コード例 #1
0
        public override ControlStyleBuilderInfoList GetThemeDesignedControls(Control previewSurface)
        {
            ControlStyleBuilderInfoList res = new ControlStyleBuilderInfoList();
            Rectangle editorBounds          = new Rectangle(0, 0, 186, 24);
            Rectangle popupBounds           = new Rectangle(0, 0, 200, 80);

            // DateTimePicker
            RadDateTimePicker radDateTimePickerPreview = new RadDateTimePicker();

            radDateTimePickerPreview.Text   = "RadDropDown";
            radDateTimePickerPreview.Bounds = editorBounds;
            // TODO: remove this PATCH!!!
            radDateTimePickerPreview.LayoutManager.UpdateLayout();

            RadDateTimePicker radDateTimePickerStructure = new RadDateTimePicker();

            radDateTimePickerStructure.Bounds = editorBounds;

            ControlStyleBuilderInfo designed = new ControlStyleBuilderInfo(radDateTimePickerPreview, radDateTimePickerStructure.RootElement);

            designed.Placemenet           = PreviewControlPlacemenet.MiddleCenter;
            designed.MainElementClassName = typeof(RadDateTimePickerElement).FullName;
            res.Add(designed);

            // Popup panel
            //ComboBoxPopupControl popupPanelPreview = new ComboBoxPopupControl();
            RadDateTimePickerDropDown popupPanelPreview = new RadDateTimePickerDropDown(null);

            RadCalendar calendar = new RadCalendar();

            calendar.Bounds = popupBounds;

            popupPanelPreview.HostedControl = calendar;
            popupPanelPreview.Bounds        = popupBounds;
            //popupPanelPreview.PreviewMode = true;

            RadDateTimePickerDropDown popupPanelStructure = new RadDateTimePickerDropDown(null);

            popupPanelStructure.HostedControl = new RadCalendar();
            popupPanelStructure.Bounds        = popupBounds;


            designed            = new ControlStyleBuilderInfo(popupPanelPreview, popupPanelStructure.RootElement);
            designed.Placemenet = PreviewControlPlacemenet.ParentBottomLeft;
            res.Add(designed);

            return(res);
        }
コード例 #2
0
        protected virtual Control CreateDateTime(PropertyDescriptor property)
        {
            Control control;

            if (this.DataEntryControl.Site == null)
            {
                RadDateTimePicker           radDateTimePicker = new RadDateTimePicker();
                EditorInitializingEventArgs e = new EditorInitializingEventArgs(property, (Control)radDateTimePicker, radDateTimePicker.GetType());
                this.OnEditorInitializing((object)this, e);
                if (e.Cancel)
                {
                    return((Control)null);
                }
                control = e.Editor;
                this.OnEditorInitialized((object)this, new EditorInitializedEventArgs(property, (Control)radDateTimePicker, radDateTimePicker.GetType()));
            }
            else
            {
                Control component             = (Control)(this.designerHost.CreateComponent(typeof(RadDateTimePicker)) as RadDateTimePicker);
                EditorInitializingEventArgs e = new EditorInitializingEventArgs(property, component, component.GetType());
                this.OnEditorInitializing((object)this, e);
                if (e.Cancel)
                {
                    return((Control)null);
                }
                control = !object.ReferenceEquals((object)e.Editor, (object)component) ? this.designerHost.CreateComponent(e.EditorType) as Control : e.Editor;
                this.OnEditorInitialized((object)this, new EditorInitializedEventArgs(property, control, control.GetType()));
            }
            Binding binding = this.CreateBinding(control, "Value", property.Name);

            if (binding != null)
            {
                control.DataBindings.Add(binding);
            }
            return(control);
        }
コード例 #3
0
 public RadDateTimePickerAccessibleObject(RadDateTimePicker owner) : base(owner)
 {
     this.owner = owner;
     this.owner.DateTimePickerElement.TextChanged += new EventHandler(owner_TextChanged);
 }