-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathConfigurationItem.cs
38 lines (32 loc) · 1.36 KB
/
ConfigurationItem.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
using System;
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;
namespace OmniSharp.Extensions.LanguageServer.Protocol.Models
{
public class ConfigurationItem : IEquatable<ConfigurationItem>
{
[Optional] public DocumentUri ScopeUri { get; set; }
[Optional] public string Section { get; set; }
public bool Equals(ConfigurationItem other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return Equals(ScopeUri, other.ScopeUri) && Section == other.Section;
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((ConfigurationItem) obj);
}
public override int GetHashCode()
{
unchecked
{
return ( ( ScopeUri != null ? ScopeUri.GetHashCode() : 0 ) * 397 ) ^ ( Section != null ? Section.GetHashCode() : 0 );
}
}
public static bool operator ==(ConfigurationItem left, ConfigurationItem right) => Equals(left, right);
public static bool operator !=(ConfigurationItem left, ConfigurationItem right) => !Equals(left, right);
}
}