HttpStaticObjectsCollection.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using System;
  2. using System.Collections;
  3. namespace System.Web {
  4. public sealed class HttpStaticObjectsCollection : ICollection, IEnumerable {
  5. private Hashtable _Objects;
  6. // Needs to hold object items that can be latebound and can be serialized
  7. public HttpStaticObjectsCollection() {
  8. _Objects = new Hashtable();
  9. }
  10. public object GetObject(string name) {
  11. return this[name];
  12. }
  13. public IEnumerator GetEnumerator() {
  14. return _Objects.GetEnumerator ();
  15. }
  16. public void CopyTo(Array array, int index) {
  17. _Objects.CopyTo (array, index);
  18. }
  19. internal IDictionary GetObjects() {
  20. return _Objects;
  21. }
  22. public object this[string name] {
  23. get {
  24. return _Objects [name];
  25. }
  26. }
  27. public int Count {
  28. get {
  29. return _Objects.Count;
  30. }
  31. }
  32. public bool IsReadOnly {
  33. get {
  34. return true;
  35. }
  36. }
  37. public bool IsSynchronized {
  38. get {
  39. return false;
  40. }
  41. }
  42. public object SyncRoot {
  43. get {
  44. return this;
  45. }
  46. }
  47. }
  48. }