59 |
|
#region implicit operators |
60 |
|
public static implicit operator loggerflagsbase<TValue>(EnumNameValuePair<TValue> t) { return new loggerflagsbase<TValue>(t); } |
61 |
|
public static implicit operator EnumNameValuePair<TValue>(loggerflagsbase<TValue> t) { return new loggerflagsbase<TValue>(t); } |
62 |
< |
public static implicit operator loggerflagsbase<TValue>(TValue t) |
62 |
> |
public static implicit operator loggerflagsbase<TValue>(TValue t) |
63 |
|
{ |
64 |
|
foreach (KeyValuePair<TValue, EnumNameValuePair<TValue>> pair in value_pairs) { EnumNameValuePair<TValue> l = pair.Value; if (l.Value.Equals(t)) { return new loggerflagsbase<TValue>(l); } } |
65 |
|
return loggerflagsbase<TValue>.NONE; |
122 |
|
public class loggerflags : loggerflagsbase<ushort> |
123 |
|
{ |
124 |
|
protected loggerflags() :base() { } |
125 |
– |
//protected loggerflags(ushort t) : this() { CurrentValue = new EnumNameValuePair< ushort>("", t); } |
125 |
|
protected loggerflags(EnumNameValuePair<ushort> t) : base(t) { } |
126 |
|
protected loggerflags(loggerflagsbase<ushort> t) : base(t) { } |
127 |
|
#region implicit operators |
128 |
|
public static implicit operator loggerflags(EnumNameValuePair<ushort> t) { return new loggerflags(t); } |
129 |
< |
public static implicit operator EnumNameValuePair<ushort>(loggerflags t) { return new loggerflags(t.Value); } |
129 |
> |
public static implicit operator EnumNameValuePair<ushort>(loggerflags t) { return new EnumNameValuePair<ushort>(t.Name,t.Value); } |
130 |
|
public static implicit operator ushort(loggerflags t) { return t.Value; } |
131 |
|
public static implicit operator loggerflags(ushort t) { return new loggerflags(t); } |
132 |
|
public static implicit operator string(loggerflags t) { return t.Name; } |