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,132 @@
//
// System.Web.UI.ApplicationFileParser.cs
//
// Authors:
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
// (c) 2004-2010 Novell, Inc. (http://www.novell.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.
//
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Web;
using System.Web.Compilation;
using System.Web.Util;
namespace System.Web.UI
{
sealed class ApplicationFileParser : TemplateParser
{
static List <string> dependencies;
TextReader reader;
public ApplicationFileParser (string fname, HttpContext context)
{
InputFile = fname;
Context = context;
VirtualPath = new VirtualPath ("/" + Path.GetFileName (fname));
LoadConfigDefaults ();
}
internal ApplicationFileParser (VirtualPath virtualPath, TextReader reader, HttpContext context)
: this (virtualPath, null, reader, context)
{
}
internal ApplicationFileParser (VirtualPath virtualPath, string inputFile, TextReader reader, HttpContext context)
{
VirtualPath = virtualPath;
Context = context;
Reader = reader;
if (String.IsNullOrEmpty (inputFile))
InputFile = virtualPath.PhysicalPath;
else
InputFile = inputFile;
SetBaseType (null);
LoadConfigDefaults ();
}
internal override Type CompileIntoType ()
{
return GlobalAsaxCompiler.CompileApplicationType (this);
}
internal static Type GetCompiledApplicationType (string inputFile, HttpContext context)
{
ApplicationFileParser parser = new ApplicationFileParser (inputFile, context);
AspGenerator generator = new AspGenerator (parser);
Type type = generator.GetCompiledType ();
dependencies = parser.Dependencies;
return type;
}
internal override void AddDirective (string directive, IDictionary atts)
{
if (String.Compare (directive, "application", true, Helpers.InvariantCulture) != 0 &&
String.Compare (directive, "Import", true, Helpers.InvariantCulture) != 0 &&
String.Compare (directive, "Assembly", true, Helpers.InvariantCulture) != 0)
ThrowParseException ("Invalid directive: " + directive);
base.AddDirective (directive, atts);
}
internal static List <string> FileDependencies {
get { return dependencies; }
}
#if NET_4_0
internal override Type DefaultBaseType {
get {
Type ret = PageParser.DefaultApplicationBaseType;
if (ret == null)
return base.DefaultBaseType;
return ret;
}
}
#endif
internal override string DefaultBaseTypeName {
get { return "System.Web.HttpApplication"; }
}
internal override string DefaultDirectiveName {
get { return "application"; }
}
internal override string BaseVirtualDir {
get { return Context.Request.ApplicationPath; }
}
internal override TextReader Reader {
get { return reader; }
set { reader = value; }
}
}
}

View File

