C# 我可以从哈希代码中获取对象吗?
他们有没有办法从散列码中获取对象?? 实际上,问题是我在应用程序中发现了一些绑定警告&每个警告都有相同的源哈希代码。我试着按源名称和目标名称搜索,但没有找到这样的东西 所以,请帮助我找到对象、样式或控件模板,绑定警告实际来自哪里??或者帮助我通过其哈希代码查找发出警告的对象 下面是绑定警告C# 我可以从哈希代码中获取对象吗?,c#,wpf,binding,storyboard,hashcode,C#,Wpf,Binding,Storyboard,Hashcode,他们有没有办法从散列码中获取对象?? 实际上,问题是我在应用程序中发现了一些绑定警告&每个警告都有相同的源哈希代码。我试着按源名称和目标名称搜索,但没有找到这样的东西 所以,请帮助我找到对象、样式或控件模板,绑定警告实际来自哪里??或者帮助我通过其哈希代码查找发出警告的对象 下面是绑定警告 System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard wa
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='SkipToFill'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='33003048'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='DevExpress.Xpf.Editors.ErrorControl: DevExpress.Xpf.Grid.GridCellValidationError'; TargetElement.HashCode='56844144'; TargetElement.Type='DevExpress.Xpf.Editors.ErrorControl'
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='SkipToFill'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='33003048'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='DevExpress.Xpf.Editors.ErrorControl: DevExpress.Xpf.Grid.GridCellValidationError'; TargetElement.HashCode='64558826'; TargetElement.Type='DevExpress.Xpf.Editors.ErrorControl'
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='SkipToFill'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='33003048'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='DevExpress.Xpf.Editors.ErrorControl: DevExpress.Xpf.Grid.GridCellValidationError'; TargetElement.HashCode='16230876'; TargetElement.Type='DevExpress.Xpf.Editors.ErrorControl'
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='SkipToFill'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='33003048'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='DevExpress.Xpf.Editors.ErrorControl: DevExpress.Xpf.Grid.GridCellValidationError'; TargetElement.HashCode='40603406'; TargetElement.Type='DevExpress.Xpf.Editors.ErrorControl'
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='SkipToFill'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='33003048'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='DevExpress.Xpf.Editors.ErrorControl: DevExpress.Xpf.Grid.GridCellValidationError'; TargetElement.HashCode='47611344'; TargetElement.Type='DevExpress.Xpf.Editors.ErrorControl'
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='SkipToFill'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='33003048'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='DevExpress.Xpf.Editors.ErrorControl: DevExpress.Xpf.Grid.GridCellValidationError'; TargetElement.HashCode='6250841'; TargetElement.Type='DevExpress.Xpf.Editors.ErrorControl'
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='SkipToFill'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='33003048'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='DevExpress.Xpf.Editors.ErrorControl: DevExpress.Xpf.Grid.GridCellValidationError'; TargetElement.HashCode='25349309'; TargetElement.Type='DevExpress.Xpf.Editors.ErrorControl'
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='SkipToFill'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='33003048'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='DevExpress.Xpf.Editors.ErrorControl: DevExpress.Xpf.Grid.GridCellValidationError'; TargetElement.HashCode='35348398'; TargetElement.Type='DevExpress.Xpf.Editors.ErrorControl'
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='SkipToFill'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='33003048'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='DevExpress.Xpf.Editors.ErrorControl: DevExpress.Xpf.Grid.GridCellValidationError'; TargetElement.HashCode='4124450'; TargetElement.Type='DevExpress.Xpf.Editors.ErrorControl'
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='SkipToFill'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='33003048'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='DevExpress.Xpf.Editors.ErrorControl: DevExpress.Xpf.Grid.GridCellValidationError'; TargetElement.HashCode='21506238'; TargetElement.Type='DevExpress.Xpf.Editors.ErrorControl'
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='SkipToFill'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='33003048'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='DevExpress.Xpf.Editors.ErrorControl: DevExpress.Xpf.Grid.GridCellValidationError'; TargetElement.HashCode='18846426'; TargetElement.Type='DevExpress.Xpf.Editors.ErrorControl'
如何获取这些警告的来源??有人能帮我吗?散列代码是一种方式,你可以从一个对象获得散列,但不能从另一种方式获得。散列函数是一种方式,你向它传递一个输入值,它将始终输出相同的值 所以不,你不能反向,也就是说,你不能反过来(从散列中生成对象)。 哈希函数用于将任意大小的数字数据映射为固定大小的数字数据,因此存在哈希代码计算固有的信息丢失 这就是说,你们会质疑空气的气味。我认为您需要调试问题发生在
wpf
中的原因,并且作为一种解决方法,您正在尝试使用hashcode对其进行调试
解决这个问题的一种方法是找出所有对象的hashcode
,并将它们与攻击性的hashcode
进行比较
可以使用以下代码执行此操作:
private string GetStoryBoardNameByHashCode(int hashCode)
{
foreach (DictionaryEntry resource in Resources)
{
if (resource.Value is Storyboard)
{
if (resource.GetHashCode() == hashCode)
return ((Storyboard) resource.Value).Name;
}
}
return String.Empty;
}
并按以下方式执行,如中所述:
另一种可能是Begin
部分缺少Stop
,如中所述
另外,您可能想看看。您能在这里发布绑定错误吗?您好,peter,看到这些异常即将出现……实际上这些是警告,但我将警告视为错误。。我也必须移除警告。但我如何才能得到那个物体???。。我知道,通过使用GetHashCode()方法,可以从一个对象获取它的hashCode。但在我的情况下,我想倒过来,“但不是相反”。你不能。
string storyBoardName = GetStoryBoardNameByHashCode(65981734);