プロパティの値が作成者のコレクションであるプロパティ グリッドのプロパティを定義します。CreatorsEditorクラスを定義します。このクラスでは、HumanRolesCode変数を使用します。設定値のプロパティの属性でこの変数にアクセスするにはどうすればよいですか。HumanRolesCode の値を変更したい。例: [Editor(typeof(CreatorsEditor(HumanRolesCode = 10))]
私のコードは:
[Editor(typeof(CreatorsEditor), typeof(UITypeEditor))]
public string Creators { get; set; }
//-------------------------------------
public class CreatorsEditor : UITypeEditor
{
    public static int HumanRolesCode;
    public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
    {
        return UITypeEditorEditStyle.Modal;
    }
    public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
    {
        IWindowsFormsEditorService svc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
        if (svc != null)
        {
            CreatorFrm.HumanRoleCode = HumanRolesCode;
            CreatorFrm Frm = new CreatorFrm();
            if (svc.ShowDialog(Frm) == System.Windows.Forms.DialogResult.OK)
            {
                string HumanNames = "";
                for (int i = 0; i < Frm.DgvCreator.Rows.Count; i++)
                    if (Boolean.Parse(Frm.DgvCreator[0, i].Value.ToString()) == true)
                        HumanNames += Frm.DgvCreator[2, i].Value.ToString() + " , ";
                if (!string.IsNullOrEmpty(HumanNames))
                    HumanNames = HumanNames.Substring(0, HumanNames.Length - 3);
                return HumanNames;
            }
        }
        return value;
    }
}