CommandConfig.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.Specialized;
  4. using System.Configuration;
  5. using System.Linq;
  6. using System.Text;
  7. using SuperSocket.Common;
  8. namespace SuperWebSocket.Config
  9. {
  10. /// <summary>
  11. /// Command configuration
  12. /// </summary>
  13. public class CommandConfig : ConfigurationElement
  14. {
  15. /// <summary>
  16. /// Gets the options.
  17. /// </summary>
  18. public NameValueCollection Options { get; private set; }
  19. /// <summary>
  20. /// Gets a value indicating whether an unknown attribute is encountered during deserialization.
  21. /// </summary>
  22. /// <param name="name">The name of the unrecognized attribute.</param>
  23. /// <param name="value">The value of the unrecognized attribute.</param>
  24. /// <returns>
  25. /// true when an unknown attribute is encountered while deserializing; otherwise, false.
  26. /// </returns>
  27. protected override bool OnDeserializeUnrecognizedAttribute(string name, string value)
  28. {
  29. if (Options == null)
  30. {
  31. Options = new NameValueCollection();
  32. }
  33. Options.Add(name, value);
  34. return true;
  35. }
  36. }
  37. }