jjzjj

errorCollection

全部标签

c# - 如何为多个 BO 属性定义 IDataErrorInfo 错误属性

我开始通过IDataErrorInfo接口(interface)在我的WPF项目中实现验证。我的业务对象包含多个带有验证信息的属性。如何获取与该对象关联的所有错误消息的列表。我的想法是,这就是Error属性的用途,但我无法找到任何人使用它来报告多个属性。谢谢!publicstringthis[stringproperty]{get{stringmsg=null;switch(property){case"LastName":if(string.IsNullOrEmpty(LastName))msg="Needalastname";break;case"FirstName":if(str

c# - 在 Visual Studio 中签署程序集时出现加密失败

我不知道我错在哪里。当我构建它时,它会搜索DLL的默认路径以进行登录。尽管我指定了路径。我已创建.snk文件并将其存储在与DLL相同的位置。//AssemblyinfofileforerrorcollectionusingSystem.Reflection;usingSystem.Runtime.CompilerServices;usingSystem.Runtime.InteropServices;//GeneralInformationaboutanassemblyiscontrolledthroughthefollowing//setofattributes.Changethes