EnumStringParameter.cs 795 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Runtime.Serialization;
  4. namespace WingServerCommon.Config.Parameters
  5. {
  6. /// <summary>
  7. /// string enum parameter
  8. /// </summary>
  9. [DataContract]
  10. public class EnumStringParameter : EnumParameterBase<string>
  11. {
  12. public override void ChangeParameterValue(object value)
  13. {
  14. var stringParameter = value as StringParameter;
  15. if (stringParameter != null)
  16. {
  17. Value = stringParameter.Value;
  18. }
  19. }
  20. public void ChangeSource(IEnumerable<string> newSource, string defaultValue)
  21. {
  22. Source = new List<string>(newSource);
  23. Value = defaultValue;
  24. }
  25. }
  26. }