Esempio n. 1
0
        private void InitializeComponent()
        {
            // resolve property descriptor to a value
            object appointmentImage = _imageStyleProperty.GetValue(_objectItem);
            // get inner properties using converter to get proper property type converters
            PropertyDescriptorCollection properties = _imageStyleProperty.Converter.GetProperties(appointmentImage);
            PropertyDescriptor           source     = properties[ImageStyle.SourcePropertyName];
            PropertyDescriptor           value      = properties[ImageStyle.ValuePropertyName];
            PropertyDescriptor           mimeType   = properties[ImageStyle.MimeTypePropertyName];

            HorizontalPanel panel1 = new HorizontalPanel();

            using (new SuspendLayoutTransaction(this))
                using (new SuspendLayoutTransaction(panel1))
                {
                    panel1.AutoSize = AutoSize = true;
                    panel1.Margin   = Utils.UpdateMarginByIndent(System.Windows.Forms.Padding.Empty, _serviceProvider, 1);
                    //
                    // _imageStyleLabel
                    //
                    ControlGroupHeadingLabel _imageStyleLabel = new ControlGroupHeadingLabel(_serviceProvider);
                    _imageStyleLabel.Dock = DockStyle.Top;
                    _imageStyleLabel.Text = Resources.ImageLabel;
                    //
                    // sourceEditor
                    //
                    sourceEditor =
                        new TypedValueEditor(_serviceProvider, Resources.SourceLabel,
                                             ComponentProperty.Create(source, appointmentImage));
                    sourceEditor.Validated += OnImageEditorChanged;
                    sourceEditor.Margin     = System.Windows.Forms.Padding.Empty;
                    //
                    // value Value
                    //
                    valueEditor =
                        new TypedValueEditor(_serviceProvider, Resources.ValueTypeLabel,
                                             ComponentProperty.Create(value, appointmentImage));
                    valueEditor.Validated += OnImageEditorChanged;
                    valueEditor.Margin     = Utils.UpdateMarginByIndent(System.Windows.Forms.Padding.Empty, valueEditor.ControlInfo, 1);
                    //
                    //style Value
                    //
                    mimeTypeEditor =
                        new TypedValueEditor(_serviceProvider, Resources.MimeTypeLabel,
                                             ComponentProperty.Create(mimeType, appointmentImage));
                    mimeTypeEditor.Validated += OnImageEditorChanged;
                    mimeTypeEditor.Margin     = System.Windows.Forms.Padding.Empty;

                    panel1.Controls.Add(sourceEditor);
                    panel1.Controls.Add(mimeTypeEditor);

                    Controls.Add(_imageStyleLabel);
                    Controls.Add(panel1);
                    Controls.Add(valueEditor);
                }
            isInitialized = true;
        }
Esempio n. 2
0
        private void InitializeComponent()
        {
            // resolve property descriptor to a value
            object appointmentImage = _lineStyleProperty.GetValue(_objectItem);
            // get inner properties using converter to get proper property type converters
            PropertyDescriptorCollection properties = _lineStyleProperty.Converter.GetProperties(appointmentImage);
            PropertyDescriptor           color      = properties[DesignLineStyle.LineColorPropertyName];
            PropertyDescriptor           width      = properties[DesignLineStyle.LineWidthPropertyName];
            PropertyDescriptor           style      = properties[DesignLineStyle.LineStylePropertyName];

            using (new SuspendLayoutTransaction(this))
            {
                this.AutoSize = true;
                //
                // _imageStyleLabel
                //
                ControlGroupHeadingLabel lineStyleLabel = new ControlGroupHeadingLabel(_serviceProvider);
                lineStyleLabel.Dock = DockStyle.Top;
                lineStyleLabel.Text = Resources.LineStyleLabel;
                Controls.Add(lineStyleLabel);

                HorizontalPanel horzPanel = new HorizontalPanel();
                horzPanel.AutoSize = true;
                horzPanel.Dock     = DockStyle.Top;
                horzPanel.Margin   = Utils.UpdateMarginByIndent(System.Windows.Forms.Padding.Empty, _serviceProvider, 1);
                Controls.Add(horzPanel);
                //
                // styleEditor
                //
                styleEditor =
                    new TypedValueEditor(_serviceProvider, Resources.LineStyle,
                                         ComponentProperty.Create(style, appointmentImage));
                styleEditor.Validated += OnLineStyleEditorChanged;
                styleEditor.Margin     = System.Windows.Forms.Padding.Empty;
                horzPanel.Controls.Add(styleEditor);
                //
                // widthEditor
                //
                widthEditor =
                    new TypedValueEditor(_serviceProvider, Resources.LineWidth,
                                         ComponentProperty.Create(width, appointmentImage));
                widthEditor.Validated += OnLineStyleEditorChanged;
                widthEditor.Margin     = System.Windows.Forms.Padding.Empty;
                horzPanel.Controls.Add(widthEditor);
                //
                // colorEditor
                //
                colorEditor =
                    new TypedValueEditor(_serviceProvider, Resources.LineColor,
                                         ComponentProperty.Create(color, appointmentImage));
                colorEditor.Validated += OnLineStyleEditorChanged;
                colorEditor.Margin     = Utils.UpdateMarginByIndent(System.Windows.Forms.Padding.Empty, colorEditor.ControlInfo, 1);
                Controls.Add(colorEditor);
            }
            isInitialized = true;
        }
