Example #1
0
		public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			if (context != null && context.Instance != null && provider != null)
			{
				edSvc = (IWindowsFormsEditorService) provider.GetService(typeof (IWindowsFormsEditorService));


				if (edSvc != null)
				{
					TextStyle style = (TextStyle) value;
					using (TextStyleDesignerDialog tsd = new TextStyleDesignerDialog(style))
					{
						context.OnComponentChanging();
						if (edSvc.ShowDialog(tsd) == DialogResult.OK)
						{
							this.ValueChanged(this, EventArgs.Empty);
							context.OnComponentChanged();
							return style;
						}

					}
				}
			}

			return value;
		}
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context != null && context.Instance != null && provider != null)
            {
                edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));


                if (edSvc != null)
                {
                    TextStyle style = (TextStyle)value;
                    using (TextStyleDesignerDialog tsd = new TextStyleDesignerDialog(style))
                    {
                        context.OnComponentChanging();
                        if (edSvc.ShowDialog(tsd) == DialogResult.OK)
                        {
                            this.ValueChanged(this, EventArgs.Empty);
                            context.OnComponentChanged();
                            return(style);
                        }
                    }
                }
            }

            return(value);
        }