Esempio n. 1
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            ImagePropertyDescriptor descriptor = (ImagePropertyDescriptor)context.PropertyDescriptor;
            string stringValue = ImagePropertyDescriptor.GetStringValue(descriptor.ImageProperty.Value, false);

            ShowValueDialog.Show(descriptor.DisplayName, descriptor.Description, stringValue);
            return(value);            //no edits allowed
        }
        public static void Show(string name, string description, string text)
        {
            ShowValueDialog dialog = new ShowValueDialog(text);
            DialogBoxForm   form   = new DialogBoxForm(dialog, new ImagePropertyDetailControl(name, description, text));

            form.Text            = SR.TitleDetails;
            form.CancelButton    = new CancelController(form);
            form.StartPosition   = FormStartPosition.Manual;
            form.DesktopLocation = Cursor.Position - new Size(form.DesktopBounds.Width / 2, form.DesktopBounds.Height / 2);
            form.ShowDialog();
            form.Dispose();
        }