@ -0,0 +1,192 @@
//
// System.Web.UI.AttributeCollection.cs
//
// Authors:
// Duncan Mak (duncan@ximian.com)
// Gonzalo Paniagua (gonzalo@ximian.com)
//
// (C) 2002 Ximian, Inc. (http://www.ximian.com
// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.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.
//
using System.Collections;
using System.Globalization;
using System.Security.Permissions;
using System.Web.Util;
namespace System.Web.UI {
// CAS - no InheritanceDemand here as the class is sealed
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class AttributeCollection
{
StateBag bag;
CssStyleCollection styleCollection;
internal const string StyleAttribute = "style";
public AttributeCollection (StateBag bag)
{
this.bag = bag;
}
public override bool Equals (object obj)
{
AttributeCollection other = obj as AttributeCollection;
if (other == null) {
return false;
}
if (Count != other.Count) {
return false;
}
foreach (string key in Keys) {
if (0 == String.CompareOrdinal (key, StyleAttribute)) {
continue;
}
if (0 == String.CompareOrdinal (other [key], this [key])) {
return false;
}
}
if ((styleCollection == null && other.styleCollection != null) ||
(styleCollection != null && other.styleCollection == null)) {
return false;
}
else if (styleCollection != null){
// other.styleCollection != null too
if (styleCollection.Count != other.styleCollection.Count){
return false;
}
foreach (string styleKey in styleCollection.Keys){
if (0 == String.CompareOrdinal(styleCollection [styleKey], other.styleCollection [styleKey])) {
return false;
}
}
}
return true;
}
public override int GetHashCode ()
{
int hashValue = 0;
foreach (string key in Keys) {
if (key == StyleAttribute) {
continue;
}
hashValue ^= key.GetHashCode ();
string value = this [key];
if (value != null) {
hashValue ^= value.GetHashCode ();
}
}
if (styleCollection != null) {
foreach (string styleKey in styleCollection.Keys) {
hashValue ^= styleCollection [styleKey].GetHashCode ();
string styleValue = styleCollection [styleKey];
if (styleValue != null) {
hashValue ^= styleValue.GetHashCode ();
}
}
}
return hashValue;
}
public int Count {
get { return bag.Count; }
}
public CssStyleCollection CssStyle {
get {
if (styleCollection == null)
styleCollection = new CssStyleCollection (bag);
return styleCollection;
}
}
public string this [string key] {
get { return bag [key] as string; }
set {
Add (key, value);
}
}
public ICollection Keys {
get { return bag.Keys; }
}
public void Add (string key, string value)
{
if (0 == String.Compare (key, StyleAttribute, true, Helpers.InvariantCulture)) {
CssStyle.Value = value;
return;
}
bag.Add (key, value);
}
public void AddAttributes (HtmlTextWriter writer)
{
foreach (string key in bag.Keys) {
string value = bag [key] as string;
writer.AddAttribute (key, value);
}
}
public void Clear ()
{
CssStyle.Clear ();
bag.Clear ();
}
public void Remove (string key)
{
if (0 == String.Compare (key, StyleAttribute, true, Helpers.InvariantCulture)) {
CssStyle.Clear ();
return;
}
bag.Remove (key);
}
public void Render (HtmlTextWriter writer)
{
foreach (string key in bag.Keys) {
string value = bag [key] as string;
if (value != null)
writer.WriteAttribute (key, value, true);
}
}
internal void CopyFrom (AttributeCollection attributeCollection)
{
if (attributeCollection == null || attributeCollection.Count == 0)
return;
foreach (string key in attributeCollection.bag.Keys)
this.Add (key, attributeCollection [key]);
}
}
}

View File

