Merge pull request #1404 from woodsb02/mono-route
[mono.git] / mcs / class / System.Web / System.Web.Configuration_2.0 / CapabilitiesBuild.cs
1 /*
2 Used to determine Browser Capabilities by the Browsers UserAgent String and related
3 Browser supplied Headers.
4 Copyright (C) 2002-Present  Owen Brady (Ocean at owenbrady dot net) 
5 and Dean Brettle (dean at brettle dot com)
6
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
14 The above copyright notice and this permission notice shall be included in all 
15 copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
19 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
20 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
21 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
22 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 namespace System.Web.Configuration
26 {
27         using System;
28         using System.Collections.Generic;
29         using System.Text;
30
31         internal abstract class CapabilitiesBuild : ICapabilitiesProcess
32         {
33                 /// <summary>
34                 /// 
35                 /// </summary>
36                 /// <param name="list"></param>
37                 /// <returns></returns>
38                 protected abstract System.Collections.ObjectModel.Collection<string> HeaderNames(System.Collections.ObjectModel.Collection<string> list);
39                 /// <summary>
40                 /// 
41                 /// </summary>
42                 /// <param name="userAgent"></param>
43                 /// <param name="initialCapabilities"></param>
44                 /// <returns></returns>
45                 public System.Web.Configuration.CapabilitiesResult Process(string userAgent, System.Collections.IDictionary initialCapabilities)
46                 {
47                         System.Collections.Specialized.NameValueCollection header;
48                         header = new System.Collections.Specialized.NameValueCollection(1);
49                         header.Add("User-Agent", userAgent);
50                         return Process(header, initialCapabilities);
51                 }
52                 /// <summary>
53                 /// 
54                 /// </summary>
55                 /// <param name="request"></param>
56                 /// <param name="initialCapabilities"></param>
57                 /// <returns></returns>
58                 public System.Web.Configuration.CapabilitiesResult Process(System.Web.HttpRequest request, System.Collections.IDictionary initialCapabilities)
59                 {
60                         if (request != null)
61                         {
62                                 return Process(request.Headers, initialCapabilities);
63                         }
64                         else
65                         {
66                                 return Process("", initialCapabilities);
67                         }
68                 }
69                 /// <summary>
70                 /// 
71                 /// </summary>
72                 /// <param name="header"></param>
73                 /// <param name="initialCapabilities"></param>
74                 /// <returns></returns>
75                 public abstract System.Web.Configuration.CapabilitiesResult Process(System.Collections.Specialized.NameValueCollection header, System.Collections.IDictionary initialCapabilities);
76         }
77 }