Result.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #if NET_2_0
  2. /*
  3. Used to determine Browser Capabilities by the Browsers UserAgent String and related
  4. Browser supplied Headers.
  5. Copyright (C) 2002-Present Owen Brady (Ocean at owenbrady dot net)
  6. and Dean Brettle (dean at brettle dot com)
  7. Permission is hereby granted, free of charge, to any person obtaining a copy
  8. of this software and associated documentation files (the "Software"), to deal
  9. in the Software without restriction, including without limitation the rights
  10. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11. copies of the Software, and to permit persons to whom the Software is furnished
  12. to do so, subject to the following conditions:
  13. The above copyright notice and this permission notice shall be included in all
  14. copies or substantial portions of the Software.
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  16. INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  17. PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  18. HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  19. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  20. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21. */
  22. namespace System.Web.Configuration.nBrowser
  23. {
  24. using System;
  25. using System.Collections.Generic;
  26. using System.Text;
  27. internal class Result : System.Web.Configuration.CapabilitiesResult
  28. {
  29. private System.Collections.Generic.Dictionary<Type, Type> AdapterTypeMap;
  30. private System.Collections.Specialized.StringCollection Track;
  31. internal Type MarkupTextWriter;
  32. internal Result(System.Collections.IDictionary items)
  33. : base(items)
  34. {
  35. AdapterTypeMap = new System.Collections.Generic.Dictionary<Type, Type>();
  36. Track = new System.Collections.Specialized.StringCollection();
  37. MarkupTextWriter = typeof (System.Web.UI.HtmlTextWriter);
  38. }
  39. /// <summary>
  40. ///
  41. /// </summary>
  42. /// <param name="track"></param>
  43. internal void AddTrack(string track)
  44. {
  45. Track.Add(track);
  46. }
  47. /// <summary>
  48. ///
  49. /// </summary>
  50. /// <param name="controlTypeName"></param>
  51. /// <param name="adapterTypeName"></param>
  52. internal void AddAdapter(Type controlType, Type adapterType)
  53. {
  54. AdapterTypeMap[controlType] = adapterType;
  55. }
  56. /// <summary>
  57. ///
  58. /// </summary>
  59. public System.Collections.Specialized.StringCollection Tracks
  60. {
  61. get
  62. {
  63. return Track;
  64. }
  65. }
  66. internal override Type GetTagWriter ()
  67. {
  68. return MarkupTextWriter;
  69. }
  70. internal override System.Collections.IDictionary GetAdapters ()
  71. {
  72. return AdapterTypeMap;
  73. }
  74. }
  75. }
  76. #endif