添加项目文件。
This commit is contained in:
32
CowainHmi/Alarm/AlarmUIEditor.cs
Normal file
32
CowainHmi/Alarm/AlarmUIEditor.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using PCHMI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing.Design;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms.Design;
|
||||
|
||||
namespace CowainHmi.Alarm
|
||||
{
|
||||
public class AlarmUIEditor : UITypeEditor
|
||||
{
|
||||
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
|
||||
{
|
||||
return UITypeEditorEditStyle.Modal;
|
||||
}
|
||||
|
||||
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
|
||||
{
|
||||
IWindowsFormsEditorService windowsFormsEditorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
|
||||
if (windowsFormsEditorService != null)
|
||||
{
|
||||
FrmEditAlarmTable form = new FrmEditAlarmTable((string)value);
|
||||
windowsFormsEditorService.ShowDialog(form);
|
||||
context.OnComponentChanged();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user