我可以从哈希代码中获取对象吗?

本文关键字:取对象 获取 哈希 代码 我可以 | 更新日期: 2023-09-27 18:30:46

他们有什么方法可以从哈希代码中获取对象吗???

实际上,问题是我在我们的应用程序中发现了一些绑定警告,并且每个警告都具有相同的源哈希代码。我尝试按源名称和目标名称搜索,但没有找到这样的东西。

所以请帮我找到对象或样式或控件模板,实际上绑定警告在哪里来??或者帮助我通过其哈希代码找到警告所在的对象。

绑定后警告即将到来。

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'

我怎样才能得到这些警告的来源?谁能帮我???

我可以从哈希代码中获取对象吗?

哈希函数是一种方式,你给它传递一个输入值,它将始终输出相同的值。

所以不,你不能反转,也就是说,你不能反过来做(从哈希生成对象)。哈希函数用于将任意大小的数字数据映射到固定大小的数字数据,因此存在哈希码计算所固有的信息丢失。

也就是说,你质疑X-Y问题的气味。我认为您想调试为什么问题发生在 wpf 中,并且作为一种弄清楚的方法,您正在尝试使用哈希码对其进行调试。

解决此问题的一种方法是找出计算所有对象的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;
}

并按如下方式执行它,如本答案所述:

    string storyBoardName = GetStoryBoardNameByHashCode(65981734);

另一种可能性是Begin部分缺少Stop,如本答案所述

另外,您可能想在DevExpress上查看此票证。

哈希代码是一种方式,您可以从对象获取哈希,但不能从相反的方式获取哈希。