已添加了具有相同鍵的項(xiàng)

“HemoSystemClient.ConstantModel”的類型初始值設(shè)定項(xiàng)引發(fā)異常。
   在 HemoSystemClient.ConstantModel.GetDataGridStyle(String typeName)
   在 HemoSystemClient.CustomDataGridView.CustomGridView.GenerateColumnByGridStyle() 位置 D:\RjyxProgram\HemoSystem\HemoSystemClient\CustomDataGridView\CustomGridView.cs:行號 437
   在 HemoSystemClient.CustomDataGridView.CustomGridView.<Init>b__15_0(Object sender, EventArgs e) 位置 D:\RjyxProgram\HemoSystem\HemoSystemClient\CustomDataGridView\CustomGridView.cs:行號 169
   在 System.Windows.Forms.DataGridView.OnDataSourceChanged(EventArgs e)
   在 System.Windows.Forms.DataGridView.set_DataSource(Object value)
   在 HemoSystemClient.Modules.UserLoginHistoryModule..ctor() 位置 D:\RjyxProgram\HemoSystem\HemoSystemClient\Modules\Privilege\UserLoginHistoryModule.cs:行號 105
   在 HemoSystemClient.MainForm..ctor() 位置 D:\RjyxProgram\HemoSystem\HemoSystemClient\MainForm.cs:行號 41
   在 HemoSystemClient.Program.RunProgram() 位置 D:\RjyxProgram\HemoSystem\HemoSystemClient\Program.cs:行號 63
--------------------------------------------------------------------
已添加了具有相同鍵的項(xiàng)。
   在 System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   在 System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   在 System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   在 HemoSystemClient.ConstantModel.AddDataGridStyleMap(Dictionary`2 gridStyleMap) 位置 D:\RjyxProgram\HemoSystem\HemoSystemClient\ConstantModels.cs:行號 290
   在 HemoSystemClient.ConstantModel..cctor() 位置 D:\RjyxProgram\HemoSystem\HemoSystemClient\ConstantModels.cs:行號 279

原因:nameof(HL7RMYYZyBqyz) 不是 本類對象。字典集。

public partial class HL7RMYYZyBlnr
    {
        public byte[] RV { get; set; }

        public static Dictionary<String, DataGridStyle> DataGridStyleMap = new Dictionary<string, DataGridStyle>()
        {
            {nameof(HL7RMYYZyBqyz) + "." + nameof(Blnr), new DataGridStyle{ ColumnTitle = "病歷內(nèi)容" , DisplayIndex = 10} },
        };
    }
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

推薦閱讀更多精彩內(nèi)容