本文整理汇总了C#中IDataObject.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# IDataObject.GetHashCode方法的具体用法?C# IDataObject.GetHashCode怎么用?C# IDataObject.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDataObject
的用法示例。
在下文中一共展示了IDataObject.GetHashCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetProxyObject
/// <summary>
/// Gets proxy object from source object.
/// </summary>
/// <param name="sourceObject">Source DataObject.</param>
/// <returns>Proxied DataObject.</returns>
private IDataObject GetProxyObject(IDataObject sourceObject)
{
IDataObject destinationObject = convertedObjectsCache.Get<DataObject>(sourceObject.GetHashCode().ToString());
if (destinationObject != null)
{
if (IsReferenceObject(sourceObject))
{
IDataObject referencedObject = LightHouse.Elite.Core.Builder.GetDataObject(sourceObject.GetType(), false);
referencedObject.ID = sourceObject.ID;
referencedObject.DynamicType = sourceObject.DynamicType;
return referencedObject;
}
}
else
{
destinationObject = LightHouse.Elite.Core.Builder.GetDataObject(sourceObject.GetType(), false);
convertedObjectsCache.Add(sourceObject.GetHashCode().ToString(), destinationObject);
}
MergeDataObject(destinationObject, sourceObject, false);
return destinationObject;
}
示例2: Equals
/// <summary>
/// 현재 개체가 동일한 형식의 다른 개체와 같은지 여부를 나타냅니다.
/// </summary>
/// <returns>
/// 현재 개체가 <paramref name="other"/> 매개 변수와 같으면 true이고, 그렇지 않으면 false입니다.
/// </returns>
/// <param name="other">이 개체와 비교할 개체입니다.</param>
public virtual bool Equals(IDataObject other) {
return (other != null) &&
(GetType() == other.GetType()) &&
GetHashCode().Equals(other.GetHashCode());
}