forked from jaysonragasa/MultiRDPClient.NET
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNameObject.cs
More file actions
47 lines (46 loc) · 817 Bytes
/
NameObject.cs
File metadata and controls
47 lines (46 loc) · 817 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
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.Text;
namespace CommonTools
{
public class NameObject<T>
{
public string m_name = string.Empty;
public string Name
{
get { return m_name; }
set { m_name = value; }
}
public T m_object;
public T Object
{
get { return m_object; }
set { m_object = value; }
}
public NameObject(string name, T obj)
{
Name = name;
Object = obj;
}
public override string ToString()
{
return Name;
}
}
public class NameObjectCollection<T> : List<NameObject<T> >
{
public void Add(string name, T value)
{
Add(new NameObject<T>(name, value));
}
public NameObject<T> FindValue(T value)
{
foreach(NameObject<T> item in this)
{
if (item.Object.Equals(value))
return item;
}
return null;
}
}
}