CompilerCollection.cs 1008 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // System.Web.Configuration.CompilerCollection
  3. //
  4. // Authors:
  5. // Gonzalo Paniagua Javier ([email protected])
  6. //
  7. // (C) 2003 Ximian, Inc (http://www.ximian.com)
  8. //
  9. using System;
  10. using System.Collections;
  11. namespace System.Web.Configuration
  12. {
  13. sealed class CompilerCollection
  14. {
  15. Hashtable compilers;
  16. public CompilerCollection () : this (null) {}
  17. public CompilerCollection (CompilerCollection parent)
  18. {
  19. compilers = new Hashtable (CaseInsensitiveHashCodeProvider.Default,
  20. CaseInsensitiveComparer.Default);
  21. if (parent != null && parent.compilers != null) {
  22. foreach (DictionaryEntry entry in parent.compilers)
  23. compilers [entry.Key] = entry.Value;
  24. }
  25. }
  26. public WebCompiler this [string language] {
  27. get { return compilers [language] as WebCompiler; }
  28. set {
  29. compilers [language] = value;
  30. string [] langs = language.Split (';');
  31. foreach (string s in langs) {
  32. string x = s.Trim ();
  33. if (x != "")
  34. compilers [x] = value;
  35. }
  36. }
  37. }
  38. }
  39. }