DotNet 4.8.1 build of DotNetBar

This commit is contained in:
2025-02-07 10:35:23 -05:00
parent 33439b63a0
commit 6b0a5d60f4
2609 changed files with 989814 additions and 7 deletions

View File

@@ -0,0 +1,59 @@
using System;
using System.ComponentModel;
using System.Drawing.Design;
using System.Windows.Forms.Design;
namespace DevComponents.Instrumentation.Design
{
public class FormatStringEditor : UITypeEditor
{
#region GetEditStyle
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return (UITypeEditorEditStyle.DropDown);
}
#endregion
#region GetPaintValueSupported
public override bool GetPaintValueSupported(ITypeDescriptorContext context)
{
return (false);
}
#endregion
#region EditValue
public override object EditValue(
ITypeDescriptorContext context, IServiceProvider provider, object value)
{
if (provider != null)
{
IWindowsFormsEditorService editorService =
provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
if (editorService != null)
{
FormatStringDropDown fs = new
FormatStringDropDown((string)value, editorService, context);
fs.EscapePressed = false;
editorService.DropDownControl(fs);
if (fs.EscapePressed == true)
context.PropertyDescriptor.SetValue(context.Instance, value);
else
return (fs.FormatString);
}
}
return (base.EditValue(context, provider, value));
}
#endregion
}
}