SysAnalytics.Model/Enums/StringEnum.cs
/// <summary>
/// Gets the values as a 'bindable' list datasource.
/// </summary>
/// <returns>IList for data binding</returns>
Gets the values as a 'bindable' list datasource.
Gets the values as a ' bindable ' list datasource .
public IList GetListValues()
		{
			Type underlyingType = Enum.GetUnderlyingType(_enumType);
			ArrayList values = new ArrayList();
			foreach (FieldInfo fi in _enumType.GetFields())
			{
				StringValueAttribute[] attrs = fi.GetCustomAttributes(typeof (StringValueAttribute), false) as StringValueAttribute[];
				if (attrs.Length > 0)
					values.Add(new DictionaryEntry(Convert.ChangeType(Enum.Parse(_enumType, fi.Name), underlyingType), attrs[0].Value));
			}
			return values;
		}
public IList GetListValues ( ) { Type underlyingType = Enum . GetUnderlyingType ( _enumType ) ; ArrayList values = new ArrayList ( ) ; foreach ( FieldInfo fi in _enumType . GetFields ( ) ) { StringValueAttribute [ ] attrs = fi . GetCustomAttributes ( typeof ( StringValueAttribute ) , false ) as StringValueAttribute [ ] ; if ( attrs . Length > 0 ) values . Add ( new DictionaryEntry ( Convert . ChangeType ( Enum . Parse ( _enumType , fi . Name ) , underlyingType ) , attrs [ 0 ] . Value ) ) ; } return values ; }
Gets the values as a 'bindable' list datasource.
Gets the values as a ' bindable ' list datasource .
//Look for our string value associated with fields in this enum //Check for our custom attribute
IList for data binding
IList for data binding