Esempio n. 3
0
        private void InitializeComponent()
        {
            // resolve property descriptor to a value
            object textStyleValue = _textStyleProperty.GetValue(_objectItem);
            // get inner properties using converter to get proper property type converters
            PropertyDescriptorCollection properties     = _textStyleProperty.Converter.GetProperties(textStyleValue);
            PropertyDescriptor           familyProp     = properties[DesignTextStyle.FontFamilyPropertyName];
            PropertyDescriptor           sizeProp       = properties[DesignTextStyle.FontSizePropertyName];
            PropertyDescriptor           styleProp      = properties[DesignTextStyle.FontStylePropertyName];
            PropertyDescriptor           weightProp     = properties[DesignTextStyle.FontWeightPropertyName];
            PropertyDescriptor           decorationProp = properties[DesignTextStyle.FontDecorationPropertyName];
            PropertyDescriptor           colorProp      = properties[DesignTextStyle.FontColorPropertyName];

            // panels
            HorizontalPanel mainPanel = new HorizontalPanel();
            VerticalPanel   panel1    = new VerticalPanel();
            VerticalPanel   panel2    = new VerticalPanel();

            using (new SuspendLayoutTransaction(this))
                using (new SuspendLayoutTransaction(mainPanel))
                    using (new SuspendLayoutTransaction(panel1))
                        using (new SuspendLayoutTransaction(panel2))
                        {
                            AutoSize           = true;
                            mainPanel.AutoSize = true;
                            panel1.AutoSize    = true;
                            panel2.AutoSize    = true;
                            mainPanel.Margin   = System.Windows.Forms.Padding.Empty;
                            panel1.Margin      = Utils.UpdateMarginByIndent(System.Windows.Forms.Padding.Empty, _serviceProvider, 1);
                            panel2.Margin      = System.Windows.Forms.Padding.Empty;

                            //
                            // headLabel
                            //
                            ControlGroupHeadingLabel headLabel = new ControlGroupHeadingLabel(_serviceProvider);
                            headLabel.Dock = DockStyle.Top;
                            headLabel.Text = Resources.CalendarSmartPanelFontLabel;
                            //
                            // familyEditor
                            //
                            familyEditor = new TypedValueEditor(_serviceProvider,
                                                                Resources.CalendarSmartPanelFontFamilyLabel, ComponentProperty.Create(familyProp, textStyleValue));
                            familyEditor.Validated += OnTextStyleEditorChanged;
                            familyEditor.Margin     = System.Windows.Forms.Padding.Empty;
                            //
                            // sizeEditor
                            //
                            sizeEditor = new TypedValueEditor(_serviceProvider,
                                                              Resources.CalendarSmartPanelFontSizeLabel, ComponentProperty.Create(sizeProp, textStyleValue));
                            sizeEditor.Validated += OnTextStyleEditorChanged;
                            sizeEditor.Margin     = System.Windows.Forms.Padding.Empty;
                            //
                            // styleEditor
                            //
                            styleEditor = new TypedValueEditor(_serviceProvider,
                                                               Resources.CalendarSmartPanelFontStyleLabel, ComponentProperty.Create(styleProp, textStyleValue));
                            styleEditor.Validated += OnTextStyleEditorChanged;
                            styleEditor.Margin     = System.Windows.Forms.Padding.Empty;
                            //
                            // colorEditor
                            //
                            colorEditor = new TypedValueEditor(_serviceProvider,
                                                               Resources.CalendarSmartPanelFontColorLabel, ComponentProperty.Create(colorProp, textStyleValue));
                            colorEditor.Validated += OnTextStyleEditorChanged;
                            colorEditor.Margin     = System.Windows.Forms.Padding.Empty;
                            //
                            // weight editor
                            //
                            weightEditor = new TypedValueEditor(_serviceProvider,
                                                                Resources.CalendarSmartPanelFontWeightLabel, ComponentProperty.Create(weightProp, textStyleValue));
                            weightEditor.Validated += OnTextStyleEditorChanged;
                            weightEditor.Margin     = System.Windows.Forms.Padding.Empty;
                            //
                            // decoration editor
                            //
                            decorationEditor = new TypedValueEditor(_serviceProvider,
                                                                    Resources.CalendarSmartPanelFontDecorationLabel, ComponentProperty.Create(decorationProp, textStyleValue));
                            decorationEditor.Validated += OnTextStyleEditorChanged;
                            decorationEditor.Margin     = System.Windows.Forms.Padding.Empty;
                            // panel1
                            //
                            panel1.Controls.Add(familyEditor);
                            panel1.Controls.Add(styleEditor);
                            panel1.Controls.Add(colorEditor);
                            //
                            // panel2
                            //
                            panel2.Controls.Add(sizeEditor);
                            panel2.Controls.Add(weightEditor);
                            panel2.Controls.Add(decorationEditor);

                            //
                            // mainPanel
                            //
                            mainPanel.Controls.Add(panel1);
                            mainPanel.Controls.Add(panel2);

                            Controls.Add(headLabel);
                            Controls.Add(mainPanel);
                        }

            isInitialized = true;
        }