XmlDictionary.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace System.Xml
  5. {
  6. public class XmlDictionary : IXmlDictionary
  7. {
  8. static XmlDictionary empty = new XmlDictionary (true);
  9. public static XmlDictionary Empty {
  10. get { return empty; }
  11. }
  12. readonly bool isReadOnly;
  13. Dictionary<string, XmlDictionaryString> dict;
  14. public XmlDictionary ()
  15. {
  16. dict = new Dictionary<string, XmlDictionaryString> ();
  17. }
  18. public XmlDictionary (int capacity)
  19. {
  20. dict = new Dictionary<string, XmlDictionaryString> (capacity);
  21. }
  22. // for static empty.
  23. private XmlDictionary (bool isReadOnly)
  24. : this ()
  25. {
  26. this.isReadOnly = isReadOnly;
  27. }
  28. public virtual XmlDictionaryString Add (string value)
  29. {
  30. if (isReadOnly)
  31. throw new InvalidOperationException ();
  32. throw new NotImplementedException ();
  33. }
  34. public bool TryLookup (int key, out XmlDictionaryString result)
  35. {
  36. throw new NotImplementedException ();
  37. }
  38. public bool TryLookup (string value, out XmlDictionaryString result)
  39. {
  40. throw new NotImplementedException ();
  41. }
  42. public bool TryLookup (XmlDictionaryString value,
  43. out XmlDictionaryString result)
  44. {
  45. throw new NotImplementedException ();
  46. }
  47. }
  48. }