forked from PeterWaher/IoTGateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProperty.cs
More file actions
84 lines (74 loc) · 1.53 KB
/
Copy pathProperty.cs
File metadata and controls
84 lines (74 loc) · 1.53 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
using System;
using System.Collections.Generic;
using System.Text;
namespace Waher.Networking.XMPP.Contracts
{
/// <summary>
/// Named property
/// </summary>
public class Property
{
private string name;
private string value;
/// <summary>
/// Named property
/// </summary>
public Property()
{
this.name = string.Empty;
this.value = string.Empty;
}
/// <summary>
/// Named property
/// </summary>
/// <param name="Name">Name of property</param>
/// <param name="Value">Property value</param>
public Property(string Name, string Value)
{
this.name = Name;
this.value = Value;
}
/// <summary>
/// Name of property
/// </summary>
public string Name
{
get => this.name;
set => this.name = value;
}
/// <summary>
/// Property value
/// </summary>
public string Value
{
get => this.value;
set => this.value = value;
}
/// <summary>
/// <see cref="object.ToString()"/>
/// </summary>
public override string ToString()
{
return this.name + "=" + this.value;
}
/// <summary>
/// <see cref="Object.Equals(object)"/>
/// </summary>
public override bool Equals(object obj)
{
return
obj is Property P &&
this.name == P.name &&
this.value == P.value;
}
/// <summary>
/// <see cref="object.GetHashCode()"/>
/// </summary>
public override int GetHashCode()
{
int Result = this.name.GetHashCode();
Result ^= Result << 5 ^ this.value.GetHashCode();
return Result;
}
}
}