internal static bool HandleAppControl(AppControlReceivedEventArgs args)
{
- if (!args.ReceivedAppControl.ExtraData.TryGet("__K_GADGET_RES_TYPE", out string resourceType) ||
- !args.ReceivedAppControl.ExtraData.TryGet("__K_GADGET_CLASS_NAME", out string className))
+ var extraData = args.ReceivedAppControl?.ExtraData;
+ if (extraData == null||!extraData.TryGet("__K_GADGET_RES_TYPE", out string resourceType) ||
+ !extraData.TryGet("__K_GADGET_CLASS_NAME", out string className))
{
return false;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode()
{
- var hashCode = -1064806749;
+ unchecked
+ {
+ var hashCode = -1064806749;
#pragma warning disable RECS0025 // Non-readonly field referenced in 'GetHashCode()'
- hashCode = hashCode * -1521134295 + left.GetHashCode();
- hashCode = hashCode * -1521134295 + bottom.GetHashCode();
- hashCode = hashCode * -1521134295 + right.GetHashCode();
- hashCode = hashCode * -1521134295 + top.GetHashCode();
+ hashCode = hashCode * -1521134295 + left.GetHashCode();
+ hashCode = hashCode * -1521134295 + bottom.GetHashCode();
+ hashCode = hashCode * -1521134295 + right.GetHashCode();
+ hashCode = hashCode * -1521134295 + top.GetHashCode();
#pragma warning restore RECS0025 // Non-readonly field referenced in 'GetHashCode()'
- return hashCode;
+ return hashCode;
+ }
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode()
{
- var hashCode = -1285340573;
+ unchecked
+ {
+ var hashCode = -1285340573;
- hashCode = hashCode * -1521134295 + pointA.GetHashCode();
- hashCode = hashCode * -1521134295 + pointB.GetHashCode();
- hashCode = hashCode * -1521134295 + distance.GetHashCode();
+ hashCode = hashCode * -1521134295 + pointA.GetHashCode();
+ hashCode = hashCode * -1521134295 + pointB.GetHashCode();
+ hashCode = hashCode * -1521134295 + distance.GetHashCode();
- return hashCode;
+ return hashCode;
+ }
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode()
{
- var hashCode = -475635172;
+ unchecked
+ {
+ var hashCode = -475635172;
- hashCode = hashCode * -1521134295 + count.GetHashCode();
- hashCode = hashCode * -1521134295 + normal.GetHashCode();
- hashCode = hashCode * -1521134295 + EqualityComparer<ContactPoint[]>.Default.GetHashCode(points);
+ hashCode = hashCode * -1521134295 + count.GetHashCode();
+ hashCode = hashCode * -1521134295 + normal.GetHashCode();
+ hashCode = hashCode * -1521134295 + EqualityComparer<ContactPoint[]>.Default.GetHashCode(points);
- return hashCode;
+ return hashCode;
+ }
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode()
{
- var hashCode = -1813971818;
+ unchecked
+ {
+ var hashCode = -1813971818;
- hashCode = hashCode * -1521134295 + red.GetHashCode();
- hashCode = hashCode * -1521134295 + green.GetHashCode();
- hashCode = hashCode * -1521134295 + blue.GetHashCode();
- hashCode = hashCode * -1521134295 + alpha.GetHashCode();
+ hashCode = hashCode * -1521134295 + red.GetHashCode();
+ hashCode = hashCode * -1521134295 + green.GetHashCode();
+ hashCode = hashCode * -1521134295 + blue.GetHashCode();
+ hashCode = hashCode * -1521134295 + alpha.GetHashCode();
- return hashCode;
+ return hashCode;
+ }
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode()
{
- var hashCode = -1275187100;
- hashCode = hashCode * -1521134295 + shape.GetHashCode();
- hashCode = hashCode * -1521134295 + point.GetHashCode();
- hashCode = hashCode * -1521134295 + normal.GetHashCode();
- hashCode = hashCode * -1521134295 + alpha.GetHashCode();
- return hashCode;
+ unchecked
+ {
+ var hashCode = -1275187100;
+ hashCode = hashCode * -1521134295 + shape.GetHashCode();
+ hashCode = hashCode * -1521134295 + point.GetHashCode();
+ hashCode = hashCode * -1521134295 + normal.GetHashCode();
+ hashCode = hashCode * -1521134295 + alpha.GetHashCode();
+ return hashCode;
+ }
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode()
{
- var hashCode = -884009331;
+ unchecked
+ {
+ var hashCode = -884009331;
#pragma warning disable RECS0025 // Non-readonly field referenced in 'GetHashCode()'
- hashCode = hashCode * -1521134295 + a.GetHashCode();
- hashCode = hashCode * -1521134295 + b.GetHashCode();
- hashCode = hashCode * -1521134295 + c.GetHashCode();
- hashCode = hashCode * -1521134295 + d.GetHashCode();
- hashCode = hashCode * -1521134295 + tx.GetHashCode();
- hashCode = hashCode * -1521134295 + ty.GetHashCode();
+ hashCode = hashCode * -1521134295 + a.GetHashCode();
+ hashCode = hashCode * -1521134295 + b.GetHashCode();
+ hashCode = hashCode * -1521134295 + c.GetHashCode();
+ hashCode = hashCode * -1521134295 + d.GetHashCode();
+ hashCode = hashCode * -1521134295 + tx.GetHashCode();
+ hashCode = hashCode * -1521134295 + ty.GetHashCode();
#pragma warning restore RECS0025 // Non-readonly field referenced in 'GetHashCode()'
- return hashCode;
+ return hashCode;
+ }
}
/// <summary>
internal T Get(IntPtr cPtr)
{
- var result = mBasePtr.FindIndex(0, x => x == cPtr );
- if (result >= 0)
+ lock (mBasePtr)
{
- return mInterfaces[result];
- }
+ var result = mBasePtr.FindIndex(0, x => x == cPtr);
+ if (result >= 0)
+ {
+ return mInterfaces[result];
+ }
- return null;
+ return null;
+ }
}
private List<IntPtr> mBasePtr = new List<IntPtr>();