forked from SharpMap/SharpMap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDemoItem.cs
More file actions
54 lines (47 loc) · 1.51 KB
/
DemoItem.cs
File metadata and controls
54 lines (47 loc) · 1.51 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
52
53
54
namespace SharpMap.Demo.Wms.Models
{
using System;
public class DemoItem : IEquatable<DemoItem>
{
public DemoItem(string name, string url)
{
if (name == null)
throw new ArgumentNullException("name");
if (url == null)
throw new ArgumentNullException("url");
this.Name = name;
this.Url = url;
}
public string Name { get; set; }
public string Url { get; set; }
public override string ToString()
{
return string.Format("Name: {0}, Url: {1}", this.Name, this.Url);
}
public bool Equals(DemoItem other)
{
if (ReferenceEquals(null, other))
return false;
if (ReferenceEquals(this, other))
return true;
return Equals(other.Name, this.Name) && Equals(other.Url, this.Url);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj))
return false;
if (ReferenceEquals(this, obj))
return true;
if (obj.GetType() != typeof(DemoItem))
return false;
return this.Equals((DemoItem)obj);
}
public override int GetHashCode()
{
unchecked
{
return (this.Name.GetHashCode() * 397) ^ this.Url.GetHashCode();
}
}
}
}