-
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.ComponentModel;
- namespace xmlTojson
- {
- [Editor(typeof(MyTestUITypeEditor),typeof(System.Drawing.Design.UITypeEditor))]
- [Browsable(true)]
- public class MyTestProperty
- {
- #region Property
- /// <summary>
- /// 姓名
- /// </summary>
- private string _Name = null;
- public string Name
- {
- get { return _Name; }
- set { _Name = value; }
- }
- /// <summary>
- /// 性别
- /// </summary>
- private string _Sex = null;
- public string Sex
- {
- get { return _Sex; }
- set { _Sex = value; }
- }
- /// <summary>
- /// 年龄
- /// </summary>
- private string _Age = null;
- public string Age
- {
- get { return _Age; }
- set { _Age = value; }
- }
- #endregion
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.ComponentModel;
- using System.Drawing.Design;
- namespace xmlTojson
- {
- [System.Runtime.InteropServices.ComVisible(true)]
- public class MyTestUITypeEditor : UITypeEditor
- {
- public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
- {
- //return base.GetEditStyle(context);
- return UITypeEditorEditStyle.Modal;
- }
- public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
- {
- //return base.EditValue(context, provider, value);
- return value;
- }
- }
- }