forked from danbarua/Npgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringPair.cs
More file actions
42 lines (35 loc) · 993 Bytes
/
StringPair.cs
File metadata and controls
42 lines (35 loc) · 993 Bytes
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Npgsql.SqlGenerators
{
/// <summary>
/// Used for lookup in a Dictionary, since Tuple is not available in .NET 3.5
/// </summary>
internal class StringPair
{
private string _item1;
private string _item2;
public string Item1 { get { return _item1; } }
public string Item2 { get { return _item2; } }
public StringPair(string s1, string s2)
{
_item1 = s1;
_item2 = s2;
}
public override bool Equals(object obj)
{
if (obj == null)
return false;
StringPair o = obj as StringPair;
if (o == null)
return false;
return _item1 == o._item1 && _item2 == o._item2;
}
public override int GetHashCode()
{
return (_item1 + "." + _item2).GetHashCode();
}
}
}