Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,344 @@
#if NET_2_0
/*
Used to determine Browser Capabilities by the Browsers UserAgent String and related
Browser supplied Headers.
Copyright (C) 2002-Present Owen Brady (Ocean at owenbrady dot net)
and Dean Brettle (dean at brettle dot com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
namespace System.Web.Configuration.nBrowser
{
using System;
using System.Collections.Generic;
using System.Text;
internal class Build : System.Web.Configuration.CapabilitiesBuild
{
//This keeps a list of filenames and FileNodes linked
private System.Collections.Generic.Dictionary<string, System.Web.Configuration.nBrowser.File> Browserfiles;
//Just links FileNodes
private System.Collections.Generic.List<System.Web.Configuration.nBrowser.File> nbrowserfiles;
//
private System.Collections.Generic.Dictionary<string, string> DefaultKeys;
private System.Collections.Generic.Dictionary<string, string> BrowserKeys;
//
private object browserSyncRoot = new object();
private System.Web.Configuration.nBrowser.Node browser;
/// <summary>
///
/// </summary>
public Build()
: base()
{
Browserfiles = new System.Collections.Generic.Dictionary<string, System.Web.Configuration.nBrowser.File>();
nbrowserfiles = new System.Collections.Generic.List<System.Web.Configuration.nBrowser.File>();
DefaultKeys = new System.Collections.Generic.Dictionary<string, string>();
BrowserKeys = new System.Collections.Generic.Dictionary<string, string>();
}
/// <summary>
/// Reads an entire directory and process's all of the browser files in that
/// directory.
/// </summary>
/// <param name="path"></param>
public void AddBrowserDirectory(string path)
{
//I allow this function to be a little messy
//just in case they pass in a path that really a file
//name
if (System.IO.Directory.Exists(path) == true)
{
System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(path);
System.IO.FileInfo[] file = dir.GetFiles("*.browser");
//we are done with it so let the GC have it early as possible
dir = null;
for (int a = 0;a <= file.Length - 1;a++)
{
AddBrowserFile(file[a].FullName);
}
}
else if (System.IO.File.Exists(path) == true)
{
AddBrowserFile(path);
}
}
/// <summary>
/// Reads a browser file and builds the Nodes which that file contains.
/// </summary>
/// <param name="filename"></param>
public void AddBrowserFile(string fileName)
{
if (Browserfiles.ContainsKey(fileName) == false)
{
nBrowser.File b = new nBrowser.File(fileName);
this.AddBrowserFile(b);
}
}
private void AddBrowserFile(nBrowser.File file)
{
if (Browserfiles.ContainsKey(file.FileName) == false)
{
Browserfiles.Add(file.FileName, file);
nbrowserfiles.Add(file);
string[] keys = file.Keys;
for (int i = 0;i <= keys.Length - 1;i++)
{
if (BrowserKeys.ContainsKey(keys[i]) == false)
{
BrowserKeys.Add(keys[i], file.FileName);
}
else
{
throw new nBrowser.Exception("Duplicate Key \"" + keys[i] + "\" found in " + file.FileName + " and in file " + BrowserKeys[keys[i]]);
}
}
keys = file.DefaultKeys;
for (int i = 0;i <= keys.Length - 1;i++)
{
if (DefaultKeys.ContainsKey(keys[i]) == false)
{
DefaultKeys.Add(keys[i], file.FileName);
}
else
{
throw new nBrowser.Exception("Duplicate Key \"" + keys[i] + "\" found in " + file.FileName + " and in file " + DefaultKeys[keys[i]]);
}
}
}
}
/// <summary>
/// Reads a browser file and builds the Nodes which that file contains.
/// </summary>
/// <param name="file"></param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1059")]
public void AddBrowserFile(System.Xml.XmlDocument browser, string fileName)
{
if (Browserfiles.ContainsKey(fileName) == false)
{
nBrowser.File file = new nBrowser.File(browser, fileName);
this.AddBrowserFile(file);
}
}
/// <summary>
/// Returns the root Node of the Browser Tree.
/// </summary>
/// <returns></returns>
public Node Browser()
{
if (browser == null)
{
lock (browserSyncRoot)
{
if (browser == null)
{
browser = InitializeTree();
}
}
}
return browser;
}
private Node InitializeTree()
{
Node root = new Node();
//Custom Sorted List, to allow where Multple files in Diff directorys might have the same
//filename. So still to some degree first come first serve but might be close enough
//to how microsoft System to match much more closely.
System.Collections.Generic.SortedList<string, System.Collections.Generic.List<nBrowser.File>> list;
list = new System.Collections.Generic.SortedList<string, System.Collections.Generic.List<nBrowser.File>>();
for (int i = 0;i <= Browserfiles.Count - 1;i++)
{
if (list.ContainsKey(nbrowserfiles[i].FileName) == false)
{
System.Collections.Generic.List<nBrowser.File> l;
l = new System.Collections.Generic.List<nBrowser.File>();
list.Add(nbrowserfiles[i].FileName, l);
}
list[nbrowserfiles[i].FileName].Add(nbrowserfiles[i]);
}
nBrowser.File[] files = new nBrowser.File[Browserfiles.Count];
int count = 0;
for (int i = 0;i <= list.Count - 1;i++)
{
System.Collections.Generic.List<nBrowser.File> l = list[list.Keys[i]];
for (int b = 0;b <= l.Count - 1;b++)
{
files[count] = l[b];
count++;
}
}
#region Connect Nodes
for (int i = 0;i <= Browserfiles.Count - 1;i++)
{
for (int a = 0;a <= files[i].Keys.Length - 1;a++)
{
Node child = files[i].GetNode(files[i].Keys[a]);
Node parent = null;
if (child.ParentId.Length > 0)
{
parent = this.GetNode(child.ParentId);
if (parent == null)
throw new nBrowser.Exception(String.Format("Parent not found with id = {0}", child.ParentId));
}
if (parent == null)
parent = root;
parent.AddChild(child);
}
}
#endregion
#region Inject DefaultBrowser Nodes
for (int i = 0;i <= Browserfiles.Count - 1;i++)
{
for (int a = 0;a <= files[i].DefaultKeys.Length - 1;a++)
{
Node defaultNode = files[i].GetDefaultNode(files[i].DefaultKeys[a]);
Node node = this.GetNode(defaultNode.Id);
if (node == defaultNode)
{
// there is no regular node so the defaultNode is already at
// the correct spot in the tree.
continue;
}
Node parentNode = this.GetNode(node.ParentId);
if (parentNode == null)
parentNode = root;
// insert the default node between the regular node and it's parent.
parentNode.RemoveChild(node);
defaultNode.AddChild(node);
parentNode.AddChild(defaultNode);
}
}
#endregion
#region Merge Ref Nodes
for (int i = 0;i <= Browserfiles.Count - 1;i++)
{
foreach (Node refNode in files[i].RefNodes) {
GetNode(refNode.RefId).MergeFrom(refNode);
}
}
#endregion
return root;
}
/// <summary>
/// returns a Node Matching the Key supplied, for either a
/// DefaultBrowser, or Gatway/Browser node.
/// </summary>
/// <param name="Key"></param>
/// <returns></returns>
private Node GetNode(string Key)
{
if (Key == null || Key.Length == 0)
return null;
string filename;
//Must find what file node that this key is located in
//so we look it up in the string dictionary's
if (!BrowserKeys.TryGetValue(Key, out filename)
&& !DefaultKeys.TryGetValue(Key, out filename))
return null;
//fxcop sugguested this was faster then
//filename!= string.Empty
if (filename != null && filename.Length > 0)
{
//now that we have a name we look it up in the hasttable containing
//the actual node.
nBrowser.File b = Browserfiles[filename];
Node n = b.GetNode(Key);
return n;
}
return null;
}
/// <summary>
/// Returns an Array of Nodes that have been built. To be used for Design/Editors of Browser
/// files.
/// </summary>
/// <returns></returns>
public Node[] Nodes()
{
Node[] browsers;
nBrowser.File[] files = new nBrowser.File[Browserfiles.Count];
Browserfiles.Values.CopyTo(files, 0);
int count = 0;
for (int i = 0;i <= files.Length - 1;i++)
{
count += files[i].Nodes.Length;
}
browsers = new Node[count];
count = 0;
for (int i = 0;i <= files.Length - 1;i++)
{
for (int a = 0;a <= files[i].Nodes.Length - 1;a++)
{
browsers[count] = files[i].Nodes[a];
count++;
}
}
return browsers;
}
/// <summary>
///
/// </summary>
/// <param name="header"></param>
/// <param name="initialCapabilities"></param>
/// <returns></returns>
public override System.Web.Configuration.CapabilitiesResult Process(System.Collections.Specialized.NameValueCollection header, System.Collections.IDictionary initialCapabilities)
{
if (initialCapabilities == null)
initialCapabilities = new System.Collections.Generic.Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
System.Web.Configuration.nBrowser.Result r = new System.Web.Configuration.nBrowser.Result(initialCapabilities);
#if trace
System.Diagnostics.Trace.WriteLine(string.Join("+", new string[50]));
for (int i=0;i <= header.Count -1;i++)
{
System.Diagnostics.Trace.WriteLine(string.Format("{0}{1}",header.GetKey(i).PadRight(25),header[i]));
}
System.Diagnostics.Trace.WriteLine(string.Join("+", new string[50]));
#endif
Browser().Process(header, r, new System.Collections.Generic.List<System.Text.RegularExpressions.Match>());
return r;
}
/// <summary>
///
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
protected override System.Collections.ObjectModel.Collection<string> HeaderNames(System.Collections.ObjectModel.Collection<string> list)
{
return this.Browser().HeaderNames(list);
}
}
}
#endif

View File

@@ -0,0 +1,51 @@
#if NET_2_0
/*
Used to determine Browser Capabilities by the Browsers UserAgent String and related
Browser supplied Headers.
Copyright (C) 2002-Present Owen Brady (Ocean at owenbrady dot net)
and Dean Brettle (dean at brettle dot com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
namespace System.Web.Configuration.nBrowser
{
using System;
using System.Runtime.Serialization;
internal class Exception : System.Exception
{
public Exception()
: base()
{
}
public Exception(string errorMessage)
: base(errorMessage)
{
}
public Exception(string message, Exception innerException)
: base(message, innerException)
{
// Add any type-specific logic for inner exceptions.
}
protected Exception(SerializationInfo info, StreamingContext context)
: base(info, context)
{
// Implement type-specific serialization constructor logic.
}
}
}
#endif

View File

@@ -0,0 +1,204 @@
#if NET_2_0
/*
Used to determine Browser Capabilities by the Browsers UserAgent String and related
Browser supplied Headers.
Copyright (C) 2002-Present Owen Brady (Ocean at owenbrady dot net)
and Dean Brettle (dean at brettle dot com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
namespace System.Web.Configuration.nBrowser
{
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.Configuration.nBrowser;
class File
{
private System.Xml.XmlDocument BrowserFile;
internal System.Web.Configuration.nBrowser.Node[] Nodes;
private System.Collections.Specialized.ListDictionary Lookup;
private System.Collections.Specialized.ListDictionary DefaultLookup;
internal List<Node> RefNodes;
public string FileName
{
get
{
return pFileName;
}
}
private string pFileName = string.Empty;
public File(string file)
{
pFileName = file;
BrowserFile = new System.Xml.XmlDocument();
//I can put this in a try /catch but I want
//this to bubble up.
BrowserFile.Load(file);
this.Load(BrowserFile);
}
/// <summary>
///
/// </summary>
/// <param name="file"></param>
public File(System.Xml.XmlDocument BrowserFile, string filename)
{
pFileName = filename;
this.Load(BrowserFile);
}
private void Load(System.Xml.XmlDocument BrowserFile)
{
Lookup = new System.Collections.Specialized.ListDictionary();
DefaultLookup = new System.Collections.Specialized.ListDictionary();
RefNodes = new List<Node>();
System.Xml.XmlNode node;
//I know this might allocate more nodes then needed but never less.
Nodes = new Node[BrowserFile.DocumentElement.ChildNodes.Count];
for (int a = 0;a <= BrowserFile.DocumentElement.ChildNodes.Count - 1;a++)
{
node = BrowserFile.DocumentElement.ChildNodes[a];
if (node.NodeType == System.Xml.XmlNodeType.Comment)
{
continue;
}
Nodes[a] = new Node(node);
Nodes[a].FileName = FileName;
if (Nodes[a].NameType != NodeType.DefaultBrowser)
{
//fxcop sugguested this was faster then
//Nodes[a].refID != string.Empty
if (Nodes[a].RefId.Length > 0)
{
RefNodes.Add(Nodes[a]);
}
else if (Lookup.Contains(Nodes[a].Id) == false)
{
Lookup.Add(Nodes[a].Id, a);
}
else
{
throw new nBrowser.Exception("Duplicate ID found \"" + Nodes[a].Id + "\"");
}
}
else
{
//fxcop sugguested this was faster then
//Nodes[a].refID != string.Empty
if (Nodes[a].RefId.Length > 0)
{
RefNodes.Add(Nodes[a]);
}
else if (DefaultLookup.Contains(Nodes[a].Id) == false)
{
DefaultLookup.Add(Nodes[a].Id, a);
}
else
{
throw new nBrowser.Exception("Duplicate ID found \"" + Nodes[a].Id + "\"");
}
}
}
}
/// <summary>
/// Returns a Array of strings, which represent the Id Attributes of all the
/// Browser/Gatway Nodes
/// </summary>
public string[] Keys
{
get
{
string[] k = new string[Lookup.Keys.Count];
//12-29-05
//This will copy the Keys In Alphabetical Order
//Lookup.Keys.CopyTo(k,0);
//This Method is ment to copy the Keys in the order
//that they were in the xml file.
int b = 0;
for (int i = 0;i <= Nodes.Length - 1;i++)
{
if (Nodes[i] != null && Nodes[i].NameType != NodeType.DefaultBrowser
&& Nodes[i].RefId.Length == 0)
{
k[b] = Nodes[i].Id;
b++;
}
}
return k;
}
}
/// <summary>
/// Returns a Array of strings, which represent the Id Attributes of all the
/// DefaultBrowser Nodes
/// </summary>
public string[] DefaultKeys
{
get
{
string[] k = new string[DefaultLookup.Keys.Count];
//12-29-05
//This will copy the Keys In Alphabetical Order
//DefaultLookup.Keys.CopyTo(k,0);
//This Method is ment to copy the Keys in the order
//that they were in the xml file.
int b = 0;
for (int i = 0;i <= Nodes.Length - 1;i++)
{
if (Nodes[i] != null && Nodes[i].NameType == NodeType.DefaultBrowser)
{
k[b] = Nodes[i].Id;
b++;
}
}
return k;
}
}
/// <summary>
///
/// </summary>
/// <param name="Key"></param>
/// <returns></returns>
internal Node GetNode(string Key)
{
object o = Lookup[Key];
if (o == null)
return GetDefaultNode (Key);
return Nodes[(int)o];
}
/// <summary>
///
/// </summary>
/// <param name="Key"></param>
/// <returns></returns>
internal Node GetDefaultNode(string Key)
{
object o = DefaultLookup[Key];
if (o == null)
return null;
return Nodes[(int)o];
}
}
}
#endif

View File

@@ -0,0 +1,105 @@
#if NET_2_0
/*
Used to determine Browser Capabilities by the Browsers UserAgent String and related
Browser supplied Headers.
Copyright (C) 2002-Present Owen Brady (Ocean at owenbrady dot net)
and Dean Brettle (dean at brettle dot com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
namespace System.Web.Configuration.nBrowser
{
using System;
using System.Collections.Generic;
using System.Text;
class Identification
{
private bool MatchType = true;
private string MatchName = string.Empty;
private string MatchGroup = string.Empty;
//FxCop will complain that this is assigned to but never used.
//Reason I keep it around is to see the actual regex expresion
//used without having to drill down deep in regex object to find it
private string MatchPattern = string.Empty;
private System.Text.RegularExpressions.Regex RegexPattern;
/// <summary>
/// Sets up Initial Identification Object, So that it is easier debuging
/// and passing Regular expression objects around.
/// </summary>
/// <param name="matchType">True = Match, False = NonMatch</param>
/// <param name="matchGroup">Two Options, capability, header</param>
/// <param name="matchName">Header Name</param>
/// <param name="matchPattern">Regular Expression Pattern</param>
public Identification(bool matchType, string matchGroup, string matchName, string matchPattern)
{
this.MatchType = matchType;
this.MatchGroup = matchGroup;
this.MatchName = matchName;
this.MatchPattern = matchPattern;
RegexPattern = new System.Text.RegularExpressions.Regex(matchPattern);
}
/// <summary>
/// Builds a Match Object from the result of the regular expression
/// </summary>
/// <param name="Header">Header Value which the regular expression will evaluate.</param>
/// <returns>A Match object created from the regular expression and the passed in header.</returns>
public System.Text.RegularExpressions.Match GetMatch(string Header)
{
return RegexPattern.Match(Header == null ? string.Empty : Header);
}
/// <summary>
///
/// </summary>
public bool IsMatchSuccessful(System.Text.RegularExpressions.Match m)
{
// Return true if a "match" matched successfully or a "nonmatch" didn't match.
return (MatchType == m.Success);
}
/// <summary>
///
/// </summary>
public string Name
{
get
{
return this.MatchName;
}
}
/// <summary>
///
/// </summary>
public string Group
{
get
{
return this.MatchGroup;
}
}
public string Pattern
{
get
{
return MatchPattern;
}
}
}
}
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
#if NET_2_0
/*
Used to determine Browser Capabilities by the Browsers UserAgent String and related
Browser supplied Headers.
Copyright (C) 2002-Present Owen Brady (Ocean at owenbrady dot net)
and Dean Brettle (dean at brettle dot com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
namespace System.Web.Configuration.nBrowser
{
internal enum NodeType
{
None = 0,
Browser = 1,
Gateway = 2,
DefaultBrowser = 3
}
}
#endif

View File

@@ -0,0 +1,85 @@
#if NET_2_0
/*
Used to determine Browser Capabilities by the Browsers UserAgent String and related
Browser supplied Headers.
Copyright (C) 2002-Present Owen Brady (Ocean at owenbrady dot net)
and Dean Brettle (dean at brettle dot com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
namespace System.Web.Configuration.nBrowser
{
using System;
using System.Collections.Generic;
using System.Text;
internal class Result : System.Web.Configuration.CapabilitiesResult
{
private System.Collections.Generic.Dictionary<Type, Type> AdapterTypeMap;
private System.Collections.Specialized.StringCollection Track;
internal Type MarkupTextWriter;
internal Result(System.Collections.IDictionary items)
: base(items)
{
AdapterTypeMap = new System.Collections.Generic.Dictionary<Type, Type>();
Track = new System.Collections.Specialized.StringCollection();
MarkupTextWriter = typeof (System.Web.UI.HtmlTextWriter);
}
/// <summary>
///
/// </summary>
/// <param name="track"></param>
internal void AddTrack(string track)
{
Track.Add(track);
}
/// <summary>
///
/// </summary>
/// <param name="controlTypeName"></param>
/// <param name="adapterTypeName"></param>
internal void AddAdapter(Type controlType, Type adapterType)
{
AdapterTypeMap[controlType] = adapterType;
}
/// <summary>
///
/// </summary>
public System.Collections.Specialized.StringCollection Tracks
{
get
{
return Track;
}
}
internal override Type GetTagWriter ()
{
return MarkupTextWriter;
}
internal override System.Collections.IDictionary GetAdapters ()
{
return AdapterTypeMap;
}
}
}
#endif