/[gr2lib]/trunk/gr2lib/core/helpers/NameValuePair.cs
ViewVC logotype

Contents of /trunk/gr2lib/core/helpers/NameValuePair.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 160 - (show annotations) (download)
Thu Jul 22 10:20:55 2010 UTC (9 years, 1 month ago) by william
File size: 1159 byte(s)
Add UIEditor to edit EnumType Values via a dropdown combobox

1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5
6 namespace gr2lib.core.helpers
7 {
8
9
10 public interface INameValuePair<NAME_TYPE, VALUE_TYPE>
11 {
12 NAME_TYPE Name { get; }
13 VALUE_TYPE Value { get; }
14 }
15 public class NameValuePair<NAME_TYPE, VALUE_TYPE> : INameValuePair<NAME_TYPE, VALUE_TYPE>
16 {
17
18 public override string ToString()
19 {
20 string val = "{" + Convert.ToInt32(Value).ToString() + "}";
21 return String.Format("{0} {1}", Name.ToString(), val);
22 }
23
24 public NameValuePair()
25 {
26 _Name = default(NAME_TYPE);
27 _Value = default(VALUE_TYPE);
28 }
29 public NameValuePair(NAME_TYPE Name, VALUE_TYPE Value)
30 {
31 this._Name = Name;
32 this._Value = Value;
33 }
34 #region INameValuePair<NAME_TYPE, VALUE_TYPE> Members
35 private NAME_TYPE _Name;
36 private VALUE_TYPE _Value;
37 public NAME_TYPE Name { get { return _Name; } }
38 public VALUE_TYPE Value { get { return _Value; } }
39 #endregion
40 }
41 }
42

  ViewVC Help
Powered by ViewVC 1.1.22