forked from ServiceStack/ServiceStack.Text
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTypePair.cs
More file actions
51 lines (45 loc) · 1.14 KB
/
Copy pathTypePair.cs
File metadata and controls
51 lines (45 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// https://github.com/ServiceStack/ServiceStack.Text
// ServiceStack.Text: .NET C# POCO JSON, JSV and CSV Text Serializers.
//
// Authors:
// Demis Bellot (demis.bellot@gmail.com)
//
// Copyright 2012 Service Stack LLC. All Rights Reserved.
//
// Licensed under the same terms of ServiceStack.
//
using System;
namespace ServiceStack.Text.Support
{
public class TypePair
{
public Type[] Args1 { get; set; }
public Type[] Arg2 { get; set; }
public TypePair(Type[] arg1, Type[] arg2)
{
Args1 = arg1;
Arg2 = arg2;
}
public bool Equals(TypePair other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return Equals(other.Args1, Args1) && Equals(other.Arg2, Arg2);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != typeof (TypePair)) return false;
return Equals((TypePair) obj);
}
public override int GetHashCode()
{
unchecked
{
return ((Args1 != null ? Args1.GetHashCode() : 0)*397) ^ (Arg2 != null ? Arg2.GetHashCode() : 0);
}
}
}
}