-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBreakpointLocation.cs
64 lines (54 loc) · 1.62 KB
/
BreakpointLocation.cs
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
55
56
57
58
59
60
61
62
63
64
using System;
namespace MsBuildDebugger
{
public enum BreakpointPosition : int
{
Start = 0,
End
}
public class BreakpointLocation
{
public BreakpointPosition Position { get; }
public string Target { get; }
public BreakpointLocation(string target, BreakpointPosition pos)
{
Target = target;
Position = pos;
}
public string GetPositionString()
{
return Enum.GetName(typeof(BreakpointPosition), Position);
}
public override int GetHashCode()
{
return Target.GetHashCode() * 0x00000100 + (int)Position;
}
public override bool Equals(object obj)
{
return Equals(obj as BreakpointLocation);
}
public bool Equals(BreakpointLocation loc)
{
// If parameter is null, return false.
if (Object.ReferenceEquals(loc, null))
{
return false;
}
// Optimization for a common success case.
if (Object.ReferenceEquals(this, loc))
{
return true;
}
// If run-time types are not exactly the same, return false.
if (this.GetType() != loc.GetType())
{
return false;
}
// Return true if the fields match.
// Note that the base class is not invoked because it is
// System.Object, which defines Equals as reference equality.
return (Target == loc.Target) && (Position == loc.Position);
}
}
}