Пример #1
0
        public bool PropertyGridItemsSetValue(PropertyValueChangedEventArgs e)
        {
            bool r = false;

            foreach (AvailablePlugIn <IPlugIn> p in this.AvailablePlugInCollection)
            {
                CustomProperty.CustomPropertyDescriptor d = e.ChangedItem.PropertyDescriptor as CustomProperty.CustomPropertyDescriptor;
                if (d == null)
                {
                    continue;
                }
                CustomProperty c = d.CustomProperty as CustomProperty;
                if (c == null || false == c.Tag.Equals(p.Instance.ID))
                {
                    continue;
                }
                IPlugInUI u = p.Instance as IPlugInUI;
                if (u != null)
                {
                    u.UISetValue(e);
                    r = true;
                    break;
                }
            }
            return(r);
        }
Пример #2
0
        private void SetTextStyleValue(CustomProperty.CustomPropertyDescriptor cpd)
        {
            if (cpd == null)
            {
                return;
            }
            CustomProperty cp = cpd.CustomProperty as CustomProperty;

            if (cp.Name == "Font")
            {
                Font font = cp.Value as Font;
                DrawingFontStyles tStyle = DrawingFontStyles.Regular;
                if (font.Style == FontStyle.Bold)
                {
                    tStyle = DrawingFontStyles.Bold;
                }
                if (font.Style == FontStyle.Italic)
                {
                    tStyle = DrawingFontStyles.Italic;
                }
                if (font.Style == FontStyle.Strikeout)
                {
                    tStyle = DrawingFontStyles.Strikeout;
                }
                if (font.Style == FontStyle.Underline)
                {
                    tStyle = DrawingFontStyles.Underline;
                }
                textStyle.Font = new GeoFont(font.FontFamily.Name,
                                             font.Size,
                                             tStyle);
            }
            if (cp.Name == "TextColor")
            {
                Color fillColor = (Color)cp.Value;
                textStyle.TextSolidBrush = new GeoSolidBrush(new GeoColor(fillColor.R,
                                                                          fillColor.G,
                                                                          fillColor.B));
            }
            if (cp.Name == "TextColumnName")
            {
                string textColumnName = cp.Value.ToString();
                textStyle.TextColumnName = textColumnName;
            }
        }
Пример #3
0
        private void Properties_PropertyValueChanged(System.Object s, System.Windows.Forms.PropertyValueChangedEventArgs e)
        {
            string message;

            StatusLabel.Image = SystemIcons.Information.ToBitmap();

            switch (e.ChangedItem.PropertyDescriptor.GetType().Name)
            {
            case "CustomPropertyDescriptor":

                CustomProperty.CustomPropertyDescriptor cpd = e.ChangedItem.PropertyDescriptor as CustomProperty.CustomPropertyDescriptor;
                if (cpd != null)
                {
                    CustomProperty cp = (PropertyGridEx.CustomProperty)cpd.CustomProperty;
                    if (cp == null)
                    {
                        return;
                    }
                    if (cp.Value != null)
                    {
                        message = " Value: " + cp.Value.ToString();
                        if (e.OldValue != null)
                        {
                            message = message + "; Previous: " + e.OldValue.ToString();
                        }
                        if (cp.SelectedItem != null)
                        {
                            message = message + "; SelectedItem: " + cp.SelectedItem.ToString();
                        }
                        if (cp.SelectedValue != null)
                        {
                            message = message + "; SelectedValue: " + cp.SelectedValue.ToString();
                        }
                        StatusLabel.Text = message;
                    }
                }
                break;

            case "MergePropertyDescriptor":


                message = " {MultiProperty [" + e.ChangedItem.Label + "]} " + e.ChangedItem.Value.ToString();
                if (e.OldValue == null)
                {
                    message = message + "; Nothing";
                }
                else
                {
                    message = message + "; " + e.OldValue.ToString();
                }
                StatusLabel.Text = message;
                break;

            case "ReflectPropertyDescriptor":

                message = " {NestedProperty [" + e.ChangedItem.Label + "]} " + e.ChangedItem.Value.ToString();
                if (e.OldValue == null)
                {
                    message = message + "; Nothing";
                }
                else
                {
                    message = message + "; " + e.OldValue.ToString();
                }
                StatusLabel.Text = message;
                break;


            default:

                StatusLabel.Image = SystemIcons.Error.ToBitmap();
                StatusLabel.Text  = " {Unknown PropertyDescriptor}";
                break;
            }
        }