@ -0,0 +1,210 @@
//
// System.Web.UI.BaseParser.cs
//
// Authors:
// Duncan Mak (duncan@ximian.com)
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) 2002 Ximian, Inc. (http://www.ximian.com)
// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.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.
//
using System.Collections;
using System.IO;
using System.Security.Permissions;
using System.Web.Compilation;
using System.Web.Configuration;
using System.Globalization;
using System.Web.Util;
namespace System.Web.UI
{
// CAS
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class BaseParser
{
HttpContext context;
string baseDir;
string baseVDir;
ILocation location;
internal string MapPath (string path)
{
return MapPath (path, true);
}
internal string MapPath (string path, bool allowCrossAppMapping)
{
if (context == null)
throw new HttpException ("context is null!!");
return context.Request.MapPath (path, BaseVirtualDir, allowCrossAppMapping);
}
internal string PhysicalPath (string path)
{
if (Path.DirectorySeparatorChar != '/')
path = path.Replace ('/', '\\');
return Path.Combine (BaseDir, path);
}
internal bool GetBool (IDictionary hash, string key, bool deflt)
{
string val = hash [key] as string;
if (val == null)
return deflt;
hash.Remove (key);
bool result = false;
if (String.Compare (val, "true", true, Helpers.InvariantCulture) == 0)
result = true;
else if (String.Compare (val, "false", true, Helpers.InvariantCulture) != 0)
ThrowParseException ("Invalid value for " + key);
return result;
}
internal static string GetString (IDictionary hash, string key, string deflt)
{
string val = hash [key] as string;
if (val == null)
return deflt;
hash.Remove (key);
return val;
}
internal static bool IsDirective (string value, char directiveChar)
{
if (value == null || value == String.Empty)
return false;
value = value.Trim ();
if (!StrUtils.StartsWith (value, "<%") || !StrUtils.EndsWith (value, "%>"))
return false;
int dcIndex = value.IndexOf (directiveChar, 2);
if (dcIndex == -1)
return false;
if (dcIndex == 2)
return true;
dcIndex--;
while (dcIndex >= 2) {
if (!Char.IsWhiteSpace (value [dcIndex]))
return false;
dcIndex--;
}
return true;
}
internal static bool IsDataBound (string value)
{
return IsDirective (value, '#');
}
internal static bool IsExpression (string value)
{
return IsDirective (value, '$');
}
internal void ThrowParseException (string message, params object[] parms)
{
if (parms == null)
throw new ParseException (location, message);
throw new ParseException (location, String.Format (message, parms));
}
internal void ThrowParseException (string message, Exception inner, params object[] parms)
{
if (parms == null || parms.Length == 0)
throw new ParseException (location, message, inner);
else
throw new ParseException (location, String.Format (message, parms), inner);
}
internal void ThrowParseFileNotFound (string path, params object[] parms)
{
ThrowParseException ("The file '" + path + "' does not exist", parms);
}
internal ILocation Location {
get { return location; }
set { location = value; }
}
internal HttpContext Context {
get { return context; }
set { context = value; }
}
internal string BaseDir {
get {
if (baseDir == null)
baseDir = MapPath (BaseVirtualDir, false);
return baseDir;
}
}
internal virtual string BaseVirtualDir {
get {
if (baseVDir == null)
baseVDir = VirtualPathUtility.GetDirectory (context.Request.FilePath);
return baseVDir;
}
set {
if (VirtualPathUtility.IsRooted (value))
baseVDir = VirtualPathUtility.ToAbsolute (value);
else
baseVDir = value;
}
}
internal TSection GetConfigSection <TSection> (string section) where TSection: global::System.Configuration.ConfigurationSection
{
VirtualPath vpath = VirtualPath;
string vp = vpath != null ? vpath.Absolute : null;
if (vp == null)
return WebConfigurationManager.GetSection (section) as TSection;
else
return WebConfigurationManager.GetSection (section, vp) as TSection;
}
internal VirtualPath VirtualPath {
get;
set;
}
internal CompilationSection CompilationConfig {
get { return GetConfigSection <CompilationSection> ("system.web/compilation"); }
}
}
}

View File

@ -0,0 +1,274 @@
//
// System.Web.UI.BasePartialCachingControl.cs
//
// Author:
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
// Jackson Harper (jackson@ximian.com)
//
// (C) 2003 Andreas Nahr
// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.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.
//
using System.IO;
using System.Text;
using System.ComponentModel;
using System.Security.Permissions;
using System.Web.Caching;
namespace System.Web.UI
{
// CAS
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
// attributes
[ToolboxItem (false)]
public abstract class BasePartialCachingControl : Control
{
CacheDependency dependency;
string ctrl_id;
string guid;
int duration;
string varyby_params;
string varyby_controls;
string varyby_custom;
DateTime expirationTime;
bool slidingExpiration;
Control control;
ControlCachePolicy cachePolicy;
string cacheKey;
string cachedData;
protected BasePartialCachingControl()
{
}
internal string CtrlID {
get { return ctrl_id; }
set { ctrl_id = value; }
}
internal string Guid {
get { return guid; }
set { guid = value; }
}
internal int Duration {
get { return duration; }
set { duration = value; }
}
internal string VaryByParams {
get { return varyby_params; }
set { varyby_params = value; }
}
internal string VaryByControls {
get { return varyby_controls; }
set { varyby_controls = value; }
}
internal string VaryByCustom {
get { return varyby_custom; }
set { varyby_custom = value; }
}
internal DateTime ExpirationTime {
get { return expirationTime; }
set { expirationTime = value; }
}
internal bool SlidingExpiration {
get { return slidingExpiration; }
set { slidingExpiration = value; }
}
#if NET_4_0
internal string ProviderName {
get; set;
}
#endif
internal abstract Control CreateControl ();
public override void Dispose ()
{
if (dependency != null) {
dependency.Dispose ();
dependency = null;
}
}
void RetrieveCachedContents ()
{
cacheKey = CreateKey ();
#if NET_4_0
OutputCacheProvider provider = GetProvider ();
cachedData = provider.Get (cacheKey) as string;
#else
Cache cache = HttpRuntime.InternalCache;
cachedData = cache [cacheKey] as string;
#endif
}
#if NET_4_0
OutputCacheProvider GetProvider ()
{
string providerName = ProviderName;
OutputCacheProvider provider;
if (String.IsNullOrEmpty (providerName))
provider = OutputCache.DefaultProvider;
else {
provider = OutputCache.GetProvider (providerName);
if (provider == null)
provider = OutputCache.DefaultProvider;
}
return provider;
}
void OnDependencyChanged (string key, object value, CacheItemRemovedReason reason)
{
Console.WriteLine ("{0}.OnDependencyChanged (\"{0}\", {1}, {2})", this, key, value, reason);
GetProvider ().Remove (key);
}
internal override void InitRecursive (Control namingContainer)
{
RetrieveCachedContents ();
if (cachedData == null) {
control = CreateControl ();
Controls.Add (control);
} else
control = null;
base.InitRecursive (namingContainer);
}
#else
protected internal override void OnInit (EventArgs e)
{
control = CreateControl ();
Controls.Add (control);
}
#endif
protected internal override void Render (HtmlTextWriter output)
{
#if !NET_4_0
RetrieveCachedContents ();
#endif
if (cachedData != null) {
output.Write (cachedData);
return;
}
if (control == null) {
base.Render (output);
return;
}
HttpContext context = HttpContext.Current;
StringWriter writer = new StringWriter ();
TextWriter prev = context.Response.SetTextWriter (writer);
HtmlTextWriter txt_writer = new HtmlTextWriter (writer);
string text;
try {
control.RenderControl (txt_writer);
} finally {
text = writer.ToString ();
context.Response.SetTextWriter (prev);
output.Write (text);
}
#if NET_4_0
OutputCacheProvider provider = GetProvider ();
DateTime utcExpire = DateTime.UtcNow.AddSeconds (duration);
provider.Set (cacheKey, text, utcExpire);;
context.InternalCache.Insert (cacheKey, text, dependency, utcExpire.ToLocalTime (),
Cache.NoSlidingExpiration, CacheItemPriority.Normal,
null);
#else
context.InternalCache.Insert (cacheKey, text, dependency,
DateTime.Now.AddSeconds (duration),
Cache.NoSlidingExpiration,
CacheItemPriority.Normal, null);
#endif
}
public ControlCachePolicy CachePolicy
{
get {
if (cachePolicy == null)
cachePolicy = new ControlCachePolicy (this);
return cachePolicy;
}
}
public CacheDependency Dependency {
get {return dependency;}
set {dependency = value;}
}
string CreateKey ()
{
StringBuilder builder = new StringBuilder ();
HttpContext context = HttpContext.Current;
builder.Append ("PartialCachingControl\n");
builder.Append ("GUID: " + guid + "\n");
if (varyby_params != null && varyby_params.Length > 0) {
string[] prms = varyby_params.Split (';');
for (int i=0; i<prms.Length; i++) {
string val = context.Request.Params [prms [i]];
builder.Append ("VP:");
builder.Append (prms [i]);
builder.Append ('=');
builder.Append (val != null ? val : "__null__");
builder.Append ('\n');
}
}
if (varyby_controls != null && varyby_params.Length > 0) {
string[] prms = varyby_controls.Split (';');
for (int i=0; i<prms.Length; i++) {
string val = context.Request.Params [prms [i]];
builder.Append ("VCN:");
builder.Append (prms [i]);
builder.Append ('=');
builder.Append (val != null ? val : "__null__");
builder.Append ('\n');
}
}
if (varyby_custom != null) {
string val = context.ApplicationInstance.GetVaryByCustomString (context,
varyby_custom);
builder.Append ("VC:");
builder.Append (varyby_custom);
builder.Append ('=');
builder.Append (val != null ? val : "__null__");
builder.Append ('\n');
}
return builder.ToString ();
}
}
}

View File

@ -0,0 +1,85 @@
//
// System.Web.UI.BaseTemplateParser
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
// Copyright (C) 2006-2010 Novell, Inc (http://www.novell.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.
//
using System;
using System.Web;
using System.Web.Hosting;
using System.Web.Compilation;
using System.Web.Configuration;
namespace System.Web.UI
{
public abstract class BaseTemplateParser : TemplateParser
{
protected BaseTemplateParser ()
{
}
protected Type GetReferencedType (string virtualPath)
{
if (String.IsNullOrEmpty (virtualPath))
throw new ArgumentNullException ("virtualPath");
var pageParserFilter = PageParserFilter;
if (pageParserFilter != null) {
var cfg = WebConfigurationManager.GetSection ("system.web/compilation") as CompilationSection;
if (cfg == null)
throw new HttpException ("Internal error. Missing configuration section.");
string extension = VirtualPathUtility.GetExtension (virtualPath);
Type btype = cfg.BuildProviders.GetProviderTypeForExtension (extension);
VirtualReferenceType reftype;
if (btype == null)
reftype = VirtualReferenceType.Other;
else if (btype == typeof (PageBuildProvider))
reftype = VirtualReferenceType.Page;
else if (btype == typeof (UserControlBuildProvider))
reftype = VirtualReferenceType.UserControl;
else if (btype == typeof (MasterPageBuildProvider))
reftype = VirtualReferenceType.Master;
else
reftype = VirtualReferenceType.SourceFile;
if (!pageParserFilter.AllowVirtualReference (virtualPath, reftype))
throw new HttpException ("The parser does not permit a virtual reference to the UserControl.");
}
virtualPath = HostingEnvironment.VirtualPathProvider.CombineVirtualPaths (VirtualPath.Absolute, virtualPath);
return BuildManager.GetCompiledType (virtualPath);
}
[MonoTODO ("We don't do anything here with the no-compile controls.")]
protected internal Type GetUserControlType (string virtualPath)
{
// Documented as a wrapper for the call below, but what does it do?
return GetReferencedType (virtualPath);
}
}
}

View File

@ -0,0 +1,91 @@
//
// System.Web.UI.BoundPropertyEntry
//
// Authors:
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// Copyright (c) 2005-2010 Novell, Inc (http://www.novell.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.
//
using System;
using System.Web;
using System.Web.Compilation;
namespace System.Web.UI
{
public class BoundPropertyEntry : PropertyEntry
{
internal BoundPropertyEntry ()
{
}
public string ControlID {
get; set;
}
public Type ControlType {
get; set;
}
public string Expression {
get; set;
}
public ExpressionBuilder ExpressionBuilder {
get; set;
}
public string ExpressionPrefix {
get; set;
}
public string FieldName {
get; set;
}
public string FormatString {
get; set;
}
public bool Generated {
get; set;
}
public object ParsedExpressionData {
get; set;
}
public bool ReadOnlyProperty {
get; set;
}
public bool TwoWayBound {
get; set;
}
public bool UseSetAttribute {
get; set;
}
}
}

View File

@ -0,0 +1,37 @@
//
// System.Web.UI.BuildMethod.cs
//
// Author:
// Bob Smith <bob@thestuff.net>
//
// (C) Bob Smith
//
//
// 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.
//
using System;
using System.Web;
namespace System.Web.UI
{
public delegate Control BuildMethod();
}

View File

@ -0,0 +1,37 @@
//
// System.Web.UI.BuildTemplateMethod.cs
//
// Author:
// Bob Smith <bob@thestuff.net>
//
// (C) Bob Smith
//
//
// 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.
//
using System;
using System.Web;
namespace System.Web.UI
{
public delegate void BuildTemplateMethod(Control control);
}

View File

@ -0,0 +1,42 @@
//
// System.Web.UI.BuilderPropertyEntry.cs
//
// Authors:
// Arina Itkes (arinai@mainsoft.com)
//
// (C) 2007 Mainsoft Co. (http://www.mainsoft.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.
//
using System.Web.UI;
namespace System.Web.UI
{
public abstract class BuilderPropertyEntry : PropertyEntry
{
public ControlBuilder Builder {
get;
set;
}
}
}

View File

@ -0,0 +1 @@
6ed7ad0c4b96935057043fdf9cad6d0147529927

View File

@ -0,0 +1,180 @@
//
// ChtmlTextWriter.cs: Compact HTML
//
// Author:
// Cesar Lopez Nataren <cnataren@novell.com>
//
//
// Copyright (C) 2006-2010 Novell, Inc (http://www.novell.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.
//
using System;
using System.IO;
using System.Collections;
namespace System.Web.UI {
public class ChtmlTextWriter : Html32TextWriter
{
static Hashtable global_suppressed_attrs;
static string [] global_suppressed_attributes = {
"onclick", "ondblclick", "onmousedown", "onmouseup",
"onmouseover", "onmousemove", "onmouseout",
"onkeypress", "onkeydown", "onkeyup"
};
static string [] recognized_attributes = {"div", "span"};
Hashtable recognized_attrs = new Hashtable (recognized_attributes.Length);
Hashtable suppressed_attrs = new Hashtable (recognized_attributes.Length);
static ChtmlTextWriter ()
{
SetupGlobalSuppressedAttrs (global_suppressed_attributes);
}
static void SetupGlobalSuppressedAttrs (string [] attrs)
{
global_suppressed_attrs = new Hashtable ();
PopulateHash (global_suppressed_attrs, global_suppressed_attributes);
}
static void PopulateHash (Hashtable hash, string [] keys)
{
foreach (string key in keys)
hash.Add (key, true);
}
public ChtmlTextWriter (TextWriter writer)
: this (writer, DefaultTabString)
{
}
public ChtmlTextWriter (TextWriter writer, string tabString)
: base (writer, tabString)
{
//
// setup the recognized attrs
//
foreach (string key in recognized_attributes)
recognized_attrs.Add (key, new Hashtable ());
SetupSuppressedAttrs ();
}
void SetupSuppressedAttrs ()
{
//
// we don't make these static because they are not read-only
//
string [] div_suppressed_attributes = {
"accesskey", "cellspacing", "cellpadding",
"gridlines", "rules"
};
string [] span_suppressed_attributes = {
"cellspacing", "cellpadding",
"gridlines", "rules"
};
Init ("div", div_suppressed_attributes, suppressed_attrs);
Init ("span", span_suppressed_attributes, suppressed_attrs);
}
static void Init (string key, string [] attrs, Hashtable container)
{
Hashtable attrs_hash = new Hashtable (attrs.Length);
PopulateHash (attrs_hash, attrs);
container.Add (key, attrs_hash);
}
protected Hashtable GlobalSuppressedAttributes {
get { return global_suppressed_attrs; }
}
protected Hashtable RecognizedAttributes {
get { return recognized_attrs; }
}
protected Hashtable SuppressedAttributes {
get { return suppressed_attrs; }
}
public virtual void AddRecognizedAttribute (string elementName, string attributeName)
{
Hashtable elem_attrs = (Hashtable) recognized_attrs [elementName];
if (elem_attrs == null) {
elem_attrs = new Hashtable ();
elem_attrs.Add (attributeName, true);
recognized_attrs.Add (elementName, elem_attrs);
} else
elem_attrs.Add (attributeName, true);
}
public virtual void RemoveRecognizedAttribute (string elementName, string attributeName)
{
Hashtable elem_attrs = (Hashtable) recognized_attrs [elementName];
if (elem_attrs != null)
elem_attrs.Remove (attributeName);
}
//
// writes <br>
//
public override void WriteBreak ()
{
string br = GetTagName (HtmlTextWriterTag.Br);
WriteBeginTag (br);
Write (TagRightChar);
}
public override void WriteEncodedText (string text)
{
base.WriteEncodedText (text);
}
Hashtable attr_render = new Hashtable ();
protected override bool OnAttributeRender (string name, string value, HtmlTextWriterAttribute key)
{
// FIXME:
// I checked every possible HtmlTextWriterAttribute key
// and always throws ArgumentNullException.
return (bool) attr_render [null];
}
protected override bool OnStyleAttributeRender (string styleAttrName, string value, HtmlTextWriterStyle key)
{
return key == HtmlTextWriterStyle.Display;
}
protected override bool OnTagRender (string name, HtmlTextWriterTag tag)
{
return tag != HtmlTextWriterTag.Span;
}
}
}

View File

@ -0,0 +1,39 @@
//
// Authors:
// Marek Habersack (mhabersack@novell.com)
//
// (C) 2002,2003 Ximian, Inc. (http://www.ximian.com)
// Copyright (C) 2003-2010 Novell, Inc (http://www.novell.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.
//
using System;
namespace System.Web.UI
{
public enum ClientIDMode
{
Inherit,
AutoID,
Predictable,
Static
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,64 @@
//
// System.Web.UI.CodeBuilder
//
// Authors:
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) 2003 Ximian, Inc. (http://www.ximian.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.
//
using System.Web.Compilation;
namespace System.Web.UI
{
abstract class CodeBuilder : ControlBuilder
{
string code;
bool isAssign;
public CodeBuilder (string code, bool isAssign, ILocation location)
{
this.code = code;
this.isAssign = isAssign;
this.Line = location.BeginLine;
this.FileName = location.Filename;
this.Location = location;
}
internal override object CreateInstance ()
{
return null;
}
internal string Code {
get { return code; }
set { code = value; }
}
internal bool IsAssign {
get { return isAssign; }
}
}
}

View File

@ -0,0 +1,38 @@
//
// System.Web.UI.CompilationMode.cs
//
// Authors:
// Marek Safar (marek.safar@gmail.com)
//
// Copyright (C) 2009-2010 Novell, Inc (http://www.novell.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.UI
{
public enum CodeConstructType
{
CodeSnippet = 0,
ExpressionSnippet = 1,
DataBindingSnippet = 2,
ScriptTag = 3
}
}

View File

@ -0,0 +1,55 @@
//
// System.Web.UI.CodeRenderBuilder
//
// Authors:
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) 2003 Ximian, Inc. (http://www.ximian.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.
//
using System.Web.Compilation;
namespace System.Web.UI
{
sealed class CodeRenderBuilder : CodeBuilder
{
#if NET_4_0
public bool HtmlEncode {
get; private set;
}
public CodeRenderBuilder (string code, bool isAssign, ILocation location, bool doHtmlEncode)
: base (code, isAssign, location)
{
this.HtmlEncode = doHtmlEncode;
}
#endif
public CodeRenderBuilder (string code, bool isAssign, ILocation location)
: base (code, isAssign, location)
{
}
}
}

View File

@ -0,0 +1,96 @@
//
// System.Web.UI.CollectionBuilder.cs
//
// Authors:
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (c) 2003 Ximian, Inc. (http://www.ximian.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.
//
using System;
using System.Collections;
using System.Reflection;
using System.Text;
namespace System.Web.UI
{
sealed class CollectionBuilder : ControlBuilder
{
Type[] possibleElementTypes;
internal CollectionBuilder ()
{
}
public override void AppendLiteralString (string s)
{
if (s != null && s.Trim ().Length > 0)
throw new HttpException ("Literal content not allowed for " + ControlType);
}
public override Type GetChildControlType (string tagName, IDictionary attribs)
{
Type t = Root.GetChildControlType (tagName, attribs);
if (possibleElementTypes != null) {
bool foundMatchingType = false;
for (int i = 0; i < possibleElementTypes.Length && !foundMatchingType; ++i)
foundMatchingType = possibleElementTypes[i].IsAssignableFrom (t);
if (!foundMatchingType) {
StringBuilder possibleTypesString = new StringBuilder ();
for (int i = 0; i < possibleElementTypes.Length; i++) {
if (i != 0)
possibleTypesString.Append (", ");
possibleTypesString.Append (possibleElementTypes[i]);
}
throw new HttpException ("Cannot add a " + t + " to " + possibleTypesString);
}
}
return t;
}
public override void Init (TemplateParser parser,
ControlBuilder parentBuilder,
Type type,
string tagName,
string id,
IDictionary attribs)
{
base.Init (parser, parentBuilder, type, tagName, id, attribs);
PropertyInfo prop = parentBuilder.ControlType.GetProperty (tagName, FlagsNoCase);
SetControlType (prop.PropertyType);
MemberInfo[] mems = ControlType.GetMember ("Item", MemberTypes.Property, FlagsNoCase & ~BindingFlags.IgnoreCase);
if (mems.Length > 0) {
possibleElementTypes = new Type [mems.Length];
for (int i = 0; i < mems.Length; ++i)
possibleElementTypes [i] = ((PropertyInfo)mems [i]).PropertyType;
} else
throw new HttpException ("Collection of type '" + ControlType + "' does not have an indexer.");
}
}
}

View File

@ -0,0 +1,36 @@
//
// System.Web.UI.CompilationMode.cs
//
// Authors:
// Sanjay Gupta (gsanjay@novell.com)
//
// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.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.UI {
public enum CompilationMode {
Auto = 0,
Never = 1,
Always = 2
}
}

View File

@ -0,0 +1,55 @@
//
// System.Web.UI.CompiledBindableTemplateBuilder.cs
//
// Authors:
// Lluis Sanchez Gual (lluis@novell.com)
//
// (C) 2005-2010 Novell, Inc (http://www.novell.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.
//
using System.Collections.Specialized;
namespace System.Web.UI
{
public sealed class CompiledBindableTemplateBuilder : IBindableTemplate
{
BuildTemplateMethod templateMethod;
ExtractTemplateValuesMethod extractMethod;
public CompiledBindableTemplateBuilder (BuildTemplateMethod buildTemplateMethod, ExtractTemplateValuesMethod extractTemplateValuesMethod)
{
this.templateMethod = buildTemplateMethod;
this.extractMethod = extractTemplateValuesMethod;
}
public void InstantiateIn (Control container)
{
templateMethod (container);
}
public IOrderedDictionary ExtractValues (Control container)
{
if (extractMethod == null) return null;
return extractMethod (container);
}
}
}

View File

@ -0,0 +1,55 @@
//
// System.Web.UI.CompiledTemplateBuilder
//
// Authors:
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) 2002 Ximian, Inc (http://www.ximian.com)
// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
//
// This is used in the generated C# code from MS and xsp does the same.
// It just seems to be a container implementing an ITemplate interface.
//
// 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.
//
using System.Security.Permissions;
namespace System.Web.UI {
// CAS - no InheritanceDemand here as the class is sealed
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class CompiledTemplateBuilder : ITemplate
{
BuildTemplateMethod templateMethod;
public CompiledTemplateBuilder (BuildTemplateMethod templateMethod)
{
this.templateMethod = templateMethod;
}
public void InstantiateIn (Control ctrl)
{
templateMethod (ctrl);
}
}
}

Some files were not shown because too many files have changed in this diff Show More