+++ /dev/null
-//
-// HttpApplicationStateBase.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public abstract class HttpApplicationStateBase : NameObjectCollectionBase, ICollection, IEnumerable
- {
- void NotImplemented ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual string [] AllKeys {
- get { NotImplemented (); return null; }
- }
-
- public virtual HttpApplicationStateBase Contents {
- get { NotImplemented (); return null; }
- }
-
- public override int Count {
- get { NotImplemented (); return 0; }
- }
-
- public virtual bool IsSynchronized {
- get { NotImplemented (); return false; }
- }
-
- public virtual object this [int index] {
- get { return Get (index); }
- }
-
- public virtual object this [string name] {
- get { return Get (name); }
- set { Set (name, value); }
- }
-
- public virtual HttpStaticObjectsCollectionBase StaticObjects {
- get { NotImplemented (); return null; }
- }
-
- public virtual object SyncRoot {
- get { NotImplemented (); return null; }
- }
-
- public virtual void Add (string name, object value)
- {
- NotImplemented ();
- }
-
- public virtual void Clear ()
- {
- NotImplemented ();
- }
-
- public virtual void CopyTo (Array array, int index)
- {
- NotImplemented ();
- }
-
- public virtual object Get (int index)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual object Get (string name)
- {
- NotImplemented ();
- return null;
- }
-
- public override IEnumerator GetEnumerator ()
- {
- NotImplemented ();
- return null;
- }
-
- public virtual string GetKey (int index)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual void Lock ()
- {
- NotImplemented ();
- }
-
- public virtual void Remove (string name)
- {
- NotImplemented ();
- }
-
- public virtual void RemoveAll ()
- {
- NotImplemented ();
- }
-
- public virtual void RemoveAt (int index)
- {
- NotImplemented ();
- }
-
- public virtual void Set (string name, object value)
- {
- NotImplemented ();
- }
-
- public virtual void UnLock ()
- {
- NotImplemented ();
- }
- }
-}
+++ /dev/null
-//
-// HttpApplicationStateWrapper.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class HttpApplicationStateWrapper : HttpApplicationStateBase
- {
- HttpApplicationState w;
-
- public HttpApplicationStateWrapper (HttpApplicationState httpApplicationState)
- {
- if (httpApplicationState == null)
- throw new ArgumentNullException ("httpApplicationState");
- w = httpApplicationState;
- }
-
- public override string [] AllKeys {
- get { return w.AllKeys; }
- }
-
- public override HttpApplicationStateBase Contents {
- get { return new HttpApplicationStateWrapper (w.Contents); }
- }
-
- public override int Count {
- get { return w.Count; }
- }
-
- public override bool IsSynchronized {
- get { return ((ICollection) this).IsSynchronized; }
- }
-
- public override object this [int index] {
- get { return Get (index); }
- }
-
- public override object this [string name] {
- get { return Get (name); }
- set { Set (name, value); }
- }
-
- public override NameObjectCollectionBase.KeysCollection Keys {
- get { return w.Keys; }
- }
-
- public override HttpStaticObjectsCollectionBase StaticObjects {
- get { return new HttpStaticObjectsCollectionWrapper (w.StaticObjects); }
- }
-
- public override object SyncRoot {
- get { return ((ICollection) this).SyncRoot; }
- }
-
- public override void Add (string name, object value)
- {
- w.Add (name, value);
- }
-
- public override void Clear ()
- {
- w.Clear ();
- }
-
- public override void CopyTo (Array array, int index)
- {
- ((ICollection) this).CopyTo (array, index);
- }
-
- public override object Get (int index)
- {
- return w.Get (index);
- }
-
- public override object Get (string name)
- {
- return w.Get (name);
- }
-
- public override IEnumerator GetEnumerator ()
- {
- return w.GetEnumerator ();
- }
-
- public override string GetKey (int index)
- {
- return w.GetKey (index);
- }
-
- [MonoTODO]
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- w.GetObjectData (info, context);
-
- throw new NotImplementedException ();
- }
-
- public override void Lock ()
- {
- w.Lock ();
- }
-
- public override void OnDeserialization (object sender)
- {
- w.OnDeserialization (sender);
- }
-
- public override void Remove (string name)
- {
- w.Remove (name);
- }
-
- public override void RemoveAll ()
- {
- w.RemoveAll ();
- }
-
- public override void RemoveAt (int index)
- {
- w.RemoveAt (index);
- }
-
- public override void Set (string name, object value)
- {
- w.Set (name, value);
- }
-
- public override void UnLock ()
- {
- w.UnLock ();
- }
- }
-}
+++ /dev/null
-//
-// HttpBrowserCapabilitiesBase.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-using System.Web.UI;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public abstract class HttpBrowserCapabilitiesBase : IFilterResolutionService
- {
- void NotImplemented ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual bool ActiveXControls { get { NotImplemented (); return false; } }
-
- public virtual IDictionary Adapters { get { NotImplemented (); return null; } }
-
- public virtual bool AOL { get { NotImplemented (); return false; } }
-
- public virtual bool BackgroundSounds { get { NotImplemented (); return false; } }
-
- public virtual bool Beta { get { NotImplemented (); return false; } }
-
- public virtual string Browser { get { NotImplemented (); return null; } }
-
- public virtual ArrayList Browsers { get { NotImplemented (); return null; } }
-
- public virtual bool CanCombineFormsInDeck { get { NotImplemented (); return false; } }
-
- public virtual bool CanInitiateVoiceCall { get { NotImplemented (); return false; } }
-
- public virtual bool CanRenderAfterInputOrSelectElement { get { NotImplemented (); return false; } }
-
- public virtual bool CanRenderEmptySelects { get { NotImplemented (); return false; } }
-
- public virtual bool CanRenderInputAndSelectElementsTogether { get { NotImplemented (); return false; } }
-
- public virtual bool CanRenderMixedSelects { get { NotImplemented (); return false; } }
-
- public virtual bool CanRenderOneventAndPrevElementsTogether { get { NotImplemented (); return false; } }
-
- public virtual bool CanRenderPostBackCards { get { NotImplemented (); return false; } }
-
- public virtual bool CanRenderSetvarZeroWithMultiSelectionList { get { NotImplemented (); return false; } }
-
- public virtual bool CanSendMail { get { NotImplemented (); return false; } }
-
- public virtual IDictionary Capabilities { get; set; }
-
- public virtual bool CDF { get { NotImplemented (); return false; } }
-
- public virtual Version ClrVersion { get { NotImplemented (); return null; } }
-
- public virtual bool Cookies { get { NotImplemented (); return false; } }
-
- public virtual bool Crawler { get { NotImplemented (); return false; } }
-
- public virtual int DefaultSubmitButtonLimit { get { NotImplemented (); return 0; } }
-
- public virtual Version EcmaScriptVersion { get { NotImplemented (); return null; } }
-
- public virtual bool Frames { get { NotImplemented (); return false; } }
-
- public virtual int GatewayMajorVersion { get { NotImplemented (); return 0; } }
-
- public virtual double GatewayMinorVersion { get { NotImplemented (); return 0; } }
-
- public virtual string GatewayVersion { get { NotImplemented (); return null; } }
-
- public virtual bool HasBackButton { get { NotImplemented (); return false; } }
-
- public virtual bool HidesRightAlignedMultiselectScrollbars { get { NotImplemented (); return false; } }
-
- public virtual string HtmlTextWriter { get; set; }
-
- public virtual string Id { get { NotImplemented (); return null; } }
-
- public virtual string InputType { get { NotImplemented (); return null; } }
-
- public virtual bool IsColor { get { NotImplemented (); return false; } }
-
- public virtual bool IsMobileDevice { get { NotImplemented (); return false; } }
-
- public virtual string this [string key] {
- get { throw new NotImplementedException (); }
- }
-
- public virtual bool JavaApplets { get { NotImplemented (); return false; } }
-
- public virtual Version JScriptVersion { get { NotImplemented (); return null; } }
-
- public virtual int MajorVersion { get { NotImplemented (); return 0; } }
-
- public virtual int MaximumHrefLength { get { NotImplemented (); return 0; } }
-
- public virtual int MaximumRenderedPageSize { get { NotImplemented (); return 0; } }
-
- public virtual int MaximumSoftkeyLabelLength { get { NotImplemented (); return 0; } }
-
- public virtual double MinorVersion { get { NotImplemented (); return 0; } }
-
- public virtual string MinorVersionString { get { NotImplemented (); return null; } }
-
- public virtual string MobileDeviceManufacturer { get { NotImplemented (); return null; } }
-
- public virtual string MobileDeviceModel { get { NotImplemented (); return null; } }
-
- public virtual Version MSDomVersion { get { NotImplemented (); return null; } }
-
- public virtual int NumberOfSoftkeys { get { NotImplemented (); return 0; } }
-
- public virtual string Platform { get { NotImplemented (); return null; } }
-
- public virtual string PreferredImageMime { get { NotImplemented (); return null; } }
-
- public virtual string PreferredRenderingMime { get { NotImplemented (); return null; } }
-
- public virtual string PreferredRenderingType { get { NotImplemented (); return null; } }
-
- public virtual string PreferredRequestEncoding { get { NotImplemented (); return null; } }
-
- public virtual string PreferredResponseEncoding { get { NotImplemented (); return null; } }
-
- public virtual bool RendersBreakBeforeWmlSelectAndInput { get { NotImplemented (); return false; } }
-
- public virtual bool RendersBreaksAfterHtmlLists { get { NotImplemented (); return false; } }
-
- public virtual bool RendersBreaksAfterWmlAnchor { get { NotImplemented (); return false; } }
-
- public virtual bool RendersBreaksAfterWmlInput { get { NotImplemented (); return false; } }
-
- public virtual bool RendersWmlDoAcceptsInline { get { NotImplemented (); return false; } }
-
- public virtual bool RendersWmlSelectsAsMenuCards { get { NotImplemented (); return false; } }
-
- public virtual string RequiredMetaTagNameValue { get { NotImplemented (); return null; } }
-
- public virtual bool RequiresAttributeColonSubstitution { get { NotImplemented (); return false; } }
-
- public virtual bool RequiresContentTypeMetaTag { get { NotImplemented (); return false; } }
-
- public virtual bool RequiresControlStateInSession { get { NotImplemented (); return false; } }
-
- public virtual bool RequiresDBCSCharacter { get { NotImplemented (); return false; } }
-
- public virtual bool RequiresHtmlAdaptiveErrorReporting { get { NotImplemented (); return false; } }
-
- public virtual bool RequiresLeadingPageBreak { get { NotImplemented (); return false; } }
-
- public virtual bool RequiresNoBreakInFormatting { get { NotImplemented (); return false; } }
-
- public virtual bool RequiresOutputOptimization { get { NotImplemented (); return false; } }
-
- public virtual bool RequiresPhoneNumbersAsPlainText { get { NotImplemented (); return false; } }
-
- public virtual bool RequiresSpecialViewStateEncoding { get { NotImplemented (); return false; } }
-
- public virtual bool RequiresUniqueFilePathSuffix { get { NotImplemented (); return false; } }
-
- public virtual bool RequiresUniqueHtmlCheckboxNames { get { NotImplemented (); return false; } }
-
- public virtual bool RequiresUniqueHtmlInputNames { get { NotImplemented (); return false; } }
-
- public virtual bool RequiresUrlEncodedPostfieldValues { get { NotImplemented (); return false; } }
-
- public virtual int ScreenBitDepth { get { NotImplemented (); return 0; } }
-
- public virtual int ScreenCharactersHeight { get { NotImplemented (); return 0; } }
-
- public virtual int ScreenCharactersWidth { get { NotImplemented (); return 0; } }
-
- public virtual int ScreenPixelsHeight { get { NotImplemented (); return 0; } }
-
- public virtual int ScreenPixelsWidth { get { NotImplemented (); return 0; } }
-
- public virtual bool SupportsAccesskeyAttribute { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsBodyColor { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsBold { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsCacheControlMetaTag { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsCallback { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsCss { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsDivAlign { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsDivNoWrap { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsEmptyStringInCookieValue { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsFontColor { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsFontName { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsFontSize { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsImageSubmit { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsIModeSymbols { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsInputIStyle { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsInputMode { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsItalic { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsJPhoneMultiMediaAttributes { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsJPhoneSymbols { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsQueryStringInFormAction { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsRedirectWithCookie { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsSelectMultiple { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsUncheck { get { NotImplemented (); return false; } }
-
- public virtual bool SupportsXmlHttp { get { NotImplemented (); return false; } }
-
- public virtual bool Tables { get { NotImplemented (); return false; } }
-
- public virtual Type TagWriter { get { NotImplemented (); return null; } }
-
- public virtual string Type { get { NotImplemented (); return null; } }
-
- public virtual bool UseOptimizedCacheKey { get { NotImplemented (); return false; } }
-
- public virtual bool VBScript { get { NotImplemented (); return false; } }
-
- public virtual string Version { get { NotImplemented (); return null; } }
-
- public virtual Version W3CDomVersion { get { NotImplemented (); return null; } }
-
- public virtual bool Win16 { get { NotImplemented (); return false; } }
-
- public virtual bool Win32 { get { NotImplemented (); return false; } }
-
- public virtual void AddBrowser (string browserName)
- {
- NotImplemented ();
- }
-
- public virtual int CompareFilters (string filter1, string filter2)
- {
- NotImplemented ();
- return 0;
- }
-
- public virtual HtmlTextWriter CreateHtmlTextWriter (TextWriter w)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual void DisableOptimizedCacheKey ()
- {
- NotImplemented ();
- }
-
- public virtual bool EvaluateFilter (string filterName)
- {
- NotImplemented ();
- return false;
- }
-
- public virtual Version [] GetClrVersions ()
- {
- NotImplemented ();
- return null;
- }
-
- public virtual bool IsBrowser (string browserName)
- {
- NotImplemented ();
- return false;
- }
- }
-}
+++ /dev/null
-//
-// HttpBrowserCapabilitiesWrapper.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-using System.Web.UI;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class HttpBrowserCapabilitiesWrapper : HttpBrowserCapabilitiesBase
- {
- HttpBrowserCapabilities w;
-
- public HttpBrowserCapabilitiesWrapper (HttpBrowserCapabilities httpBrowserCapabilities)
- {
- if (httpBrowserCapabilities == null)
- throw new ArgumentNullException ("httpBrowserCapabilities");
- w = httpBrowserCapabilities;
- }
-
-
- public override bool ActiveXControls {
- get { return w.ActiveXControls; }
- }
-
- public override IDictionary Adapters {
- get { return w.Adapters; }
- }
-
- public override bool AOL {
- get { return w.AOL; }
- }
-
- public override bool BackgroundSounds {
- get { return w.BackgroundSounds; }
- }
-
- public override bool Beta {
- get { return w.Beta; }
- }
-
- public override string Browser {
- get { return w.Browser; }
- }
-
- public override ArrayList Browsers {
- get { return w.Browsers; }
- }
-
- public override bool CanCombineFormsInDeck {
- get { return w.CanCombineFormsInDeck; }
- }
-
- public override bool CanInitiateVoiceCall {
- get { return w.CanInitiateVoiceCall; }
- }
-
- public override bool CanRenderAfterInputOrSelectElement {
- get { return w.CanRenderAfterInputOrSelectElement; }
- }
-
- public override bool CanRenderEmptySelects {
- get { return w.CanRenderEmptySelects; }
- }
-
- public override bool CanRenderInputAndSelectElementsTogether {
- get { return w.CanRenderInputAndSelectElementsTogether; }
- }
-
- public override bool CanRenderMixedSelects {
- get { return w.CanRenderMixedSelects; }
- }
-
- public override bool CanRenderOneventAndPrevElementsTogether {
- get { return w.CanRenderOneventAndPrevElementsTogether; }
- }
-
- public override bool CanRenderPostBackCards {
- get { return w.CanRenderPostBackCards; }
- }
-
- public override bool CanRenderSetvarZeroWithMultiSelectionList {
- get { return w.CanRenderSetvarZeroWithMultiSelectionList; }
- }
-
- public override bool CanSendMail {
- get { return w.CanSendMail; }
- }
-
- public override IDictionary Capabilities {
- get { return w.Capabilities; } set { w.Capabilities = value; }
- }
-
- public override bool CDF {
- get { return w.CDF; }
- }
-
- public override Version ClrVersion {
- get { return w.ClrVersion; }
- }
-
- public override bool Cookies {
- get { return w.Cookies; }
- }
-
- public override bool Crawler {
- get { return w.Crawler; }
- }
-
- public override int DefaultSubmitButtonLimit {
- get { return w.DefaultSubmitButtonLimit; }
- }
-
- public override Version EcmaScriptVersion {
- get { return w.EcmaScriptVersion; }
- }
-
- public override bool Frames {
- get { return w.Frames; }
- }
-
- public override int GatewayMajorVersion {
- get { return w.GatewayMajorVersion; }
- }
-
- public override double GatewayMinorVersion {
- get { return w.GatewayMinorVersion; }
- }
-
- public override string GatewayVersion {
- get { return w.GatewayVersion; }
- }
-
- public override bool HasBackButton {
- get { return w.HasBackButton; }
- }
-
- public override bool HidesRightAlignedMultiselectScrollbars {
- get { return w.HidesRightAlignedMultiselectScrollbars; }
- }
-
- public override string HtmlTextWriter {
- get { return w.HtmlTextWriter; } set { w.HtmlTextWriter = value; }
- }
-
- public override string Id {
- get { return w.Id; }
- }
-
- public override string InputType {
- get { return w.InputType; }
- }
-
- public override bool IsColor {
- get { return w.IsColor; }
- }
-
- public override bool IsMobileDevice {
- get { return w.IsMobileDevice; }
- }
-
- public override string this [string key] {
- get { throw new NotImplementedException (); }
- }
-
- public override bool JavaApplets {
- get { return w.JavaApplets; }
- }
-
- public override Version JScriptVersion {
- get { return w.JScriptVersion; }
- }
-
- public override int MajorVersion {
- get { return w.MajorVersion; }
- }
-
- public override int MaximumHrefLength {
- get { return w.MaximumHrefLength; }
- }
-
- public override int MaximumRenderedPageSize {
- get { return w.MaximumRenderedPageSize; }
- }
-
- public override int MaximumSoftkeyLabelLength {
- get { return w.MaximumSoftkeyLabelLength; }
- }
-
- public override double MinorVersion {
- get { return w.MinorVersion; }
- }
-
- public override string MinorVersionString {
- get { return w.MinorVersionString; }
- }
-
- public override string MobileDeviceManufacturer {
- get { return w.MobileDeviceManufacturer; }
- }
-
- public override string MobileDeviceModel {
- get { return w.MobileDeviceModel; }
- }
-
- public override Version MSDomVersion {
- get { return w.MSDomVersion; }
- }
-
- public override int NumberOfSoftkeys {
- get { return w.NumberOfSoftkeys; }
- }
-
- public override string Platform {
- get { return w.Platform; }
- }
-
- public override string PreferredImageMime {
- get { return w.PreferredImageMime; }
- }
-
- public override string PreferredRenderingMime {
- get { return w.PreferredRenderingMime; }
- }
-
- public override string PreferredRenderingType {
- get { return w.PreferredRenderingType; }
- }
-
- public override string PreferredRequestEncoding {
- get { return w.PreferredRequestEncoding; }
- }
-
- public override string PreferredResponseEncoding {
- get { return w.PreferredResponseEncoding; }
- }
-
- public override bool RendersBreakBeforeWmlSelectAndInput {
- get { return w.RendersBreakBeforeWmlSelectAndInput; }
- }
-
- public override bool RendersBreaksAfterHtmlLists {
- get { return w.RendersBreaksAfterHtmlLists; }
- }
-
- public override bool RendersBreaksAfterWmlAnchor {
- get { return w.RendersBreaksAfterWmlAnchor; }
- }
-
- public override bool RendersBreaksAfterWmlInput {
- get { return w.RendersBreaksAfterWmlInput; }
- }
-
- public override bool RendersWmlDoAcceptsInline {
- get { return w.RendersWmlDoAcceptsInline; }
- }
-
- public override bool RendersWmlSelectsAsMenuCards {
- get { return w.RendersWmlSelectsAsMenuCards; }
- }
-
- public override string RequiredMetaTagNameValue {
- get { return w.RequiredMetaTagNameValue; }
- }
-
- public override bool RequiresAttributeColonSubstitution {
- get { return w.RequiresAttributeColonSubstitution; }
- }
-
- public override bool RequiresContentTypeMetaTag {
- get { return w.RequiresContentTypeMetaTag; }
- }
-
- public override bool RequiresControlStateInSession {
- get { return w.RequiresControlStateInSession; }
- }
-
- public override bool RequiresDBCSCharacter {
- get { return w.RequiresDBCSCharacter; }
- }
-
- public override bool RequiresHtmlAdaptiveErrorReporting {
- get { return w.RequiresHtmlAdaptiveErrorReporting; }
- }
-
- public override bool RequiresLeadingPageBreak {
- get { return w.RequiresLeadingPageBreak; }
- }
-
- public override bool RequiresNoBreakInFormatting {
- get { return w.RequiresNoBreakInFormatting; }
- }
-
- public override bool RequiresOutputOptimization {
- get { return w.RequiresOutputOptimization; }
- }
-
- public override bool RequiresPhoneNumbersAsPlainText {
- get { return w.RequiresPhoneNumbersAsPlainText; }
- }
-
- public override bool RequiresSpecialViewStateEncoding {
- get { return w.RequiresSpecialViewStateEncoding; }
- }
-
- public override bool RequiresUniqueFilePathSuffix {
- get { return w.RequiresUniqueFilePathSuffix; }
- }
-
- public override bool RequiresUniqueHtmlCheckboxNames {
- get { return w.RequiresUniqueHtmlCheckboxNames; }
- }
-
- public override bool RequiresUniqueHtmlInputNames {
- get { return w.RequiresUniqueHtmlInputNames; }
- }
-
- public override bool RequiresUrlEncodedPostfieldValues {
- get { return w.RequiresUrlEncodedPostfieldValues; }
- }
-
- public override int ScreenBitDepth {
- get { return w.ScreenBitDepth; }
- }
-
- public override int ScreenCharactersHeight {
- get { return w.ScreenCharactersHeight; }
- }
-
- public override int ScreenCharactersWidth {
- get { return w.ScreenCharactersWidth; }
- }
-
- public override int ScreenPixelsHeight {
- get { return w.ScreenPixelsHeight; }
- }
-
- public override int ScreenPixelsWidth {
- get { return w.ScreenPixelsWidth; }
- }
-
- public override bool SupportsAccesskeyAttribute {
- get { return w.SupportsAccesskeyAttribute; }
- }
-
- public override bool SupportsBodyColor {
- get { return w.SupportsBodyColor; }
- }
-
- public override bool SupportsBold {
- get { return w.SupportsBold; }
- }
-
- public override bool SupportsCacheControlMetaTag {
- get { return w.SupportsCacheControlMetaTag; }
- }
-
- public override bool SupportsCallback {
- get { return w.SupportsCallback; }
- }
-
- public override bool SupportsCss {
- get { return w.SupportsCss; }
- }
-
- public override bool SupportsDivAlign {
- get { return w.SupportsDivAlign; }
- }
-
- public override bool SupportsDivNoWrap {
- get { return w.SupportsDivNoWrap; }
- }
-
- public override bool SupportsEmptyStringInCookieValue {
- get { return w.SupportsEmptyStringInCookieValue; }
- }
-
- public override bool SupportsFontColor {
- get { return w.SupportsFontColor; }
- }
-
- public override bool SupportsFontName {
- get { return w.SupportsFontName; }
- }
-
- public override bool SupportsFontSize {
- get { return w.SupportsFontSize; }
- }
-
- public override bool SupportsImageSubmit {
- get { return w.SupportsImageSubmit; }
- }
-
- public override bool SupportsIModeSymbols {
- get { return w.SupportsIModeSymbols; }
- }
-
- public override bool SupportsInputIStyle {
- get { return w.SupportsInputIStyle; }
- }
-
- public override bool SupportsInputMode {
- get { return w.SupportsInputMode; }
- }
-
- public override bool SupportsItalic {
- get { return w.SupportsItalic; }
- }
-
- public override bool SupportsJPhoneMultiMediaAttributes {
- get { return w.SupportsJPhoneMultiMediaAttributes; }
- }
-
- public override bool SupportsJPhoneSymbols {
- get { return w.SupportsJPhoneSymbols; }
- }
-
- public override bool SupportsQueryStringInFormAction {
- get { return w.SupportsQueryStringInFormAction; }
- }
-
- public override bool SupportsRedirectWithCookie {
- get { return w.SupportsRedirectWithCookie; }
- }
-
- public override bool SupportsSelectMultiple {
- get { return w.SupportsSelectMultiple; }
- }
-
- public override bool SupportsUncheck {
- get { return w.SupportsUncheck; }
- }
-
- public override bool SupportsXmlHttp {
- get { return w.SupportsXmlHttp; }
- }
-
- public override bool Tables {
- get { return w.Tables; }
- }
-
- public override Type TagWriter {
- get { return w.TagWriter; }
- }
-
- public override string Type {
- get { return w.Type; }
- }
-
- public override bool UseOptimizedCacheKey {
- get { return w.UseOptimizedCacheKey; }
- }
-
- public override bool VBScript {
- get { return w.VBScript; }
- }
-
- public override string Version {
- get { return w.Version; }
- }
-
- public override Version W3CDomVersion {
- get { return w.W3CDomVersion; }
- }
-
- public override bool Win16 {
- get { return w.Win16; }
- }
-
- public override bool Win32 {
- get { return w.Win32; }
- }
-
- public override void AddBrowser (string browserName)
- {
- w.AddBrowser (browserName);
- }
-
- [MonoTODO]
- public override int CompareFilters (string filter1, string filter2)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override HtmlTextWriter CreateHtmlTextWriter (TextWriter w)
- {
- throw new NotImplementedException ();
- }
-
- public override void DisableOptimizedCacheKey ()
- {
- w.DisableOptimizedCacheKey ();
- }
-
- [MonoTODO]
- public override bool EvaluateFilter (string filterName)
- {
- throw new NotImplementedException ();
- }
-
- public override Version [] GetClrVersions ()
- {
- return w.GetClrVersions ();
- }
-
- public override bool IsBrowser (string browserName)
- {
- return w.IsBrowser (browserName);
- }
- }
-}
+++ /dev/null
-//
-// HttpCachePolicyBase.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public abstract class HttpCachePolicyBase
- {
- void NotImplemented ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual HttpCacheVaryByContentEncodings VaryByContentEncodings { get { NotImplemented (); return null; } }
-
- public virtual HttpCacheVaryByHeaders VaryByHeaders { get { NotImplemented (); return null; } }
-
- public virtual HttpCacheVaryByParams VaryByParams { get { NotImplemented (); return null; } }
-
- public virtual void AddValidationCallback (HttpCacheValidateHandler handler, object data)
- {
- NotImplemented ();
- }
-
- public virtual void AppendCacheExtension (string extension)
- {
- NotImplemented ();
- }
-
- public virtual void SetAllowResponseInBrowserHistory (bool allow)
- {
- NotImplemented ();
- }
-
- public virtual void SetCacheability (HttpCacheability cacheability)
- {
- NotImplemented ();
- }
-
- public virtual void SetCacheability (HttpCacheability cacheability, string field)
- {
- NotImplemented ();
- }
-
- public virtual void SetETag (string etag)
- {
- NotImplemented ();
- }
-
- public virtual void SetETagFromFileDependencies ()
- {
- NotImplemented ();
- }
-
- public virtual void SetExpires (DateTime date)
- {
- NotImplemented ();
- }
-
- public virtual void SetLastModified (DateTime date)
- {
- NotImplemented ();
- }
-
- public virtual void SetLastModifiedFromFileDependencies ()
- {
- NotImplemented ();
- }
-
- public virtual void SetMaxAge (TimeSpan delta)
- {
- NotImplemented ();
- }
-
- public virtual void SetNoServerCaching ()
- {
- NotImplemented ();
- }
-
- public virtual void SetNoStore ()
- {
- NotImplemented ();
- }
-
- public virtual void SetNoTransforms ()
- {
- NotImplemented ();
- }
-
- public virtual void SetOmitVaryStar (bool omit)
- {
- NotImplemented ();
- }
-
- public virtual void SetProxyMaxAge (TimeSpan delta)
- {
- NotImplemented ();
- }
-
- public virtual void SetRevalidation (HttpCacheRevalidation revalidation)
- {
- NotImplemented ();
- }
-
- public virtual void SetSlidingExpiration (bool slide)
- {
- NotImplemented ();
- }
-
- public virtual void SetValidUntilExpires (bool validUntilExpires)
- {
- NotImplemented ();
- }
-
- public virtual void SetVaryByCustom (string custom)
- {
- NotImplemented ();
- }
- }
-}
+++ /dev/null
-//
-// HttpCachePolicyWrapper.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class HttpCachePolicyWrapper : HttpCachePolicyBase
- {
- HttpCachePolicy w;
-
- public HttpCachePolicyWrapper (HttpCachePolicy httpCachePolicy)
- {
- if (httpCachePolicy == null)
- throw new ArgumentNullException ("httpCachePolicy");
- w = httpCachePolicy;
- }
-
- public override HttpCacheVaryByContentEncodings VaryByContentEncodings {
- get { return w.VaryByContentEncodings; }
- }
-
- public override HttpCacheVaryByHeaders VaryByHeaders {
- get { return w.VaryByHeaders; }
- }
-
- public override HttpCacheVaryByParams VaryByParams {
- get { return w.VaryByParams; }
- }
-
- public override void AddValidationCallback (HttpCacheValidateHandler handler, object data)
- {
- w.AddValidationCallback (handler, data);
- }
-
- public override void AppendCacheExtension (string extension)
- {
- w.AppendCacheExtension (extension);
- }
-
- public override void SetAllowResponseInBrowserHistory (bool allow)
- {
- w.SetAllowResponseInBrowserHistory (allow);
- }
-
- public override void SetCacheability (HttpCacheability cacheability)
- {
- w.SetCacheability (cacheability);
- }
-
- public override void SetCacheability (HttpCacheability cacheability, string field)
- {
- w.SetCacheability (cacheability, field);
- }
-
- public override void SetVaryByCustom (string custom)
- {
- w.SetVaryByCustom (custom);
- }
-
- public override void SetETag (string etag)
- {
- w.SetETag (etag);
- }
-
- public override void SetETagFromFileDependencies ()
- {
- w.SetETagFromFileDependencies ();
- }
-
- public override void SetExpires (DateTime date)
- {
- w.SetExpires (date);
- }
-
- public override void SetLastModified (DateTime date)
- {
- w.SetLastModified (date);
- }
-
- public override void SetLastModifiedFromFileDependencies ()
- {
- w.SetLastModifiedFromFileDependencies ();
- }
-
- public override void SetMaxAge (TimeSpan delta)
- {
- w.SetMaxAge (delta);
- }
-
- public override void SetNoServerCaching ()
- {
- w.SetNoServerCaching ();
- }
-
- public override void SetNoStore ()
- {
- w.SetNoStore ();
- }
-
- public override void SetNoTransforms ()
- {
- w.SetNoTransforms ();
- }
-
- public override void SetOmitVaryStar (bool omit)
- {
- w.SetOmitVaryStar (omit);
- }
-
- public override void SetProxyMaxAge (TimeSpan delta)
- {
- w.SetProxyMaxAge (delta);
- }
-
- public override void SetRevalidation (HttpCacheRevalidation revalidation)
- {
- w.SetRevalidation (revalidation);
- }
-
- public override void SetSlidingExpiration (bool slide)
- {
- w.SetSlidingExpiration (slide);
- }
-
- public override void SetValidUntilExpires (bool validUntilExpires)
- {
- w.SetValidUntilExpires (validUntilExpires);
- }
- }
-}
+++ /dev/null
-//
-// HttpContextBase.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-using System.Web.Profile;
-using System.Web.SessionState;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public abstract class HttpContextBase : IServiceProvider
- {
- void NotImplemented ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual Exception [] AllErrors { get { NotImplemented (); return null; } }
-
- public virtual HttpApplicationStateBase Application { get { NotImplemented (); return null; } }
-
- public virtual HttpApplication ApplicationInstance { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual Cache Cache { get { NotImplemented (); return null; } }
-
- public virtual IHttpHandler CurrentHandler { get { NotImplemented (); return null; } }
-
- public virtual RequestNotification CurrentNotification { get { NotImplemented (); return default (RequestNotification); } }
-
- public virtual Exception Error { get { NotImplemented (); return null; } }
-
- public virtual IHttpHandler Handler { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual bool IsCustomErrorEnabled { get { NotImplemented (); return false; } }
-
- public virtual bool IsDebuggingEnabled { get { NotImplemented (); return false; } }
-
- public virtual bool IsPostNotification { get { NotImplemented (); return false; } }
-
- public virtual IDictionary Items { get { NotImplemented (); return null; } }
-
- public virtual IHttpHandler PreviousHandler { get { NotImplemented (); return null; } }
-
- public virtual ProfileBase Profile { get { NotImplemented (); return null; } }
-
- public virtual HttpRequestBase Request { get { NotImplemented (); return null; } }
-
- public virtual HttpResponseBase Response { get { NotImplemented (); return null; } }
-
- public virtual HttpServerUtilityBase Server { get { NotImplemented (); return null; } }
-
- public virtual HttpSessionStateBase Session { get { NotImplemented (); return null; } }
-
- public virtual bool SkipAuthorization { get { NotImplemented (); return false; } set { NotImplemented (); } }
-
- public virtual DateTime Timestamp { get { NotImplemented (); return DateTime.MinValue; } }
-
- public virtual TraceContext Trace { get { NotImplemented (); return null; } }
-
- public virtual IPrincipal User { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual void AddError (Exception errorInfo)
- {
- NotImplemented ();
- }
-
- public virtual void ClearError ()
- {
- NotImplemented ();
- }
-
- public virtual object GetGlobalResourceObject (string classKey, string resourceKey)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual object GetGlobalResourceObject (string classKey, string resourceKey, CultureInfo culture)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual object GetLocalResourceObject (string virtualPath, string resourceKey)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual object GetLocalResourceObject (string virtualPath, string resourceKey, CultureInfo culture)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual object GetSection (string sectionName)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual object GetService (Type serviceType)
- {
- NotImplemented ();
- return null;
- }
- public virtual void RemapHandler (IHttpHandler handler)
- {
- NotImplemented ();
- }
- public virtual void RewritePath (string path)
- {
- NotImplemented ();
- }
-
- public virtual void RewritePath (string path, bool rebaseClientPath)
- {
- NotImplemented ();
- }
-
- public virtual void RewritePath (string filePath, string pathInfo, string queryString)
- {
- NotImplemented ();
- }
-
- public virtual void RewritePath (string filePath, string pathInfo, string queryString, bool setClientFilePath)
- {
- NotImplemented ();
- }
- public virtual void SetSessionStateBehavior (SessionStateBehavior sessionStateBehavior)
- {
- NotImplemented ();
- }
- }
-}
+++ /dev/null
-//
-// HttpContextWrapper.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008-2010 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-using System.Web.Profile;
-using System.Web.SessionState;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class HttpContextWrapper : HttpContextBase
- {
- HttpContext w;
-
- public HttpContextWrapper (HttpContext httpContext)
- {
- if (httpContext == null)
- throw new ArgumentNullException ("httpContext");
- w = httpContext;
- }
-
- public override Exception [] AllErrors {
- get { return w.AllErrors; }
- }
-
- public override HttpApplicationStateBase Application {
- get { return new HttpApplicationStateWrapper (w.Application); }
- }
-
- public override HttpApplication ApplicationInstance {
- get { return w.ApplicationInstance; }
- set { w.ApplicationInstance = value; }
- }
-
- public override Cache Cache {
- get { return w.Cache; }
- }
-
- public override IHttpHandler CurrentHandler {
- get { return w.CurrentHandler; }
- }
-
- public override RequestNotification CurrentNotification {
- get { return w.CurrentNotification; }
- }
-
- public override Exception Error {
- get { return w.Error; }
- }
-
- public override IHttpHandler Handler {
- get { return w.Handler; }
- set { w.Handler = value; }
- }
-
- public override bool IsCustomErrorEnabled {
- get { return w.IsCustomErrorEnabled; }
- }
-
- public override bool IsDebuggingEnabled {
- get { return w.IsDebuggingEnabled; }
- }
-
- public override bool IsPostNotification {
- get { return w.IsPostNotification; }
- }
-
- public override IDictionary Items {
- get { return w.Items; }
- }
-
- public override IHttpHandler PreviousHandler {
- get { return w.PreviousHandler; }
- }
-
- public override ProfileBase Profile {
- get { return w.Profile; }
- }
-
- public override HttpRequestBase Request {
- get { return new HttpRequestWrapper (w.Request); }
- }
-
- public override HttpResponseBase Response {
- get { return new HttpResponseWrapper (w.Response); }
- }
-
- public override HttpServerUtilityBase Server {
- get { return new HttpServerUtilityWrapper (w.Server); }
- }
-
- public override HttpSessionStateBase Session {
- get { return w.Session == null ? null : new HttpSessionStateWrapper (w.Session); }
- }
-
- public override bool SkipAuthorization {
- get { return w.SkipAuthorization; }
- set { w.SkipAuthorization = value; }
- }
-
- public override DateTime Timestamp {
- get { return w.Timestamp; }
- }
-
- public override TraceContext Trace {
- get { return w.Trace; }
- }
-
- public override IPrincipal User {
- get { return w.User; }
- set { w.User = value; }
- }
-
- public override void AddError (Exception errorInfo)
- {
- w.AddError (errorInfo);
- }
-
- public override void ClearError ()
- {
- w.ClearError ();
- }
-
- public override object GetGlobalResourceObject (string classKey, string resourceKey)
- {
- return HttpContext.GetGlobalResourceObject (classKey, resourceKey);
- }
-
- public override object GetGlobalResourceObject (string classKey, string resourceKey, CultureInfo culture)
- {
- return HttpContext.GetGlobalResourceObject (classKey, resourceKey, culture);
- }
-
- public override object GetLocalResourceObject (string overridePath, string resourceKey)
- {
- return HttpContext.GetLocalResourceObject (overridePath, resourceKey);
- }
-
- public override object GetLocalResourceObject (string overridePath, string resourceKey, CultureInfo culture)
- {
- return HttpContext.GetLocalResourceObject (overridePath, resourceKey, culture);
- }
-
- public override object GetSection (string sectionName)
- {
- return w.GetSection (sectionName);
- }
-
- public override object GetService (Type serviceType)
- {
- return ((IServiceProvider)w).GetService (serviceType);
- }
- public override void RemapHandler (IHttpHandler handler)
- {
- w.RemapHandler (handler);
- }
- public override void RewritePath (string path)
- {
- w.RewritePath (path);
- }
-
- public override void RewritePath (string path, bool rebaseClientPath)
- {
- w.RewritePath (path, rebaseClientPath);
- }
-
- public override void RewritePath (string filePath, string pathInfo, string queryString)
- {
- w.RewritePath (filePath, pathInfo, queryString);
- }
-
- public override void RewritePath (string filePath, string pathInfo, string queryString, bool setClientFilePath)
- {
- w.RewritePath (filePath, pathInfo, queryString, setClientFilePath);
- }
- public override void SetSessionStateBehavior (SessionStateBehavior sessionStateBehavior)
- {
- w.SetSessionStateBehavior (sessionStateBehavior);
- }
- }
-}
+++ /dev/null
-//
-// HttpFileCollectionBase.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public abstract class HttpFileCollectionBase : NameObjectCollectionBase, ICollection, IEnumerable
- {
- void NotImplemented ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual string [] AllKeys { get { NotImplemented (); return null; } }
-
- public override int Count {
- get { NotImplemented (); return 0; }
- }
-
- public virtual bool IsSynchronized { get { NotImplemented (); return false; } }
-
- public virtual HttpPostedFileBase this [int index] {
- get { return Get (index); }
- }
-
- public virtual HttpPostedFileBase this [string name] {
- get { return Get (name); }
- }
-
- public virtual object SyncRoot { get { NotImplemented (); return null; } }
-
- public virtual void CopyTo (Array dest, int index)
- {
- NotImplemented ();
- }
-
- public virtual HttpPostedFileBase Get (int index)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual HttpPostedFileBase Get (string name)
- {
- NotImplemented ();
- return null;
- }
-
- public override IEnumerator GetEnumerator ()
- {
- NotImplemented ();
- return null;
- }
-
- public virtual string GetKey (int index)
- {
- NotImplemented ();
- return null;
- }
- }
-}
+++ /dev/null
-//
-// HttpFileCollectionWrapper.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class HttpFileCollectionWrapper : HttpFileCollectionBase
- {
- HttpFileCollection w;
-
- public HttpFileCollectionWrapper (HttpFileCollection httpFileCollection)
- {
- if (httpFileCollection == null)
- throw new ArgumentNullException ("httpFileCollection");
- w = httpFileCollection;
- }
-
- public override string [] AllKeys {
- get { return w.AllKeys; }
- }
-
- public override int Count {
- get { return w.Count; }
- }
-
- public override bool IsSynchronized {
- get { return ((ICollection) w).IsSynchronized; }
- }
-
- public override HttpPostedFileBase this [int index] {
- get { return Get (index); }
- }
-
- public override HttpPostedFileBase this [string name] {
- get { return Get (name); }
- }
-
- public override NameObjectCollectionBase.KeysCollection Keys {
- get { return w.Keys; }
- }
-
- public override object SyncRoot {
- get { return ((ICollection) w).SyncRoot; }
- }
-
- public override void CopyTo (Array dest, int index)
- {
- w.CopyTo (dest, index);
- }
-
- public override HttpPostedFileBase Get (int index)
- {
- HttpPostedFile file = w.Get (index);
- if (file == null)
- return null;
-
- return new HttpPostedFileWrapper (file);
- }
-
- public override HttpPostedFileBase Get (string name)
- {
- HttpPostedFile file = w.Get (name);
- if (file == null)
- return null;
-
- return new HttpPostedFileWrapper (file);
- }
-
- public override IEnumerator GetEnumerator ()
- {
- return w.GetEnumerator ();
- }
-
- public override string GetKey (int index)
- {
- return w.GetKey (index);
- }
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- w.GetObjectData (info, context);
- }
-
- public override void OnDeserialization (object sender)
- {
- w.OnDeserialization (sender);
- }
- }
-}
+++ /dev/null
-//
-// HttpPostedFileBase.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.IO;
-using System.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public abstract class HttpPostedFileBase
- {
- void NotImplemented ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual int ContentLength { get { NotImplemented (); return 0; } }
-
- public virtual string ContentType { get { NotImplemented (); return null; } }
-
- public virtual string FileName { get { NotImplemented (); return null; } }
-
- public virtual Stream InputStream { get { NotImplemented (); return null; } }
-
- public virtual void SaveAs (string filename)
- {
- NotImplemented ();
- }
- }
-}
+++ /dev/null
-//
-// HttpPostedFileWrapper.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.IO;
-using System.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class HttpPostedFileWrapper : HttpPostedFileBase
- {
- HttpPostedFile w;
-
- public HttpPostedFileWrapper (HttpPostedFile httpPostedFile)
- {
- if (httpPostedFile == null)
- throw new ArgumentNullException ("httpPostedFile");
- w = httpPostedFile;
- }
-
- public override int ContentLength {
- get { return w.ContentLength; }
- }
-
- public override string ContentType {
- get { return w.ContentType; }
- }
-
- public override string FileName {
- get { return w.FileName; }
- }
-
- public override Stream InputStream {
- get { return w.InputStream; }
- }
-
- public override void SaveAs (string filename)
- {
- w.SaveAs (filename);
- }
- }
-}
+++ /dev/null
-//
-// HttpRequestBase.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
-using System.Globalization;
-using System.IO;
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Text;
-using System.Threading;
-using System.Web.Caching;
-
-using System.Security.Authentication.ExtendedProtection;
-using System.Web.Routing;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public abstract class HttpRequestBase
- {
- void NotImplemented ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual string [] AcceptTypes { get { NotImplemented (); return null; } }
-
- public virtual string AnonymousID { get { NotImplemented (); return null; } }
-
- public virtual string ApplicationPath { get { NotImplemented (); return null; } }
-
- public virtual string AppRelativeCurrentExecutionFilePath { get { NotImplemented (); return null; } }
-
- public virtual HttpBrowserCapabilitiesBase Browser { get { NotImplemented (); return null; } }
-
- public virtual HttpClientCertificate ClientCertificate { get { NotImplemented (); return null; } }
-
- public virtual Encoding ContentEncoding { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual int ContentLength { get { NotImplemented (); return 0; } }
-
- public virtual string ContentType { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual HttpCookieCollection Cookies { get { NotImplemented (); return null; } }
-
- public virtual string CurrentExecutionFilePath { get { NotImplemented (); return null; } }
-
- public virtual string CurrentExecutionFilePathExtension { get { NotImplemented (); return null; } }
-
- public virtual string FilePath { get { NotImplemented (); return null; } }
-
- public virtual HttpFileCollectionBase Files { get { NotImplemented (); return null; } }
-
- public virtual Stream Filter { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual NameValueCollection Form { get { NotImplemented (); return null; } }
-
- public virtual NameValueCollection Headers { get { NotImplemented (); return null; } }
-
- public virtual string HttpMethod { get { NotImplemented (); return null; } }
-
- public virtual Stream InputStream { get { NotImplemented (); return null; } }
- // LAMESPEC: MSDN says NotImplementedException is thrown only when the request is
- // not IIS7WorkerRequest or ISAPIWorkerRequestInProc, but it is thrown always.
- public virtual ChannelBinding HttpChannelBinding { get { NotImplemented (); return null; } }
- public virtual bool IsAuthenticated { get { NotImplemented (); return false; } }
-
- public virtual bool IsLocal { get { NotImplemented (); return false; } }
-
- public virtual bool IsSecureConnection { get { NotImplemented (); return false; } }
-
- public virtual string this [string key] {
- get { throw new NotImplementedException (); }
- }
-
- public virtual WindowsIdentity LogonUserIdentity { get { NotImplemented (); return null; } }
-
- public virtual NameValueCollection Params { get { NotImplemented (); return null; } }
-
- public virtual string Path { get { NotImplemented (); return null; } }
-
- public virtual string PathInfo { get { NotImplemented (); return null; } }
-
- public virtual string PhysicalApplicationPath { get { NotImplemented (); return null; } }
-
- public virtual string PhysicalPath { get { NotImplemented (); return null; } }
-
- public virtual NameValueCollection QueryString { get { NotImplemented (); return null; } }
-
- public virtual string RawUrl { get { NotImplemented (); return null; } }
-
- public virtual string RequestType { get { NotImplemented (); return null; } set { NotImplemented (); } }
- public virtual RequestContext RequestContext {
- get { NotImplemented (); return null; }
- internal set { NotImplemented (); }
- }
- public virtual NameValueCollection ServerVariables { get { NotImplemented (); return null; } }
-
- public virtual CancellationToken TimedOutToken { get { NotImplemented (); return default(CancellationToken); } }
-
- public virtual int TotalBytes { get { NotImplemented (); return 0; } }
-
- public virtual ReadEntityBodyMode ReadEntityBodyMode { get { NotImplemented(); return ReadEntityBodyMode.Classic; } }
-
- public virtual UnvalidatedRequestValuesBase Unvalidated { get { NotImplemented (); return null; } }
-
- public virtual Uri Url { get { NotImplemented (); return null; } }
-
- public virtual Uri UrlReferrer { get { NotImplemented (); return null; } }
-
- public virtual string UserAgent { get { NotImplemented (); return null; } }
-
- public virtual string UserHostAddress { get { NotImplemented (); return null; } }
-
- public virtual string UserHostName { get { NotImplemented (); return null; } }
-
- public virtual string [] UserLanguages { get { NotImplemented (); return null; } }
-
- public virtual void Abort ()
- {
- NotImplemented();
- }
-
- public virtual byte [] BinaryRead (int count)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual Stream GetBufferedInputStream ()
- {
- NotImplemented ();
- return null;
- }
-
- public virtual Stream GetBufferlessInputStream ()
- {
- NotImplemented ();
- return null;
- }
-
- public virtual Stream GetBufferlessInputStream (bool disableMaxRequestLength)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual void InsertEntityBody()
- {
- NotImplemented ();
- }
-
- public virtual void InsertEntityBody(byte[] buffer, int offset, int count)
- {
- NotImplemented ();
- }
-
- public virtual double [] MapRawImageCoordinates (string imageFieldName)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual int [] MapImageCoordinates (string imageFieldName)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual string MapPath (string virtualPath)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual string MapPath (string virtualPath, string baseVirtualDir, bool allowCrossAppMapping)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual void SaveAs (string filename, bool includeHeaders)
- {
- NotImplemented ();
- }
-
- public virtual void ValidateInput ()
- {
- NotImplemented ();
- }
- }
-}
+++ /dev/null
-//
-// HttpRequestWrapper.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
-using System.Globalization;
-using System.IO;
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Text;
-using System.Threading;
-using System.Web.Caching;
-
-using System.Security.Authentication.ExtendedProtection;
-using System.Web.Routing;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class HttpRequestWrapper : HttpRequestBase
- {
- HttpRequest w;
-
- public HttpRequestWrapper (HttpRequest httpRequest)
- {
- if (httpRequest == null)
- throw new ArgumentNullException ("httpRequest");
- w = httpRequest;
- }
-
- public override string [] AcceptTypes {
- get { return w.AcceptTypes; }
- }
-
- public override string AnonymousID {
- get { return w.AnonymousID; }
- }
-
- public override string ApplicationPath {
- get { return w.ApplicationPath; }
- }
-
- public override string AppRelativeCurrentExecutionFilePath {
- get { return w.AppRelativeCurrentExecutionFilePath; }
- }
-
- public override HttpBrowserCapabilitiesBase Browser {
- get { return new HttpBrowserCapabilitiesWrapper (w.Browser); }
- }
-
- public override HttpClientCertificate ClientCertificate {
- get { return w.ClientCertificate; }
- }
-
- public override Encoding ContentEncoding {
- get { return w.ContentEncoding; }
- set { w.ContentEncoding = value; }
- }
-
- public override int ContentLength {
- get { return w.ContentLength; }
- }
-
- public override string ContentType {
- get { return w.ContentType; }
- set { w.ContentType = value; }
- }
-
- public override HttpCookieCollection Cookies {
- get { return w.Cookies; }
- }
-
- public override string CurrentExecutionFilePath {
- get { return w.CurrentExecutionFilePath; }
- }
-
- public override string FilePath {
- get { return w.FilePath; }
- }
-
- public override HttpFileCollectionBase Files {
- get { return new HttpFileCollectionWrapper (w.Files); }
- }
-
- public override Stream Filter {
- get { return w.Filter; }
- set { w.Filter = value; }
- }
-
- public override NameValueCollection Form {
- get { return w.Form; }
- }
-
- public override NameValueCollection Headers {
- get { return w.Headers; }
- }
-
- public override Stream GetBufferedInputStream ()
- {
- return w.GetBufferedInputStream ();
- }
-
- public override Stream GetBufferlessInputStream ()
- {
- return w.GetBufferlessInputStream ();
- }
-
- public override Stream GetBufferlessInputStream (System.Boolean disableMaxRequestLength)
- {
- return w.GetBufferlessInputStream (disableMaxRequestLength);
- }
-
- public override string HttpMethod {
- get { return w.HttpMethod; }
- }
- public override ChannelBinding HttpChannelBinding {
- get { return w.HttpChannelBinding; }
- }
- public override Stream InputStream {
- get { return w.InputStream; }
- }
-
- public override bool IsAuthenticated {
- get { return w.IsAuthenticated; }
- }
-
- public override bool IsLocal {
- get { return w.IsLocal; }
- }
-
- public override bool IsSecureConnection {
- get { return w.IsSecureConnection; }
- }
-
- public override string this [string key] {
- get { return w [key]; }
- }
-
- public override WindowsIdentity LogonUserIdentity {
- get { return w.LogonUserIdentity; }
- }
-
- public override NameValueCollection Params {
- get { return w.Params; }
- }
-
- public override string Path {
- get { return w.Path; }
- }
-
- public override string PathInfo {
- get { return w.PathInfo; }
- }
-
- public override string PhysicalApplicationPath {
- get { return w.PhysicalApplicationPath; }
- }
-
- public override string PhysicalPath {
- get { return w.PhysicalPath; }
- }
-
- public override NameValueCollection QueryString {
- get { return w.QueryString; }
- }
-
- public override string RawUrl {
- get { return w.RawUrl; }
- }
-
- public override string RequestType {
- get { return w.RequestType; }
- set { w.RequestType = value; }
- }
- public override RequestContext RequestContext {
- get { return w.RequestContext; }
- internal set { w.RequestContext = value; }
- }
- public override NameValueCollection ServerVariables {
- get { return w.ServerVariables; }
- }
-
- public virtual CancellationToken TimedOutToken {
- get { return w.TimedOutToken; }
- }
-
- public override int TotalBytes {
- get { return w.TotalBytes; }
- }
-
- public override UnvalidatedRequestValuesBase Unvalidated {
- get { return new UnvalidatedRequestValuesWrapper (w.Unvalidated); }
- }
-
- public override ReadEntityBodyMode ReadEntityBodyMode {
- get { return ReadEntityBodyMode.Classic; }
- }
-
- public override Uri Url {
- get { return w.Url; }
- }
-
- public override Uri UrlReferrer {
- get { return w.UrlReferrer; }
- }
-
- public override string UserAgent {
- get { return w.UserAgent; }
- }
-
- public override string UserHostAddress {
- get { return w.UserHostAddress; }
- }
-
- public override string UserHostName {
- get { return w.UserHostName; }
- }
-
- public override string [] UserLanguages {
- get { return w.UserLanguages; }
- }
-
- public void Abort ()
- {
- w.WorkerRequest.CloseConnection();
- }
-
- public override byte [] BinaryRead (int count)
- {
- return w.BinaryRead (count);
- }
-
- public override int [] MapImageCoordinates (string imageFieldName)
- {
- return w.MapImageCoordinates (imageFieldName);
- }
-
- public override string MapPath (string virtualPath)
- {
- return w.MapPath (virtualPath);
- }
-
- public override string MapPath (string virtualPath, string baseVirtualDir, bool allowCrossAppMapping)
- {
- return w.MapPath (virtualPath, baseVirtualDir, allowCrossAppMapping);
- }
-
- public override double [] MapRawImageCoordinates (System.String imageFieldName)
- {
- return w.MapRawImageCoordinates (imageFieldName);
- }
-
- public override void SaveAs (string filename, bool includeHeaders)
- {
- w.SaveAs (filename, includeHeaders);
- }
-
- public override void ValidateInput ()
- {
- w.ValidateInput ();
- }
- }
-}
+++ /dev/null
-//
-// HttpResponseBase.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
-using System.Globalization;
-using System.IO;
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Text;
-using System.Web.Caching;
-using System.Threading;
-
-using System.Web.Routing;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public abstract class HttpResponseBase
- {
- void NotImplemented ()
- {
- throw new NotImplementedException ();
- }
-
-
- public virtual bool Buffer { get { NotImplemented (); return false; } set { NotImplemented (); } }
-
- public virtual bool BufferOutput { get { NotImplemented (); return false; } set { NotImplemented (); } }
-
- public virtual HttpCachePolicyBase Cache { get { NotImplemented (); return null; } }
-
- public virtual string CacheControl { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual string Charset { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual CancellationToken ClientDisconnectedToken { get { NotImplemented (); return CancellationToken.None; } }
-
- public virtual Encoding ContentEncoding { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual string ContentType { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual HttpCookieCollection Cookies { get { NotImplemented (); return null; } }
-
- public virtual int Expires { get { NotImplemented (); return 0; } set { NotImplemented (); } }
-
- public virtual DateTime ExpiresAbsolute { get { NotImplemented (); return DateTime.MinValue; } set { NotImplemented (); } }
-
- public virtual Stream Filter { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual Encoding HeaderEncoding { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual NameValueCollection Headers { get { NotImplemented (); return null; } }
-
- public virtual bool IsClientConnected { get { NotImplemented (); return false; } }
-
- public virtual bool IsRequestBeingRedirected { get { NotImplemented (); return false; } }
-
- public virtual TextWriter Output { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual Stream OutputStream { get { NotImplemented (); return null; } }
-
- public virtual string RedirectLocation { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual string Status { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual int StatusCode { get { NotImplemented (); return 0; } set { NotImplemented (); } }
-
- public virtual string StatusDescription { get { NotImplemented (); return null; } set { NotImplemented (); } }
-
- public virtual int SubStatusCode { get { NotImplemented (); return 0; } set { NotImplemented (); } }
-
- public virtual bool SuppressContent { get { NotImplemented (); return false; } set { NotImplemented (); } }
-
- public virtual bool SuppressFormsAuthenticationRedirect { get { NotImplemented (); return false; } set { NotImplemented (); } }
-
- public virtual bool TrySkipIisCustomErrors { get { NotImplemented (); return false; } set { NotImplemented (); } }
-
-
- public virtual void AddCacheDependency (params CacheDependency [] dependencies)
- {
- NotImplemented ();
- }
-
-
- public virtual void AddCacheItemDependencies (ArrayList cacheKeys)
- {
- NotImplemented ();
- }
-
-
- public virtual void AddCacheItemDependencies (string [] cacheKeys)
- {
- NotImplemented ();
- }
-
-
- public virtual void AddCacheItemDependency (string cacheKey)
- {
- NotImplemented ();
- }
-
-
- public virtual void AddFileDependencies (ArrayList filenames)
- {
- NotImplemented ();
- }
-
-
- public virtual void AddFileDependencies (string [] filenames)
- {
- NotImplemented ();
- }
-
-
- public virtual void AddFileDependency (string filename)
- {
- NotImplemented ();
- }
-
-
- public virtual void AddHeader (string name, string value)
- {
- NotImplemented ();
- }
-
-
- public virtual void AppendCookie (HttpCookie cookie)
- {
- NotImplemented ();
- }
-
-
- public virtual void AppendHeader (string name, string value)
- {
- NotImplemented ();
- }
-
-
- public virtual void AppendToLog (string param)
- {
- NotImplemented ();
- }
-
-
- public virtual string ApplyAppPathModifier (string virtualPath)
- {
- NotImplemented ();
- return null;
- }
-
-
- public virtual void BinaryWrite (byte [] buffer)
- {
- NotImplemented ();
- }
-
-
- public virtual void Clear ()
- {
- NotImplemented ();
- }
-
-
- public virtual void ClearContent ()
- {
- NotImplemented ();
- }
-
-
- public virtual void ClearHeaders ()
- {
- NotImplemented ();
- }
-
-
- public virtual void Close ()
- {
- NotImplemented ();
- }
-
-
- public virtual void DisableKernelCache ()
- {
- NotImplemented ();
- }
-
-
- public virtual void End ()
- {
- NotImplemented ();
- }
-
-
- public virtual void Flush ()
- {
- NotImplemented ();
- }
-
-
- public virtual void Pics (string value)
- {
- NotImplemented ();
- }
-
-
- public virtual void Redirect (string url)
- {
- NotImplemented ();
- }
-
-
- public virtual void Redirect (string url, bool endResponse)
- {
- NotImplemented ();
- }
- public virtual void RedirectPermanent (string url)
- {
- NotImplemented ();
- }
-
- public virtual void RedirectPermanent (string url, bool endResponse)
- {
- NotImplemented ();
- }
-
- public virtual void RedirectToRoute (object routeValues)
- {
- NotImplemented ();
- }
-
- public virtual void RedirectToRoute (RouteValueDictionary routeValues)
- {
- NotImplemented ();
- }
-
- public virtual void RedirectToRoute (string routeName)
- {
- NotImplemented ();
- }
-
- public virtual void RedirectToRoute (string routeName, object routeValues)
- {
- NotImplemented ();
- }
-
- public virtual void RedirectToRoute (string routeName, RouteValueDictionary routeValues)
- {
- NotImplemented ();
- }
-
- public virtual void RedirectToRoutePermanent (object routeValues)
- {
- NotImplemented ();
- }
-
- public virtual void RedirectToRoutePermanent (RouteValueDictionary routeValues)
- {
- NotImplemented ();
- }
-
- public virtual void RedirectToRoutePermanent (string routeName)
- {
- NotImplemented ();
- }
-
- public virtual void RedirectToRoutePermanent (string routeName, object routeValues)
- {
- NotImplemented ();
- }
-
- public virtual void RedirectToRoutePermanent (string routeName, RouteValueDictionary routeValues)
- {
- NotImplemented ();
- }
-
- public virtual void RemoveOutputCacheItem (string path, string providerName)
- {
- NotImplemented ();
- }
- public virtual void RemoveOutputCacheItem (string path)
- {
- NotImplemented ();
- }
-
-
- public virtual void SetCookie (HttpCookie cookie)
- {
- NotImplemented ();
- }
-
-
- public virtual void TransmitFile (string filename)
- {
- NotImplemented ();
- }
-
-
- public virtual void TransmitFile (string filename, long offset, long length)
- {
- NotImplemented ();
- }
-
-
- public virtual void Write (char ch)
- {
- NotImplemented ();
- }
-
-
- public virtual void Write (object obj)
- {
- NotImplemented ();
- }
-
-
- public virtual void Write (string s)
- {
- NotImplemented ();
- }
-
-
- public virtual void Write (char [] buffer, int index, int count)
- {
- NotImplemented ();
- }
-
-
- public virtual void WriteFile (string filename)
- {
- NotImplemented ();
- }
-
-
- public virtual void WriteFile (string filename, bool readIntoMemory)
- {
- NotImplemented ();
- }
-
-
- public virtual void WriteFile (IntPtr fileHandle, long offset, long size)
- {
- NotImplemented ();
- }
-
-
- public virtual void WriteFile (string filename, long offset, long size)
- {
- NotImplemented ();
- }
-
-
- public virtual void WriteSubstitution (HttpResponseSubstitutionCallback callback)
- {
- NotImplemented ();
- }
- }
-}
+++ /dev/null
-//
-// HttpResponseWrapper.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
-using System.Globalization;
-using System.IO;
-using System.Runtime.CompilerServices;
-using System.Runtime.Serialization;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Text;
-using System.Web.Caching;
-using System.Threading;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class HttpResponseWrapper : HttpResponseBase
- {
- HttpResponse w;
-
- public HttpResponseWrapper (HttpResponse httpResponse)
- {
- if (httpResponse == null)
- throw new ArgumentNullException ("httpResponse");
- w = httpResponse;
- }
-
- public override bool Buffer {
- get { return w.Buffer; }
- set { w.Buffer = value; }
- }
-
- public override bool BufferOutput {
- get { return w.BufferOutput; }
- set { w.BufferOutput = value; }
- }
-
- public override HttpCachePolicyBase Cache {
- get { return new HttpCachePolicyWrapper (w.Cache); }
- }
-
- public override string CacheControl {
- get { return w.CacheControl; }
- set { w.CacheControl = value; }
- }
-
- public override string Charset {
- get { return w.Charset; }
- set { w.Charset = value; }
- }
-
- public override CancellationToken ClientDisconnectedToken {
- get { return CancellationToken.None; }
- }
-
- public override Encoding ContentEncoding {
- get { return w.ContentEncoding; }
- set { w.ContentEncoding = value; }
- }
-
- public override string ContentType {
- get { return w.ContentType; }
- set { w.ContentType = value; }
- }
-
- public override HttpCookieCollection Cookies {
- get { return w.Cookies; }
- }
-
- public override int Expires {
- get { return w.Expires; }
- set { w.Expires = value; }
- }
-
- public override DateTime ExpiresAbsolute {
- get { return w.ExpiresAbsolute; }
- set { w.ExpiresAbsolute = value; }
- }
-
- public override Stream Filter {
- get { return w.Filter; }
- set { w.Filter = value; }
- }
-
- public override Encoding HeaderEncoding {
- get { return w.HeaderEncoding; }
- set { w.HeaderEncoding = value; }
- }
-
- public override NameValueCollection Headers {
- get { return w.Headers; }
- }
-
- public override bool IsClientConnected {
- get { return w.IsClientConnected; }
- }
-
- public override bool IsRequestBeingRedirected {
- get { return w.IsRequestBeingRedirected; }
- }
-
- public override TextWriter Output {
- get { return w.Output; }
- set { w.Output = value; }
- }
-
- public override Stream OutputStream {
- get { return w.OutputStream; }
- }
-
- public override string RedirectLocation {
- get { return w.RedirectLocation; }
- set { w.RedirectLocation = value; }
- }
-
- public override string Status {
- get { return w.Status; }
- set { w.Status = value; }
- }
-
- public override int StatusCode {
- get { return w.StatusCode; }
- set { w.StatusCode = value; }
- }
-
- public override string StatusDescription {
- get { return w.StatusDescription; }
- set { w.StatusDescription = value; }
- }
-
- public override int SubStatusCode {
- get { return w.SubStatusCode; }
- set { w.SubStatusCode = value; }
- }
-
- public override bool SuppressContent {
- get { return w.SuppressContent; }
- set { w.SuppressContent = value; }
- }
-
- public override bool SuppressFormsAuthenticationRedirect {
- get { return w.SuppressFormsAuthenticationRedirect; }
- set { w.SuppressFormsAuthenticationRedirect = value; }
- }
-
- public override bool TrySkipIisCustomErrors {
- get { return w.TrySkipIisCustomErrors; }
- set { w.TrySkipIisCustomErrors = value; }
- }
-
- public override void AddCacheDependency (params CacheDependency [] dependencies)
- {
- w.AddCacheDependency (dependencies);
- }
-
- public override void AddCacheItemDependencies (ArrayList cacheKeys)
- {
- w.AddCacheItemDependencies (cacheKeys);
- }
-
- public override void AddCacheItemDependencies (string [] cacheKeys)
- {
- w.AddCacheItemDependencies (cacheKeys);
- }
-
- public override void AddCacheItemDependency (string cacheKey)
- {
- w.AddCacheItemDependency (cacheKey);
- }
-
- public override void AddFileDependencies (ArrayList filenames)
- {
- w.AddFileDependencies (filenames);
- }
-
- public override void AddFileDependencies (string [] filenames)
- {
- w.AddFileDependencies (filenames);
- }
-
- public override void AddFileDependency (string filename)
- {
- w.AddFileDependency (filename);
- }
-
- public override void AddHeader (string name, string value)
- {
- w.AddHeader (name, value);
- }
-
- public override void AppendCookie (HttpCookie cookie)
- {
- w.AppendCookie (cookie);
- }
-
- public override void AppendHeader (string name, string value)
- {
- w.AppendHeader (name, value);
- }
-
- public override void AppendToLog (string param)
- {
- w.AppendToLog (param);
- }
-
- public override string ApplyAppPathModifier (string overridePath)
- {
- return w.ApplyAppPathModifier (overridePath);
- }
-
- public override void BinaryWrite (byte [] buffer)
- {
- w.BinaryWrite (buffer);
- }
-
- public override void Clear ()
- {
- w.Clear ();
- }
-
- public override void ClearContent ()
- {
- w.ClearContent ();
- }
-
- public override void ClearHeaders ()
- {
- w.ClearHeaders ();
- }
-
- public override void Close ()
- {
- w.Close ();
- }
-
- public override void DisableKernelCache ()
- {
- w.DisableKernelCache ();
- }
-
- public override void End ()
- {
- w.End ();
- }
-
- public override void Flush ()
- {
- w.Flush ();
- }
-
- public override void Pics (string value)
- {
- w.Pics (value);
- }
-
- public override void Redirect (string url)
- {
- w.Redirect (url);
- }
-
- public override void Redirect (string url, bool endResponse)
- {
- w.Redirect (url, endResponse);
- }
- public override void RedirectPermanent (string url)
- {
- w.RedirectPermanent (url);
- }
-
- public override void RedirectPermanent (string url, bool endResponse)
- {
- w.RedirectPermanent (url, endResponse);
- }
-
- public override void RemoveOutputCacheItem (string path, string providerName)
- {
- HttpResponse.RemoveOutputCacheItem (path, providerName);
- }
- public override void RemoveOutputCacheItem (string path)
- {
- HttpResponse.RemoveOutputCacheItem (path);
- }
-
- public override void SetCookie (HttpCookie cookie)
- {
- w.SetCookie (cookie);
- }
-
- public override void TransmitFile (string filename)
- {
- w.TransmitFile (filename);
- }
-
- public override void TransmitFile (string filename, long offset, long length)
- {
- w.TransmitFile (filename, offset, length);
- }
-
- public override void Write (char ch)
- {
- w.Write (ch);
- }
-
- public override void Write (object obj)
- {
- w.Write (obj);
- }
-
- public override void Write (string s)
- {
- w.Write (s);
- }
-
- public override void Write (char [] buffer, int index, int count)
- {
- w.Write (buffer, index, count);
- }
-
- public override void WriteFile (string filename)
- {
- w.WriteFile (filename);
- }
-
- public override void WriteFile (string filename, bool readIntoMemory)
- {
- w.WriteFile (filename, readIntoMemory);
- }
-
- public override void WriteFile (IntPtr fileHandle, long offset, long size)
- {
- w.WriteFile (fileHandle, offset, size);
- }
-
- public override void WriteFile (string filename, long offset, long size)
- {
- w.WriteFile (filename, offset, size);
- }
-
- public override void WriteSubstitution (HttpResponseSubstitutionCallback callback)
- {
- w.WriteSubstitution (callback);
- }
- }
-}
+++ /dev/null
-//
-// HttpServerUtilityBase.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
-using System.Globalization;
-using System.IO;
-using System.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-using System.Web.Profile;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public abstract class HttpServerUtilityBase
- {
- void NotImplemented ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual string MachineName { get { NotImplemented (); return null; } }
-
- public virtual int ScriptTimeout { get { NotImplemented (); return 0; } set { NotImplemented (); } }
-
-
- public virtual void ClearError ()
- {
- NotImplemented ();
- }
-
- public virtual object CreateObject (string progID)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual object CreateObject (Type type)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual object CreateObjectFromClsid (string clsid)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual void Execute (string path)
- {
- NotImplemented ();
- }
-
- public virtual void Execute (string path, bool preserveForm)
- {
- NotImplemented ();
- }
-
- public virtual void Execute (string path, TextWriter writer)
- {
- NotImplemented ();
- }
-
- public virtual void Execute (string path, TextWriter writer, bool preserveForm)
- {
- NotImplemented ();
- }
-
- public virtual void Execute (IHttpHandler handler, TextWriter writer, bool preserveForm)
- {
- NotImplemented ();
- }
-
- public virtual Exception GetLastError ()
- {
- NotImplemented ();
- return null;
- }
-
- public virtual string HtmlDecode (string s)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual void HtmlDecode (string s, TextWriter output)
- {
- NotImplemented ();
- }
-
- public virtual string HtmlEncode (string s)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual void HtmlEncode (string s, TextWriter output)
- {
- NotImplemented ();
- }
-
- public virtual string MapPath (string path)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual void Transfer (string path)
- {
- NotImplemented ();
- }
-
- public virtual void Transfer (string path, bool preserveForm)
- {
- NotImplemented ();
- }
-
- public virtual void Transfer (IHttpHandler handler, bool preserveForm)
- {
- NotImplemented ();
- }
-
- public virtual void TransferRequest (string path)
- {
- NotImplemented ();
- }
-
- public virtual void TransferRequest (string path, bool preserveForm)
- {
- NotImplemented ();
- }
-
- public virtual void TransferRequest (string path, bool preserveForm, string method, NameValueCollection headers)
- {
- NotImplemented ();
- }
-
- public virtual string UrlDecode (string s)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual void UrlDecode (string s, TextWriter output)
- {
- NotImplemented ();
- }
-
- public virtual string UrlEncode (string s)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual void UrlEncode (string s, TextWriter output)
- {
- NotImplemented ();
- }
-
- public virtual string UrlPathEncode (string s)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual byte [] UrlTokenDecode (string input)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual string UrlTokenEncode (byte [] input)
- {
- NotImplemented ();
- return null;
- }
- }
-}
+++ /dev/null
-//
-// HttpServerUtilityWrapper.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
-using System.Globalization;
-using System.IO;
-using System.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-using System.Web.Profile;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class HttpServerUtilityWrapper : HttpServerUtilityBase
- {
- HttpServerUtility w;
-
- public HttpServerUtilityWrapper (HttpServerUtility httpServerUtility)
- {
- if (httpServerUtility == null)
- throw new ArgumentNullException ("httpServerUtility");
- w = httpServerUtility;
- }
-
- public override string MachineName {
- get { return w.MachineName; }
- }
-
- public override int ScriptTimeout {
- get { return w.ScriptTimeout; }
- set { w.ScriptTimeout = value; }
- }
-
- public override void ClearError ()
- {
- w.ClearError ();
- }
-
- public override object CreateObject (string progID)
- {
- return w.CreateObject (progID);
- }
-
- public override object CreateObject (Type type)
- {
- return w.CreateObject (type);
- }
-
- public override object CreateObjectFromClsid (string clsid)
- {
- return w.CreateObjectFromClsid (clsid);
- }
-
- public override void Execute (string path)
- {
- w.Execute (path);
- }
-
- public override void Execute (string path, bool preserveForm)
- {
- w.Execute (path, preserveForm);
- }
-
- public override void Execute (string path, TextWriter writer)
- {
- w.Execute (path, writer);
- }
-
- public override void Execute (string path, TextWriter writer, bool preserveForm)
- {
- w.Execute (path, writer, preserveForm);
- }
-
- public override void Execute (IHttpHandler handler, TextWriter writer, bool preserveForm)
- {
- w.Execute (handler, writer, preserveForm);
- }
-
- public override Exception GetLastError ()
- {
- return w.GetLastError ();
- }
-
- public override string HtmlDecode (string s)
- {
- return w.HtmlDecode (s);
- }
-
- public override void HtmlDecode (string s, TextWriter output)
- {
- w.HtmlDecode (s, output);
- }
-
- public override string HtmlEncode (string s)
- {
- return w.HtmlEncode (s);
- }
-
- public override void HtmlEncode (string s, TextWriter output)
- {
- w.HtmlEncode (s, output);
- }
-
- public override string MapPath (string path)
- {
- return w.MapPath (path);
- }
-
- public override void Transfer (string path)
- {
- w.Transfer (path);
- }
-
- public override void Transfer (string path, bool preserveForm)
- {
- w.Transfer (path, preserveForm);
- }
-
- public override void Transfer (IHttpHandler handler, bool preserveForm)
- {
- w.Transfer (handler, preserveForm);
- }
-
- [MonoTODO]
- public override void TransferRequest (string path)
- {
- // return TransferRequest (path);
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void TransferRequest (string path, bool preserveForm)
- {
- // return TransferRequest (path, preserveForm);
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void TransferRequest (string path, bool preserveForm, string method, NameValueCollection headers)
- {
- // return TransferRequest (path, preserveForm, method, headers);
- throw new NotImplementedException ();
- }
-
- public override string UrlDecode (string s)
- {
- return w.UrlDecode (s);
- }
-
- public override void UrlDecode (string s, TextWriter output)
- {
- w.UrlDecode (s, output);
- }
-
- public override string UrlEncode (string s)
- {
- return w.UrlEncode (s);
- }
-
- public override void UrlEncode (string s, TextWriter output)
- {
- w.UrlEncode (s, output);
- }
-
- public override string UrlPathEncode (string s)
- {
- return w.UrlPathEncode (s);
- }
-
- [MonoTODO]
- public override byte [] UrlTokenDecode (string input)
- {
- // return w.UrlTokenDecode (input);
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string UrlTokenEncode (byte [] input)
- {
- // return w.UrlTokenEncode (input);
- throw new NotImplementedException ();
- }
- }
-}
+++ /dev/null
-//
-// HttpSessionStateBase.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
-using System.Globalization;
-using System.IO;
-using System.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-using System.Web.SessionState;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public abstract class HttpSessionStateBase : ICollection, IEnumerable
- {
- void NotImplemented ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual int CodePage { get { NotImplemented (); return 0; } set { NotImplemented (); } }
-
- public virtual HttpSessionStateBase Contents { get { NotImplemented (); return null; } }
-
- public virtual HttpCookieMode CookieMode { get { NotImplemented (); return default (HttpCookieMode); } }
-
- public virtual int Count { get { NotImplemented (); return 0; } }
-
- public virtual bool IsCookieless { get { NotImplemented (); return false; } }
-
- public virtual bool IsNewSession { get { NotImplemented (); return false; } }
-
- public virtual bool IsReadOnly { get { NotImplemented (); return false; } }
-
- public virtual bool IsSynchronized { get { NotImplemented (); return false; } }
-
- public virtual object this [int index] {
- get { NotImplemented (); return null; }
- set { NotImplemented (); }
- }
-
- public virtual object this [string name] {
- get { NotImplemented (); return null; }
- set { NotImplemented (); }
- }
-
- public virtual NameObjectCollectionBase.KeysCollection Keys { get { NotImplemented (); return null; } }
-
- public virtual int LCID { get { NotImplemented (); return 0; } set { NotImplemented (); } }
-
- public virtual SessionStateMode Mode { get { NotImplemented (); return default (SessionStateMode); } }
-
- public virtual string SessionID { get { NotImplemented (); return null; } }
-
- public virtual HttpStaticObjectsCollectionBase StaticObjects { get { NotImplemented (); return null; } }
-
- public virtual object SyncRoot { get { NotImplemented (); return null; } }
-
- public virtual int Timeout { get { NotImplemented (); return 0; } set { NotImplemented (); } }
-
-
- public virtual void Abandon ()
- {
- NotImplemented ();
- }
-
- public virtual void Add (string name, object value)
- {
- NotImplemented ();
- }
-
- public virtual void Clear ()
- {
- NotImplemented ();
- }
-
- public virtual void CopyTo (Array array, int index)
- {
- NotImplemented ();
- }
-
- public virtual IEnumerator GetEnumerator ()
- {
- NotImplemented ();
- return null;
- }
-
- public virtual void Remove (string name)
- {
- NotImplemented ();
- }
-
- public virtual void RemoveAll ()
- {
- NotImplemented ();
- }
-
- public virtual void RemoveAt (int index)
- {
- NotImplemented ();
- }
- }
-}
+++ /dev/null
-//
-// HttpSessionStateWrapper.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
-using System.Globalization;
-using System.IO;
-using System.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-using System.Web.SessionState;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class HttpSessionStateWrapper : HttpSessionStateBase
- {
- HttpSessionState w;
-
- public HttpSessionStateWrapper (HttpSessionState httpSessionState)
- {
- if (httpSessionState == null)
- throw new ArgumentNullException ("httpSessionState");
- w = httpSessionState;
- }
-
- public override int CodePage {
- get { return w.CodePage; }
- set { w.CodePage = value; }
- }
-
- public override HttpSessionStateBase Contents {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public override HttpCookieMode CookieMode {
- //get { return w.CookieMode; }
- get { throw new NotImplementedException (); }
- }
-
- public override int Count {
- get { return w.Count; }
- }
-
- public override bool IsCookieless {
- get { return w.IsCookieless; }
- }
-
- public override bool IsNewSession {
- get { return w.IsNewSession; }
- }
-
- public override bool IsReadOnly {
- get { return w.IsReadOnly; }
- }
-
- public override bool IsSynchronized {
- get { return w.IsSynchronized; }
- }
-
- public override object this [int index] {
- get { return w [index]; }
- set { w [index] = value; }
- }
-
- public override object this [string name] {
- get { return w [name]; }
- set { w [name] = value; }
- }
-
- public override NameObjectCollectionBase.KeysCollection Keys {
- get { return w.Keys; }
- }
-
- public override int LCID {
- get { return w.LCID; }
- set { w.LCID = value; }
- }
-
- public override SessionStateMode Mode {
- get { return w.Mode; }
- }
-
- public override string SessionID {
- get { return w.SessionID; }
- }
-
- public override HttpStaticObjectsCollectionBase StaticObjects {
- get { throw new NotImplementedException (); }
- }
-
- public override object SyncRoot {
- get { return w.SyncRoot; }
- }
-
- public override int Timeout {
- get { return w.Timeout; }
- set { w.Timeout = value; }
- }
-
- public override void Abandon ()
- {
- w.Abandon ();
- }
-
- public override void Add (string name, object value)
- {
- w.Add (name, value);
- }
-
- public override void Clear ()
- {
- w.Clear ();
- }
-
- public override void CopyTo (Array array, int index)
- {
- w.CopyTo (array, index);
- }
-
- public override IEnumerator GetEnumerator ()
- {
- return w.GetEnumerator ();
- }
-
- public override void Remove (string name)
- {
- w.Remove (name);
- }
-
- public override void RemoveAll ()
- {
- w.RemoveAll ();
- }
-
- public override void RemoveAt (int index)
- {
- w.RemoveAt (index);
- }
- }
-}
+++ /dev/null
-//
-// HttpStaticObjectsCollectionBase.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
-using System.Globalization;
-using System.IO;
-using System.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-using System.Web.SessionState;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public abstract class HttpStaticObjectsCollectionBase : ICollection, IEnumerable
- {
- void NotImplemented ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual int Count { get { NotImplemented (); return 0; } }
-
- public virtual bool IsReadOnly { get { NotImplemented (); return false; } }
-
- public virtual bool IsSynchronized { get { NotImplemented (); return false; } }
-
- public virtual object this [string name] {
- get { NotImplemented (); return null; }
- }
-
- public virtual bool NeverAccessed { get { NotImplemented (); return false; } }
-
- public virtual object SyncRoot { get { NotImplemented (); return null; } }
-
- public virtual void CopyTo (Array array, int index)
- {
- NotImplemented ();
- }
-
- public virtual IEnumerator GetEnumerator ()
- {
- NotImplemented ();
- return null;
- }
-
- public virtual object GetObject (string name)
- {
- NotImplemented ();
- return null;
- }
-
- public virtual void Serialize (BinaryWriter writer)
- {
- NotImplemented ();
- }
- }
-}
+++ /dev/null
-//
-// HttpStaticObjectsCollectionWrapper.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
-using System.Globalization;
-using System.IO;
-using System.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Web.Caching;
-using System.Web.SessionState;
-
-namespace System.Web
-{
- [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class HttpStaticObjectsCollectionWrapper : HttpStaticObjectsCollectionBase
- {
- HttpStaticObjectsCollection w;
-
- public HttpStaticObjectsCollectionWrapper (HttpStaticObjectsCollection httpStaticObjectsCollection)
- {
- if (httpStaticObjectsCollection == null)
- throw new ArgumentNullException ("httpStaticObjectsCollection");
- w = httpStaticObjectsCollection;
- }
-
- public override int Count {
- get { return w.Count; }
- }
-
- public override bool IsReadOnly {
- get { return w.IsReadOnly; }
- }
-
- public override bool IsSynchronized {
- get { return w.IsSynchronized; }
- }
-
- public override object this [string name] {
- get { return w [name]; }
- }
-
- public override bool NeverAccessed {
- get { return w.NeverAccessed; }
- }
-
- public override object SyncRoot {
- get { return w.SyncRoot; }
- }
-
- public override void CopyTo (Array array, int index)
- {
- w.CopyTo (array, index);
- }
-
- public override IEnumerator GetEnumerator ()
- {
- return w.GetEnumerator ();
- }
-
- public override object GetObject (string name)
- {
- return w.GetObject (name);
- }
-
- public override void Serialize (BinaryWriter writer)
- {
- w.Serialize (writer);
- }
- }
-}
+++ /dev/null
-2010-06-05 Marek Habersack <mhabersack@novell.com>
-
- * UrlRoutingModule.cs: 4.0 doesn't do the UrlRouting.axd magic, it
- simply remaps the current handler to the one obtained from the
- route.
-
-2010-05-06 Marek Habersack <mhabersack@novell.com>
-
- * RouteCollection.cs: GetVirtualPath throws ArgumentException
- when named route is not found in the collection.
-
-2010-05-05 Marek Habersack <mhabersack@novell.com>
-
- * UrlRoutingModule.cs: PostMapRequestHandler is obsolete in 4.0
-
- * RouteValueDictionary.cs: do not process type fields in
- RouteValueDictionary (object)
-
- * RouteCollection.cs: GetRouteData throws an exception if Request
- is null in the passed context.
- Added Ignore* and MapPageRoute* 4.0 APIs
-
- * RequestContext.cs: 4.0 API update
-
- * PatternParser.cs: match parser rewrite to encompass 4.0 bug
- fixes. We don't emulate some of the pre-4.0 routing bugs anymore.
-
-2009-11-23 Marek Habersack <mhabersack@novell.com>
-
- * Route.cs: GetRouteData throws NotImplementedException only when
- pathInfo for the current request is a non-empty string. Patch from
- Tiaan <tagdev@gmail.com>, thanks!
-
-2009-11-09 Marek Habersack <mhabersack@novell.com>
-
- * RouteCollection.cs: GetVirtualPath doesn't append trailing slash
- to application path blindly anymore. Fixes bug #553022
-
-2009-09-09 Marek Habersack <mhabersack@novell.com>
-
- * Route.cs: when Url is set to null, create a parser for empty
- string. Fixes bug #537751
-
- * PatternParser.cs: Parse allows for null/empty URLs. Fixes bug
- #537751
-
-2009-09-08 Marek Habersack <mhabersack@novell.com>
-
- * UrlRoutingModule.cs: store original request path in
- PostResolveRequestCache and restore it in
- PostMapRequestHandler. Fixes bug #537089
-
-2009-08-19 Marek Habersack <mhabersack@novell.com>
-
- * Route.cs: GetRouteData adds contents of its DataTokens
- dictionary to the returned RouteData.DataTokens dictionary. Fixes
- bug #523330. Patch from Dax@daxxfiles.net, thanks!
-
-2009-06-25 Marek Habersack <mhabersack@novell.com>
-
- * PatternParser.cs: parameter name lookups must be
- case-insensitive.
- Null and empty (string) parameters are skipped when building query
- part of the action path.
-
-2009-06-16 Marek Habersack <mhabersack@novell.com>
-
- * RouteValueDictionaryExtensions.cs: do not compile if
- SYSTEMCORE_DEP is not defined
-
- * PatternParser.cs: if SYSTEMCORE_DEP is not defined, do not
- compile parts which require RouteValueDictionaryExtensions.
-
- * Decorated all classes with the TypeForwardedFrom attribute for
- the 4.0 profile.
-
-2009-06-04 Marek Habersack <mhabersack@novell.com>
-
- * RouteValueDictionaryExtensions.cs: if both values are strings in
- Has (string, value), compare them case-insensitively. Fixes bug
- #502555
-
-2009-05-27 Marek Habersack <mhabersack@novell.com>
-
- * PatternParser.cs: if Match is passed an empty path, do not
- attempt to match the Url segments, skip to defaults matching right
- away.
-
-2009-05-25 Marek Habersack <mhabersack@novell.com>
-
- * UrlPattern.cs: removed - replaced by PatternParser below.
-
- * RouteValueDictionaryExtensions.cs: added - some shortcuts for
- using RouteValueDictionary in PatternParser
-
- * Route.cs: use the new PatternParser.
- Factored out ProcessConstraint into ProcessConstraintInternal so
- that the latter can be used by the PatternParser class.
- Added parameter checks in ProcessConstraint.
-
- * PatternTokenType.cs: added
-
- * PatternToken.cs: added a helper class for the pattern parser.
-
- * PatternParser.cs: added. New implementation of url
- parser/matcher/generator which fixes all URL isues known so
- far. Fixes bug #504378
-
-2009-05-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
-
- * UrlPattern.cs: if the pattern is line {a}/{b} and {b} is substituted
- by an empty string, remove the '/' too.
-
-2009-05-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
-
- * UrlPattern.cs: non-string default arguments work now.
-
-2009-05-12 Marek Habersack <mhabersack@novell.com>
-
- * UrlPattern.cs: TrySubstitute performs substitution trimming. If
- a segment would be set to a default value and all of its following
- segments as well, it will be omitted from the generated URL. The
- value comparison is done case-insensitively when the dictionary
- values are strings. Fixes bug #502555
-
-2009-05-11 Marek Habersack <mhabersack@novell.com>
-
- * UrlPattern.cs: TrySubstitute treats defaults differently
- now. They are not consulted when checking if the passed values
- match the pattern, but only when substituting the values. Fixes
- bug #502555
-
-2009-05-05 Marek Habersack <mhabersack@novell.com>
-
- * UrlPattern.cs: Match adds defaults values should some keys be
- missing from the url. Fixes bug #500739
-
- * Route.cs: a small GetRouteData loop optimization
-
-2009-02-18 Marek Habersack <mhabersack@novell.com>
-
- * UrlPattern.cs: TrySubstitute now gets the collection of default
- values and uses it to replace url segments instead of failing when
- the passed values collection is missing a segment.
- Do not use the tokens array in Match.
-
- * RouteCollection.cs: check if name is null or empty, not just
- null in GetVirtualPath
-
- * Route.cs: url.TrySubstitute should be passed the defaults
- collection when called from GetVirtualPath
-
-2009-02-14 Marek Habersack <mhabersack@novell.com>
-
- * UrlPattern.cs: use the defaults collection when matching a path
- and segments are missing.
-
- * RouteCollection.cs: GetRouteData must use VirtualPathProvider
- to check for virtual path existence.
-
-2008-10-23 Atsushi Enomoto <atsushi@ximian.com>
-
- * UrlPattern.cs : fixed possible out-of-range case ("tableName/" in
- DynamicData).
-
-2008-10-17 Atsushi Enomoto <atsushi@ximian.com>
-
- * RouteValueDictionary.cs : its string comparison is case
- insensitive.
-
-2008-10-17 Atsushi Enomoto <atsushi@ximian.com>
-
- * UrlPattern.cs : fixed pattern match for such string that has
- suffix. (DynamicData uses it.)
-
-2008-10-16 Atsushi Enomoto <atsushi@ximian.com>
-
- * RouteValueDictionary.cs : object argument is actually for
- anonymous type instance.
-
-2008-10-10 Atsushi Enomoto <atsushi@ximian.com>
-
- * UrlRoutingModule.cs : implement PostMapRequestHandler() and
- PostResolveRequestCache() to work correctly in order.
- Now it should practically work.
-
-2008-09-18 Atsushi Enomoto <atsushi@ximian.com>
-
- * UrlRoutingModule.cs, RouteCollection.cs :
- handle RouteExistingFiles.
-
-2008-09-18 Atsushi Enomoto <atsushi@ximian.com>
-
- * Route.cs : reject invalid constraint.
- * UrlRoutingHandler.cs : more ProcessRequest() impl.
- * UrlRoutingModule.cs : note.
-
-2008-09-17 Atsushi Enomoto <atsushi@ximian.com>
-
- * HttpMethodConstraint.cs, Route.cs, RouteCollection.cs,
- UrlPattern.cs, UrlRoutingModule.cs:
- ongoing UrlRoutingModule implementation.
-
-2008-09-12 Atsushi Enomoto <atsushi@ximian.com>
-
- * HttpMethodConstraint.cs, Route.cs, UrlPattern.cs,
- RouteCollection.cs : implement Route.GetRouteData() and
- HttpMethodConstraint.Match().
-
-2008-09-12 Atsushi Enomoto <atsushi@ximian.com>
-
- * UrlPattern.cs : new file for URL pattern processing.
- * Route.cs : use above.
-
-2008-09-11 Atsushi Enomoto <atsushi@ximian.com>
-
- * HttpMethodConstraint.cs, RequestContext.cs, Route.cs,
- RouteCollection.cs, RouteData.cs, RouteTable.cs,
- RouteValueDictionary.cs, StopRoutingHandler.cs,
- UrlRoutingHandler.cs, UrlRoutingModule.cs, VirtualPathData.cs:
- some implementation.
-
-2008-09-04 Atsushi Enomoto <atsushi@ximian.com>
-
- *.cs: initial checkin.
+++ /dev/null
-//
-// HttpMethodConstraint.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Web;
-
-namespace System.Web.Routing
-{
- [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class HttpMethodConstraint : IRouteConstraint
- {
- public HttpMethodConstraint (params string[] allowedMethods)
- {
- if (allowedMethods == null)
- throw new ArgumentNullException ("allowedMethods");
- AllowedMethods = allowedMethods;
- }
-
- public ICollection<string> AllowedMethods { get; private set; }
-
- bool IRouteConstraint.Match (HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
- {
- return Match (httpContext, route, parameterName, values, routeDirection);
- }
-
- protected virtual bool Match (HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
- {
- if (httpContext == null)
- throw new ArgumentNullException ("httpContext");
- if (route == null)
- throw new ArgumentNullException ("route");
- if (parameterName == null)
- throw new ArgumentNullException ("parameterName");
- if (values == null)
- throw new ArgumentNullException ("values");
-
- switch (routeDirection) {
- case RouteDirection.IncomingRequest:
- // LAMESPEC: .NET allows case-insensitive comparison, which violates RFC 2616
- return AllowedMethods.Contains (httpContext.Request.HttpMethod);
-
- case RouteDirection.UrlGeneration:
- // See: aspnetwebstack's WebAPI equivalent for details.
- object method;
-
- if (!values.TryGetValue (parameterName, out method))
- return true;
-
- // LAMESPEC: .NET allows case-insensitive comparison, which violates RFC 2616
- return AllowedMethods.Contains (Convert.ToString (method));
-
- default:
- throw new ArgumentException ("Invalid routeDirection: " + routeDirection);
- }
- }
- }
-}
+++ /dev/null
-//
-// IRouteConstraint.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Web;
-
-namespace System.Web.Routing
-{
- [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- public interface IRouteConstraint
- {
- bool Match (HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection);
- }
-}
+++ /dev/null
-//
-// IRouteHandler.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Web;
-
-namespace System.Web.Routing
-{
- [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- public interface IRouteHandler
- {
- IHttpHandler GetHttpHandler (RequestContext requestContext);
- }
-}
+++ /dev/null
-//
-// PatternParser.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-// Marek Habersack <mhabersack@novell.com>
-//
-// Copyright (C) 2008-2010 Novell Inc. http://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.Generic;
-using System.Security.Permissions;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Web;
-using System.Web.Util;
-using System.Diagnostics;
-using System.Globalization;
-
-namespace System.Web.Routing
-{
- sealed class PatternParser
- {
- struct PatternSegment
- {
- public bool AllLiteral;
- public List <PatternToken> Tokens;
- }
-
- static readonly char[] placeholderDelimiters = { '{', '}' };
-
- PatternSegment[] segments;
- Dictionary <string, bool> parameterNames;
- PatternToken[] tokens;
-
- int segmentCount;
- bool haveSegmentWithCatchAll;
-
- public string Url {
- get;
- private set;
- }
-
- public PatternParser (string pattern)
- {
- this.Url = pattern;
- Parse ();
- }
-
- void Parse ()
- {
- string url = Url;
- parameterNames = new Dictionary <string, bool> (StringComparer.OrdinalIgnoreCase);
-
- if (!String.IsNullOrEmpty (url)) {
- if (url [0] == '~' || url [0] == '/')
- throw new ArgumentException ("Url must not start with '~' or '/'");
- if (url.IndexOf ('?') >= 0)
- throw new ArgumentException ("Url must not contain '?'");
- } else {
- segments = new PatternSegment [0];
- tokens = new PatternToken [0];
- return;
- }
-
- string[] parts = url.Split ('/');
- int partsCount = segmentCount = parts.Length;
- var allTokens = new List <PatternToken> ();
- PatternToken tmpToken;
-
- segments = new PatternSegment [partsCount];
-
- for (int i = 0; i < partsCount; i++) {
- if (haveSegmentWithCatchAll)
- throw new ArgumentException ("A catch-all parameter can only appear as the last segment of the route URL");
-
- int catchAlls = 0;
- string part = parts [i];
- int partLength = part.Length;
- var tokens = new List <PatternToken> ();
-
- if (partLength == 0 && i < partsCount - 1)
- throw new ArgumentException ("Consecutive URL segment separators '/' are not allowed");
-
- if (part.IndexOf ("{}") != -1)
- throw new ArgumentException ("Empty URL parameter name is not allowed");
-
- if (i > 0)
- allTokens.Add (null);
-
- if (part.IndexOfAny (placeholderDelimiters) == -1) {
- // no placeholders here, short-circuit it
- tmpToken = new PatternToken (PatternTokenType.Literal, part);
- tokens.Add (tmpToken);
- allTokens.Add (tmpToken);
- segments [i].AllLiteral = true;
- segments [i].Tokens = tokens;
- continue;
- }
-
- string tmp;
- int from = 0, start;
- bool allLiteral = true;
- while (from < partLength) {
- start = part.IndexOf ('{', from);
- if (start >= partLength - 2)
- throw new ArgumentException ("Unterminated URL parameter. It must contain matching '}'");
-
- if (start < 0) {
- if (part.IndexOf ('}', from) >= from)
- throw new ArgumentException ("Unmatched URL parameter closer '}'. A corresponding '{' must precede");
- tmp = part.Substring (from);
- tmpToken = new PatternToken (PatternTokenType.Literal, tmp);
- tokens.Add (tmpToken);
- allTokens.Add (tmpToken);
- from += tmp.Length;
- break;
- }
-
- if (from == 0 && start > 0) {
- tmpToken = new PatternToken (PatternTokenType.Literal, part.Substring (0, start));
- tokens.Add (tmpToken);
- allTokens.Add (tmpToken);
- }
-
- int end = part.IndexOf ('}', start + 1);
- int next = part.IndexOf ('{', start + 1);
-
- if (end < 0 || next >= 0 && next < end)
- throw new ArgumentException ("Unterminated URL parameter. It must contain matching '}'");
- if (next == end + 1)
- throw new ArgumentException ("Two consecutive URL parameters are not allowed. Split into a different segment by '/', or a literal string.");
-
- if (next == -1)
- next = partLength;
-
- string token = part.Substring (start + 1, end - start - 1);
- PatternTokenType type;
- if (token [0] == '*') {
- catchAlls++;
- haveSegmentWithCatchAll = true;
- type = PatternTokenType.CatchAll;
- token = token.Substring (1);
- } else
- type = PatternTokenType.Standard;
-
- if (!parameterNames.ContainsKey (token))
- parameterNames.Add (token, true);
-
- tmpToken = new PatternToken (type, token);
- tokens.Add (tmpToken);
- allTokens.Add (tmpToken);
- allLiteral = false;
-
- if (end < partLength - 1) {
- token = part.Substring (end + 1, next - end - 1);
- tmpToken = new PatternToken (PatternTokenType.Literal, token);
- tokens.Add (tmpToken);
- allTokens.Add (tmpToken);
- end += token.Length;
- }
-
- if (catchAlls > 1 || (catchAlls == 1 && tokens.Count > 1))
- throw new ArgumentException ("A path segment that contains more than one section, such as a literal section or a parameter, cannot contain a catch-all parameter.");
- from = end + 1;
- }
-
- segments [i].AllLiteral = allLiteral;
- segments [i].Tokens = tokens;
- }
-
- if (allTokens.Count > 0)
- this.tokens = allTokens.ToArray ();
- allTokens = null;
- }
-
- RouteValueDictionary AddDefaults (RouteValueDictionary dict, RouteValueDictionary defaults)
- {
- if (defaults != null && defaults.Count > 0) {
- string key;
- foreach (var def in defaults) {
- key = def.Key;
- if (dict.ContainsKey (key))
- continue;
- dict.Add (key, def.Value);
- }
- }
-
- return dict;
- }
-
- static bool ParametersAreEqual (object a, object b)
- {
- if (a is string && b is string) {
- return String.Equals (a as string, b as string, StringComparison.OrdinalIgnoreCase);
- } else {
- // Parameter may be a boxed value type, need to use .Equals() for comparison
- return object.Equals (a, b);
- }
- }
-
- static bool ParameterIsNonEmpty (object param)
- {
- if (param is string)
- return !string.IsNullOrEmpty (param as string);
-
- return param != null;
- }
-
- bool IsParameterRequired (string parameterName, RouteValueDictionary defaultValues, out object defaultValue)
- {
- foreach (var token in tokens) {
- if (token == null)
- continue;
-
- if (string.Equals (token.Name, parameterName, StringComparison.OrdinalIgnoreCase)) {
- if (token.Type == PatternTokenType.CatchAll) {
- defaultValue = null;
- return false;
- }
- }
- }
-
- if (defaultValues == null)
- throw new ArgumentNullException ("defaultValues is null?!");
-
- return !defaultValues.TryGetValue (parameterName, out defaultValue);
- }
-
- static string EscapeReservedCharacters (Match m)
- {
- if (m == null)
- throw new ArgumentNullException("m");
-
- return Uri.HexEscape (m.Value[0]);
- }
-
- static string UriEncode (string str)
- {
- if (string.IsNullOrEmpty (str))
- return str;
-
- string escape = Uri.EscapeUriString (str);
- return Regex.Replace (escape, "([#?])", new MatchEvaluator (EscapeReservedCharacters));
- }
-
- bool MatchSegment (int segIndex, int argsCount, string[] argSegs, List <PatternToken> tokens, RouteValueDictionary ret)
- {
- string pathSegment = argSegs [segIndex];
- int pathSegmentLength = pathSegment != null ? pathSegment.Length : -1;
- int startIndex = pathSegmentLength - 1;
- PatternTokenType tokenType;
- int tokensCount = tokens.Count;
- PatternToken token;
- string tokenName;
-
- for (int tokenIndex = tokensCount - 1; tokenIndex > -1; tokenIndex--) {
- token = tokens [tokenIndex];
- if (startIndex < 0)
- return false;
-
- tokenType = token.Type;
- tokenName = token.Name;
-
- if (segIndex > segmentCount - 1 || tokenType == PatternTokenType.CatchAll) {
- var sb = new StringBuilder ();
-
- for (int j = segIndex; j < argsCount; j++) {
- if (j > segIndex)
- sb.Append ('/');
- sb.Append (argSegs [j]);
- }
-
- ret.Add (tokenName, sb.ToString ());
- break;
- }
-
- int scanIndex;
- if (token.Type == PatternTokenType.Literal) {
- int nameLen = tokenName.Length;
- if (startIndex + 1 < nameLen)
- return false;
- scanIndex = startIndex - nameLen + 1;
- if (String.Compare (pathSegment, scanIndex, tokenName, 0, nameLen, StringComparison.OrdinalIgnoreCase) != 0)
- return false;
- startIndex = scanIndex - 1;
- continue;
- }
-
- // Standard token
- int nextTokenIndex = tokenIndex - 1;
- if (nextTokenIndex < 0) {
- // First token
- ret.Add (tokenName, pathSegment.Substring (0, startIndex + 1));
- continue;
- }
-
- if (startIndex == 0)
- return false;
-
- var nextToken = tokens [nextTokenIndex];
- string nextTokenName = nextToken.Name;
-
- // Skip one char, since there can be no empty segments and if the
- // current token's value happens to be the same as preceeding
- // literal text, we'll save some time and complexity.
- scanIndex = startIndex - 1;
- int lastIndex = pathSegment.LastIndexOf (nextTokenName, scanIndex, StringComparison.OrdinalIgnoreCase);
- if (lastIndex == -1)
- return false;
-
- lastIndex += nextTokenName.Length - 1;
-
- string sectionValue = pathSegment.Substring (lastIndex + 1, startIndex - lastIndex);
- if (String.IsNullOrEmpty (sectionValue))
- return false;
-
- ret.Add (tokenName, sectionValue);
- startIndex = lastIndex;
- }
-
- return true;
- }
-
- public RouteValueDictionary Match (string path, RouteValueDictionary defaults)
- {
- var ret = new RouteValueDictionary ();
- string url = Url;
- string [] argSegs;
- int argsCount;
-
- if (String.IsNullOrEmpty (path)) {
- argSegs = null;
- argsCount = 0;
- } else {
- // quick check
- if (String.Compare (url, path, StringComparison.Ordinal) == 0 && url.IndexOf ('{') < 0)
- return AddDefaults (ret, defaults);
-
- argSegs = path.Split ('/');
- argsCount = argSegs.Length;
-
- if (String.IsNullOrEmpty (argSegs [argsCount - 1]))
- argsCount--; // path ends with a trailinig '/'
- }
- bool haveDefaults = defaults != null && defaults.Count > 0;
-
- if (argsCount == 1 && String.IsNullOrEmpty (argSegs [0]))
- argsCount = 0;
-
- if (!haveDefaults && ((haveSegmentWithCatchAll && argsCount < segmentCount) || (!haveSegmentWithCatchAll && argsCount != segmentCount)))
- return null;
-
- int i = 0;
-
- foreach (PatternSegment segment in segments) {
- if (i >= argsCount)
- break;
-
- if (segment.AllLiteral) {
- if (String.Compare (argSegs [i], segment.Tokens [0].Name, StringComparison.OrdinalIgnoreCase) != 0)
- return null;
- i++;
- continue;
- }
-
- if (!MatchSegment (i, argsCount, argSegs, segment.Tokens, ret))
- return null;
- i++;
- }
-
- // Check the remaining segments, if any, and see if they are required
- //
- // If a segment has more than one section (i.e. there's at least one
- // literal, then it cannot match defaults
- //
- // All of the remaining segments must have all defaults provided and they
- // must not be literals or the match will fail.
- if (i < segmentCount) {
- if (!haveDefaults)
- return null;
-
- for (;i < segmentCount; i++) {
- var segment = segments [i];
- if (segment.AllLiteral)
- return null;
-
- var tokens = segment.Tokens;
- if (tokens.Count != 1)
- return null;
-
- // if token is catch-all, we're done.
- if (tokens [0].Type == PatternTokenType.CatchAll)
- break;
-
- if (!defaults.ContainsKey (tokens [0].Name))
- return null;
- }
- } else if (!haveSegmentWithCatchAll && argsCount > segmentCount)
- return null;
-
- return AddDefaults (ret, defaults);
- }
-
- public string BuildUrl (Route route, RequestContext requestContext, RouteValueDictionary userValues, RouteValueDictionary constraints, out RouteValueDictionary usedValues)
- {
- usedValues = null;
-
- if (requestContext == null)
- return null;
-
- RouteData routeData = requestContext.RouteData;
- var currentValues = routeData.Values ?? new RouteValueDictionary ();
- var values = userValues ?? new RouteValueDictionary ();
- var defaultValues = (route != null ? route.Defaults : null) ?? new RouteValueDictionary ();
-
- // The set of values we should be using when generating the URL in this route
- var acceptedValues = new RouteValueDictionary ();
-
- // Keep track of which new values have been used
- HashSet<string> unusedNewValues = new HashSet<string> (values.Keys, StringComparer.OrdinalIgnoreCase);
-
- // This route building logic is based on System.Web.Http's Routing code (which is Apache Licensed by MS)
- // and which can be found at mono's external/aspnetwebstack/src/System.Web.Http/Routing/HttpParsedRoute.cs
- // Hopefully this will ensure a much higher compatiblity with MS.NET's System.Web.Routing logic. (pruiz)
-
- #region Step 1: Get the list of values we're going to use to match and generate this URL
- // Find out which entries in the URL are valid for the URL we want to generate.
- // If the URL had ordered parameters a="1", b="2", c="3" and the new values
- // specified that b="9", then we need to invalidate everything after it. The new
- // values should then be a="1", b="9", c=<no value>.
- foreach (var item in parameterNames) {
- var parameterName = item.Key;
-
- object newParameterValue;
- bool hasNewParameterValue = values.TryGetValue (parameterName, out newParameterValue);
- if (hasNewParameterValue) {
- unusedNewValues.Remove(parameterName);
- }
-
- object currentParameterValue;
- bool hasCurrentParameterValue = currentValues.TryGetValue (parameterName, out currentParameterValue);
-
- if (hasNewParameterValue && hasCurrentParameterValue) {
- if (!ParametersAreEqual (currentParameterValue, newParameterValue)) {
- // Stop copying current values when we find one that doesn't match
- break;
- }
- }
-
- // If the parameter is a match, add it to the list of values we will use for URL generation
- if (hasNewParameterValue) {
- if (ParameterIsNonEmpty (newParameterValue)) {
- acceptedValues.Add (parameterName, newParameterValue);
- }
- }
- else {
- if (hasCurrentParameterValue) {
- acceptedValues.Add (parameterName, currentParameterValue);
- }
- }
- }
-
- // Add all remaining new values to the list of values we will use for URL generation
- foreach (var newValue in values) {
- if (ParameterIsNonEmpty (newValue.Value) && !acceptedValues.ContainsKey (newValue.Key)) {
- acceptedValues.Add (newValue.Key, newValue.Value);
- }
- }
-
- // Add all current values that aren't in the URL at all
- foreach (var currentValue in currentValues) {
- if (!acceptedValues.ContainsKey (currentValue.Key) && !parameterNames.ContainsKey (currentValue.Key)) {
- acceptedValues.Add (currentValue.Key, currentValue.Value);
- }
- }
-
- // Add all remaining default values from the route to the list of values we will use for URL generation
- foreach (var item in parameterNames) {
- object defaultValue;
- if (!acceptedValues.ContainsKey (item.Key) && !IsParameterRequired (item.Key, defaultValues, out defaultValue)) {
- // Add the default value only if there isn't already a new value for it and
- // only if it actually has a default value, which we determine based on whether
- // the parameter value is required.
- acceptedValues.Add (item.Key, defaultValue);
- }
- }
-
- // All required parameters in this URL must have values from somewhere (i.e. the accepted values)
- foreach (var item in parameterNames) {
- object defaultValue;
- if (IsParameterRequired (item.Key, defaultValues, out defaultValue) && !acceptedValues.ContainsKey (item.Key)) {
- // If the route parameter value is required that means there's
- // no default value, so if there wasn't a new value for it
- // either, this route won't match.
- return null;
- }
- }
-
- // All other default values must match if they are explicitly defined in the new values
- var otherDefaultValues = new RouteValueDictionary (defaultValues);
- foreach (var item in parameterNames) {
- otherDefaultValues.Remove (item.Key);
- }
-
- foreach (var defaultValue in otherDefaultValues) {
- object value;
- if (values.TryGetValue (defaultValue.Key, out value)) {
- unusedNewValues.Remove (defaultValue.Key);
- if (!ParametersAreEqual (value, defaultValue.Value)) {
- // If there is a non-parameterized value in the route and there is a
- // new value for it and it doesn't match, this route won't match.
- return null;
- }
- }
- }
- #endregion
-
- #region Step 2: If the route is a match generate the appropriate URL
-
- var uri = new StringBuilder ();
- var pendingParts = new StringBuilder ();
- var pendingPartsAreAllSafe = false;
- bool blockAllUriAppends = false;
- var allSegments = new List<PatternSegment?> ();
-
- // Build a list of segments plus separators we can use as template.
- foreach (var segment in segments) {
- if (allSegments.Count > 0)
- allSegments.Add (null); // separator exposed as null.
- allSegments.Add (segment);
- }
-
- // Finally loop thru al segment-templates building the actual uri.
- foreach (var item in allSegments) {
- var segment = item.GetValueOrDefault ();
-
- // If segment is a separator..
- if (item == null) {
- if (pendingPartsAreAllSafe) {
- // Accept
- if (pendingParts.Length > 0) {
- if (blockAllUriAppends)
- return null;
-
- // Append any pending literals to the URL
- uri.Append (pendingParts.ToString ());
- pendingParts.Length = 0;
- }
- }
- pendingPartsAreAllSafe = false;
-
- // Guard against appending multiple separators for empty segments
- if (pendingParts.Length > 0 && pendingParts[pendingParts.Length - 1] == '/') {
- // Dev10 676725: Route should not be matched if that causes mismatched tokens
- // Dev11 86819: We will allow empty matches if all subsequent segments are null
- if (blockAllUriAppends)
- return null;
-
- // Append any pending literals to the URI (without the trailing slash) and prevent any future appends
- uri.Append(pendingParts.ToString (0, pendingParts.Length - 1));
- pendingParts.Length = 0;
- } else {
- pendingParts.Append ("/");
- }
-#if false
- } else if (segment.AllLiteral) {
- // Spezial (optimized) case: all elements of segment are literals.
- pendingPartsAreAllSafe = true;
- foreach (var tk in segment.Tokens)
- pendingParts.Append (tk.Name);
-#endif
- } else {
- // Segments are treated as all-or-none. We should never output a partial segment.
- // If we add any subsegment of this segment to the generated URL, we have to add
- // the complete match. For example, if the subsegment is "{p1}-{p2}.xml" and we
- // used a value for {p1}, we have to output the entire segment up to the next "/".
- // Otherwise we could end up with the partial segment "v1" instead of the entire
- // segment "v1-v2.xml".
- bool addedAnySubsegments = false;
-
- foreach (var token in segment.Tokens) {
- if (token.Type == PatternTokenType.Literal) {
- // If it's a literal we hold on to it until we are sure we need to add it
- pendingPartsAreAllSafe = true;
- pendingParts.Append (token.Name);
- } else {
- if (token.Type == PatternTokenType.Standard || token.Type == PatternTokenType.CatchAll) {
- if (pendingPartsAreAllSafe) {
- // Accept
- if (pendingParts.Length > 0) {
- if (blockAllUriAppends)
- return null;
-
- // Append any pending literals to the URL
- uri.Append (pendingParts.ToString ());
- pendingParts.Length = 0;
-
- addedAnySubsegments = true;
- }
- }
- pendingPartsAreAllSafe = false;
-
- // If it's a parameter, get its value
- object acceptedParameterValue;
- bool hasAcceptedParameterValue = acceptedValues.TryGetValue (token.Name, out acceptedParameterValue);
- if (hasAcceptedParameterValue)
- unusedNewValues.Remove (token.Name);
-
- object defaultParameterValue;
- defaultValues.TryGetValue (token.Name, out defaultParameterValue);
-
- if (ParametersAreEqual (acceptedParameterValue, defaultParameterValue)) {
- // If the accepted value is the same as the default value, mark it as pending since
- // we won't necessarily add it to the URL we generate.
- pendingParts.Append (Convert.ToString (acceptedParameterValue, CultureInfo.InvariantCulture));
- } else {
- if (blockAllUriAppends)
- return null;
-
- // Add the new part to the URL as well as any pending parts
- if (pendingParts.Length > 0) {
- // Append any pending literals to the URL
- uri.Append (pendingParts.ToString ());
- pendingParts.Length = 0;
- }
- uri.Append (Convert.ToString (acceptedParameterValue, CultureInfo.InvariantCulture));
-
- addedAnySubsegments = true;
- }
- } else {
- Debug.Fail ("Invalid path subsegment type");
- }
- }
- }
-
- if (addedAnySubsegments) {
- // See comment above about why we add the pending parts
- if (pendingParts.Length > 0) {
- if (blockAllUriAppends)
- return null;
-
- // Append any pending literals to the URL
- uri.Append (pendingParts.ToString ());
- pendingParts.Length = 0;
- }
- }
- }
- }
-
- if (pendingPartsAreAllSafe) {
- // Accept
- if (pendingParts.Length > 0) {
- if (blockAllUriAppends)
- return null;
-
- // Append any pending literals to the URI
- uri.Append (pendingParts.ToString ());
- }
- }
-
- // Process constraints keys
- if (constraints != null) {
- // If there are any constraints, mark all the keys as being used so that we don't
- // generate query string items for custom constraints that don't appear as parameters
- // in the URI format.
- foreach (var constraintsItem in constraints) {
- unusedNewValues.Remove (constraintsItem.Key);
- }
- }
-
- // Encode the URI before we append the query string, otherwise we would double encode the query string
- var encodedUri = new StringBuilder ();
- encodedUri.Append (UriEncode (uri.ToString ()));
- uri = encodedUri;
-
- // Add remaining new values as query string parameters to the URI
- if (unusedNewValues.Count > 0) {
- // Generate the query string
- bool firstParam = true;
- foreach (string unusedNewValue in unusedNewValues) {
- object value;
- if (acceptedValues.TryGetValue (unusedNewValue, out value)) {
- uri.Append (firstParam ? '?' : '&');
- firstParam = false;
- uri.Append (Uri.EscapeDataString (unusedNewValue));
- uri.Append ('=');
- uri.Append (Uri.EscapeDataString (Convert.ToString (value, CultureInfo.InvariantCulture)));
- }
- }
- }
-
- #endregion
-
- usedValues = acceptedValues;
- return uri.ToString();
- }
- }
-}
-
+++ /dev/null
-//
-// PatternToken.cs
-//
-// Author:
-// Marek Habersack <mhabersack@novell.com>
-//
-// Copyright (C) 2009 Novell Inc. http://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.Text;
-using System.Web;
-
-namespace System.Web.Routing
-{
- sealed class PatternToken
- {
- public PatternTokenType Type {
- get;
- private set;
- }
-
- public string Name {
- get;
- private set;
- }
-
- public PatternToken (PatternTokenType type, string name)
- {
- this.Type = type;
- this.Name = name;
- }
-
- public override string ToString ()
- {
- StringBuilder sb = new StringBuilder ();
-
- switch (Type) {
- case PatternTokenType.Standard:
- sb.Append ("PatternToken_Standard");
- break;
-
- case PatternTokenType.Literal:
- sb.Append ("PatternToken_Literal");
- break;
-
- case PatternTokenType.CatchAll:
- sb.Append ("PatternToken_CatchAll");
- break;
-
- default:
- sb.Append ("PatternToken_UNKNOWN");
- break;
- }
-
- sb.AppendFormat (" [Name = '{0}']", Name);
-
- return sb.ToString ();
- }
- }
-}
+++ /dev/null
-//
-// PatternTokenType.cs
-//
-// Author:
-// Marek Habersack <mhabersack@novell.com>
-//
-// Copyright (C) 2009 Novell Inc. http://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.Routing
-{
- enum PatternTokenType
- {
- Standard,
- Literal,
- CatchAll
- }
-}
+++ /dev/null
-//
-// RequestContext.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Web;
-
-namespace System.Web.Routing
-{
- [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class RequestContext
- {
- public RequestContext ()
- {
- HttpContext = null;
- RouteData = null;
- }
- public RequestContext (HttpContextBase httpContext, RouteData routeData)
- {
- if (httpContext == null)
- throw new ArgumentNullException ("httpContext");
- if (routeData == null)
- throw new ArgumentNullException ("routeData");
-
- HttpContext = httpContext;
- RouteData = routeData;
- }
-
- public virtual HttpContextBase HttpContext { get; set; }
- public virtual RouteData RouteData { get; set; }
- }
-}
+++ /dev/null
-//
-// Route.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Text.RegularExpressions;
-using System.Web;
-using System.Globalization;
-
-namespace System.Web.Routing
-{
- [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class Route : RouteBase
- {
- static readonly Type httpRequestBaseType = typeof (HttpRequestBase);
- PatternParser url;
-
- public RouteValueDictionary Constraints { get; set; }
-
- public RouteValueDictionary DataTokens { get; set; }
-
- public RouteValueDictionary Defaults { get; set; }
-
- public IRouteHandler RouteHandler { get; set; }
-
- public string Url {
- get { return url != null ? url.Url : String.Empty; }
- set { url = value != null ? new PatternParser (value) : new PatternParser (String.Empty); }
- }
-
- public Route (string url, IRouteHandler routeHandler)
- : this (url, null, routeHandler)
- {
- }
-
- public Route (string url, RouteValueDictionary defaults, IRouteHandler routeHandler)
- : this (url, defaults, null, routeHandler)
- {
- }
-
- public Route (string url, RouteValueDictionary defaults, RouteValueDictionary constraints, IRouteHandler routeHandler)
- : this (url, defaults, constraints, null, routeHandler)
- {
- }
-
- public Route (string url, RouteValueDictionary defaults, RouteValueDictionary constraints, RouteValueDictionary dataTokens, IRouteHandler routeHandler)
- {
- Url = url;
- Defaults = defaults;
- Constraints = constraints;
- DataTokens = dataTokens;
- RouteHandler = routeHandler;
- }
-
- public override RouteData GetRouteData (HttpContextBase httpContext)
- {
- var path = httpContext.Request.AppRelativeCurrentExecutionFilePath;
- var pathInfo = httpContext.Request.PathInfo;
-
- if (!String.IsNullOrEmpty (pathInfo))
- path += pathInfo;
-
- // probably code like this causes ArgumentOutOfRangeException under .NET.
- // It somehow allows such path that is completely equivalent to the Url. Dunno why.
- if (Url != path && path.Substring (0, 2) != "~/")
- return null;
- path = path.Substring (2);
-
- var values = url.Match (path, Defaults);
- if (values == null)
- return null;
-
- if (!ProcessConstraints (httpContext, values, RouteDirection.IncomingRequest))
- return null;
-
- var rd = new RouteData (this, RouteHandler);
- RouteValueDictionary rdValues = rd.Values;
-
- foreach (var p in values)
- rdValues.Add (p.Key, p.Value);
-
- RouteValueDictionary dataTokens = DataTokens;
- if (dataTokens != null) {
- RouteValueDictionary rdDataTokens = rd.DataTokens;
- foreach (var token in dataTokens)
- rdDataTokens.Add (token.Key, token.Value);
- }
-
- return rd;
- }
-
- public override VirtualPathData GetVirtualPath (RequestContext requestContext, RouteValueDictionary values)
- {
- if (requestContext == null)
- throw new ArgumentNullException ("requestContext");
- if (url == null)
- return new VirtualPathData (this, String.Empty);
-
- // null values is allowed.
- // if (values == null)
- // values = requestContext.RouteData.Values;
-
- RouteValueDictionary usedValues;
- string resultUrl = url.BuildUrl (this, requestContext, values, Constraints, out usedValues);
-
- if (resultUrl == null)
- return null;
-
- if (!ProcessConstraints (requestContext.HttpContext, usedValues, RouteDirection.UrlGeneration))
- return null;
-
- var result = new VirtualPathData (this, resultUrl);
-
- RouteValueDictionary dataTokens = DataTokens;
- if (dataTokens != null) {
- foreach (var item in dataTokens)
- result.DataTokens[item.Key] = item.Value;
- }
-
- return result;
- }
-
- private bool ProcessConstraintInternal (HttpContextBase httpContext, Route route, object constraint, string parameterName,
- RouteValueDictionary values, RouteDirection routeDirection, RequestContext reqContext,
- out bool invalidConstraint)
- {
- invalidConstraint = false;
- IRouteConstraint irc = constraint as IRouteConstraint;
- if (irc != null)
- return irc.Match (httpContext, route, parameterName, values, routeDirection);
-
- string s = constraint as string;
- if (s != null) {
- string v = null;
- object o;
-
- // NOTE: If constraint was not an IRouteConstraint, is is asumed
- // to be an object 'convertible' to string, or at least this is how
- // ASP.NET seems to work by the tests i've done latelly. (pruiz)
-
- if (values != null && values.TryGetValue (parameterName, out o))
- v = Convert.ToString (o, CultureInfo.InvariantCulture);
-
- if (!String.IsNullOrEmpty (v))
- return MatchConstraintRegex (v, s);
- else if (reqContext != null) {
- RouteData rd = reqContext != null ? reqContext.RouteData : null;
- RouteValueDictionary rdValues = rd != null ? rd.Values : null;
-
- if (rdValues == null || rdValues.Count == 0)
- return false;
-
- if (!rdValues.TryGetValue (parameterName, out o))
- return false;
-
- v = Convert.ToString (o, CultureInfo.InvariantCulture);
- if (String.IsNullOrEmpty (v))
- return false;
-
- return MatchConstraintRegex (v, s);
- }
- return false;
- }
-
- invalidConstraint = true;
- return false;
- }
-
- static bool MatchConstraintRegex (string value, string constraint)
- {
- int len = constraint.Length;
- if (len > 0) {
- // Bug #651966 - regexp constraints must be treated
- // as absolute expressions
- if (constraint [0] != '^') {
- constraint = "^" + constraint;
- len++;
- }
-
- if (constraint [len - 1] != '$')
- constraint += "$";
- }
-
- return Regex.IsMatch (value, constraint, RegexOptions.CultureInvariant | RegexOptions.IgnoreCase | RegexOptions.Compiled);
- }
-
- protected virtual bool ProcessConstraint (HttpContextBase httpContext, object constraint, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
- {
- if (parameterName == null)
- throw new ArgumentNullException ("parameterName");
-
- // .NET "compatibility"
- if (values == null)
- throw new NullReferenceException ();
-
- RequestContext reqContext;
- reqContext = SafeGetContext (httpContext != null ? httpContext.Request : null);
- bool invalidConstraint;
- bool ret = ProcessConstraintInternal (httpContext, this, constraint, parameterName, values, routeDirection, reqContext, out invalidConstraint);
-
- if (invalidConstraint)
- throw new InvalidOperationException (
- String.Format (
- "Constraint parameter '{0}' on the route with URL '{1}' must have a string value type or be a type which implements IRouteConstraint",
- parameterName, Url
- )
- );
-
- return ret;
- }
-
- private bool ProcessConstraints (HttpContextBase httpContext, RouteValueDictionary values, RouteDirection routeDirection)
- {
- var constraints = Constraints;
-
- if (Constraints != null) {
- foreach (var p in constraints)
- if (!ProcessConstraint (httpContext, p.Value, p.Key, values, routeDirection))
- return false;
- }
-
- return true;
- }
-
- RequestContext SafeGetContext (HttpRequestBase req)
- {
- if (req == null || req.GetType () != httpRequestBaseType)
- return null;
-
- return req.RequestContext;
- }
- }
-}
+++ /dev/null
-//
-// RouteBase.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Web;
-
-namespace System.Web.Routing
-{
- [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public abstract class RouteBase
- {
- public abstract RouteData GetRouteData (HttpContextBase httpContext);
- public abstract VirtualPathData GetVirtualPath (RequestContext requestContext, RouteValueDictionary values);
- }
-}
+++ /dev/null
-//
-// RouteCollection.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Collections.ObjectModel;
-using System.IO;
-using System.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Web;
-using System.Web.Hosting;
-
-namespace System.Web.Routing
-{
- [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class RouteCollection : Collection<RouteBase>
- {
- class Lock : IDisposable
- {
- //RouteCollection owner;
- //bool read;
-
- public Lock (RouteCollection owner, bool read)
- {
- //this.owner = owner;
- //this.read = read;
- }
-
- public void Dispose ()
- {
- //if (read)
- // owner.read_lock = null;
- //else
- // owner_write_lock = null;
- }
- }
-
- public RouteCollection ()
- : this (null)
- {
- }
-
- public RouteCollection (VirtualPathProvider virtualPathProvider)
- {
- // null argument is allowed
- //provider = virtualPathProvider;
-
- read_lock = new Lock (this, true);
- write_lock = new Lock (this, false);
- }
-
- //VirtualPathProvider provider;
- Dictionary<string,RouteBase> d = new Dictionary<string,RouteBase> ();
-
- Lock read_lock, write_lock;
-
- public RouteBase this [string name] {
- get {
- foreach (var p in d)
- if (p.Key == name)
- return p.Value;
- return null;
- }
- }
-
- public bool LowercaseUrls { get; set; }
- public bool AppendTrailingSlash { get; set; }
- public bool RouteExistingFiles { get; set; }
-
- public void Add (string name, RouteBase item)
- {
- lock (GetWriteLock ()) {
- base.Add (item);
- if (!String.IsNullOrEmpty (name))
- d.Add (name, item);
- }
- }
-
- protected override void ClearItems ()
- {
- lock (GetWriteLock ())
- base.ClearItems ();
- }
-
- public IDisposable GetReadLock ()
- {
- return read_lock;
- }
-
- public RouteData GetRouteData (HttpContextBase httpContext)
- {
- if (httpContext == null)
- throw new ArgumentNullException ("httpContext");
-
- if (httpContext.Request == null)
- throw new ArgumentException ("The context does not contain any request data.", "httpContext");
- if (Count == 0)
- return null;
- if (!RouteExistingFiles) {
- var path = httpContext.Request.AppRelativeCurrentExecutionFilePath;
- VirtualPathProvider vpp = HostingEnvironment.VirtualPathProvider;
- if (path != "~/" && vpp != null && (vpp.FileExists (path) || vpp.DirectoryExists (path)))
- return null;
- }
- foreach (RouteBase rb in this) {
- var rd = rb.GetRouteData (httpContext);
- if (rd != null)
- return rd;
- }
-
- return null;
- }
-
- public VirtualPathData GetVirtualPath (RequestContext requestContext, RouteValueDictionary values)
- {
- return GetVirtualPath (requestContext, null, values);
- }
-
- public VirtualPathData GetVirtualPath (RequestContext requestContext, string name, RouteValueDictionary values)
- {
- if (requestContext == null)
- throw new ArgumentNullException ("httpContext");
- VirtualPathData vp = null;
- if (!String.IsNullOrEmpty (name)) {
- RouteBase rb = this [name];
- if (rb != null)
- vp = rb.GetVirtualPath (requestContext, values);
- else
- throw new ArgumentException ("A route named '" + name + "' could not be found in the route collection.", "name");
- } else {
- foreach (RouteBase rb in this) {
- vp = rb.GetVirtualPath (requestContext, values);
- if (vp != null)
- break;
- }
- }
-
- if (vp != null) {
- string appPath = requestContext.HttpContext.Request.ApplicationPath;
- if (appPath != null && (appPath.Length == 0 || !appPath.EndsWith ("/", StringComparison.Ordinal)))
- appPath += "/";
-
- string pathWithApp = String.Concat (appPath, vp.VirtualPath);
- vp.VirtualPath = requestContext.HttpContext.Response.ApplyAppPathModifier (pathWithApp);
- return vp;
- }
-
- return null;
- }
-
- public IDisposable GetWriteLock ()
- {
- return write_lock;
- }
- public void Ignore (string url)
- {
- Ignore (url, null);
- }
-
- public void Ignore (string url, object constraints)
- {
- if (url == null)
- throw new ArgumentNullException ("url");
-
- Add (new Route (url, null, new RouteValueDictionary (constraints), new StopRoutingHandler ()));
- }
-
- public Route MapPageRoute (string routeName, string routeUrl, string physicalFile)
- {
- return MapPageRoute (routeName, routeUrl, physicalFile, true, null, null, null);
- }
-
- public Route MapPageRoute (string routeName, string routeUrl, string physicalFile, bool checkPhysicalUrlAccess)
- {
- return MapPageRoute (routeName, routeUrl, physicalFile, checkPhysicalUrlAccess, null, null, null);
- }
-
- public Route MapPageRoute (string routeName, string routeUrl, string physicalFile, bool checkPhysicalUrlAccess,
- RouteValueDictionary defaults)
- {
- return MapPageRoute (routeName, routeUrl, physicalFile, checkPhysicalUrlAccess, defaults, null, null);
- }
-
- public Route MapPageRoute (string routeName, string routeUrl, string physicalFile, bool checkPhysicalUrlAccess,
- RouteValueDictionary defaults, RouteValueDictionary constraints)
- {
- return MapPageRoute (routeName, routeUrl, physicalFile, checkPhysicalUrlAccess, defaults, constraints, null);
- }
-
- public Route MapPageRoute (string routeName, string routeUrl, string physicalFile, bool checkPhysicalUrlAccess,
- RouteValueDictionary defaults, RouteValueDictionary constraints, RouteValueDictionary dataTokens)
- {
- if (routeUrl == null)
- throw new ArgumentNullException ("routeUrl");
-
- var route = new Route (routeUrl, defaults, constraints, dataTokens, new PageRouteHandler (physicalFile, checkPhysicalUrlAccess));
- Add (routeName, route);
-
- return route;
- }
- protected override void InsertItem (int index, RouteBase item)
- {
- // FIXME: what happens wrt its name?
- lock (GetWriteLock ())
- base.InsertItem (index, item);
- }
-
- protected override void RemoveItem (int index)
- {
- // FIXME: what happens wrt its name?
- lock (GetWriteLock ()) {
- string k = GetKey (index);
- base.RemoveItem (index);
- if (k != null)
- d.Remove (k);
- }
- }
-
- protected override void SetItem (int index, RouteBase item)
- {
- // FIXME: what happens wrt its name?
- lock (GetWriteLock ()) {
- string k = GetKey (index);
- base.SetItem (index, item);
- if (k != null)
- d.Remove (k);
- }
- }
-
- string GetKey (int index)
- {
- var item = this [index];
- foreach (var p in d)
- if (p.Value == item)
- return p.Key;
- return null;
- }
- }
-}
+++ /dev/null
-//
-// RouteData.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Web;
-
-namespace System.Web.Routing
-{
- [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class RouteData
- {
- public RouteData ()
- : this (null, null)
- {
- }
-
- public RouteData (RouteBase route, IRouteHandler routeHandler)
- {
- // arguments can be null.
- Route = route;
- RouteHandler = routeHandler;
-
- DataTokens = new RouteValueDictionary ();
- Values = new RouteValueDictionary ();
- }
-
- public RouteValueDictionary DataTokens { get; private set; }
-
- public RouteBase Route { get; set; }
-
- public IRouteHandler RouteHandler { get; set; }
-
- public RouteValueDictionary Values { get; private set; }
-
- public string GetRequiredString (string valueName)
- {
- object o;
- if (!Values.TryGetValue (valueName, out o))
- throw new InvalidOperationException (String.Format ("value name {0} does not match any of the values.", valueName));
- string s = o as string;
- if (String.IsNullOrEmpty (s))
- throw new InvalidOperationException (String.Format ("The value for the name {0} must be a non-empty string", valueName));
- return s;
- }
- }
-}
+++ /dev/null
-//
-// RouteDirection.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-
-namespace System.Web.Routing
-{
- [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- public enum RouteDirection
- {
- IncomingRequest,
- UrlGeneration
- }
-}
+++ /dev/null
-//
-// RouteTable.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Web;
-
-namespace System.Web.Routing
-{
- [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class RouteTable
- {
- static RouteTable ()
- {
- Routes = new RouteCollection ();
- }
-
- public static RouteCollection Routes { get; private set; }
- }
-}
+++ /dev/null
-//
-// RouteValueDictionary.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Web;
-
-using PairCollection = System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string, object>>;
-
-namespace System.Web.Routing
-{
- [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class RouteValueDictionary : IDictionary<string, object>
- {
- internal class CaseInsensitiveStringComparer : IEqualityComparer<string>
- {
- public static readonly CaseInsensitiveStringComparer Instance = new CaseInsensitiveStringComparer ();
-
- public int GetHashCode (string obj)
- {
- return obj.ToLower (CultureInfo.InvariantCulture).GetHashCode ();
- }
-
- public bool Equals (string obj1, string obj2)
- {
- return String.Equals (obj1, obj2, StringComparison.OrdinalIgnoreCase);
- }
- }
-
- Dictionary<string,object> d = new Dictionary<string,object> (CaseInsensitiveStringComparer.Instance);
-
- public RouteValueDictionary ()
- {
- }
-
- public RouteValueDictionary (IDictionary<string, object> dictionary)
- {
- if (dictionary == null)
- throw new ArgumentNullException ("dictionary");
- foreach (var p in dictionary)
- Add (p.Key, p.Value);
- }
-
- public RouteValueDictionary (object values) // anonymous type instance
- {
- if (values == null)
- return;
-
- foreach (var pi in values.GetType ().GetProperties ()) {
- try {
- Add (pi.Name, pi.GetValue (values, null));
- } catch {
- // ignore
- }
- }
- }
-
- public int Count {
- get { return d.Count; }
- }
-
- bool PairCollection.IsReadOnly {
- get { return ((PairCollection) d).IsReadOnly; }
- }
-
- ICollection<string> IDictionary<string, object>.Keys {
- get { return d.Keys; }
- }
-
- ICollection<Object> IDictionary<string, object>.Values {
- get { return d.Values; }
- }
-
- public object this [string key] {
- get { object v; return d.TryGetValue (key, out v) ? v : null; }
- set { d [key] = value; }
- }
-
- public Dictionary<string, object>.KeyCollection Keys {
- get { return d.Keys; }
- }
-
- public Dictionary<string, object>.ValueCollection Values {
- get { return d.Values; }
- }
-
- public void Add (string key, object value)
- {
- d.Add (key, value);
- }
-
- public void Clear ()
- {
- d.Clear ();
- }
-
- public bool ContainsKey (string key)
- {
- return d.ContainsKey (key);
- }
-
- public bool ContainsValue (object value)
- {
- return d.ContainsValue (value);
- }
-
- public Dictionary<string, object>.Enumerator GetEnumerator ()
- {
- return d.GetEnumerator ();
- }
-
- void ICollection<KeyValuePair<string, object>>.Add (KeyValuePair<string, object> item)
- {
- ((PairCollection) d).Add (item);
- }
-
- bool ICollection<KeyValuePair<string, object>>.Contains (KeyValuePair<string, object> item)
- {
- return ((PairCollection) d).Contains (item);
- }
-
- void ICollection<KeyValuePair<string, object>>.CopyTo (KeyValuePair<string, object> [] array, int arrayIndex)
- {
- ((PairCollection) d).CopyTo (array, arrayIndex);
- }
-
- bool ICollection<KeyValuePair<string, object>>.Remove (KeyValuePair<string, object> item)
- {
- return ((PairCollection) d).Remove (item);
- }
-
- IEnumerator<KeyValuePair<string, object>> IEnumerable<KeyValuePair<string, object>>.GetEnumerator()
- {
- return d.GetEnumerator ();
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return d.GetEnumerator ();
- }
-
- public bool Remove (string key)
- {
- return d.Remove (key);
- }
-
- public bool TryGetValue (string key, out object value)
- {
- return d.TryGetValue (key, out value);
- }
- }
-}
+++ /dev/null
-//
-// PatternParser.cs
-//
-// Author:
-// Marek Habersack <mhabersack@novell.com>
-//
-// Copyright (C) 2009 Novell Inc. http://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.
-//
-#if SYSTEMCORE_DEP
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-
-namespace System.Web.Routing
-{
- static class RouteValueDictionaryExtensions
- {
- public static bool Has (this RouteValueDictionary dict, string key)
- {
- if (dict == null)
- return false;
-
- return dict.ContainsKey (key);
- }
-
- public static bool Has (this RouteValueDictionary dict, string key, object value)
- {
- if (dict == null)
- return false;
-
- object entryValue;
- if (dict.TryGetValue (key, out entryValue)) {
- if (value is string) {
- if (!(entryValue is string))
- return false;
-
- string s1 = value as string;
- string s2 = entryValue as string;
- return String.Compare (s1, s2, StringComparison.OrdinalIgnoreCase) == 0;
- }
-
- return entryValue == null ? value == null : entryValue.Equals (value);
- }
-
- return false;
- }
-
- public static bool GetValue (this RouteValueDictionary dict, string key, out object value)
- {
- if (dict == null) {
- value = null;
- return false;
- }
-
- return dict.TryGetValue (key, out value);
- }
-
- [Conditional ("DEBUG")]
- public static void Dump (this RouteValueDictionary dict, string name, string indent)
- {
- if (indent == null)
- indent = String.Empty;
-
- if (dict == null) {
- Console.WriteLine (indent + "Dictionary '{0}' is null", name);
- return;
- }
-
- if (dict.Count == 0) {
- Console.WriteLine (indent + "Dictionary '{0}' is empty", name);
- return;
- }
-
- Console.WriteLine (indent + "Dictionary '{0}':", name);
- foreach (var de in dict)
- Console.WriteLine (indent + "\t'{0}' == {1}", de.Key, de.Value);
- }
- }
-}
-#endif
+++ /dev/null
-//
-// StopRoutingHandler.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Web;
-
-namespace System.Web.Routing
-{
- [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class StopRoutingHandler : IRouteHandler
- {
- protected virtual IHttpHandler GetHttpHandler (RequestContext requestContext)
- {
- throw new NotSupportedException ();
- }
-
- IHttpHandler IRouteHandler.GetHttpHandler (RequestContext requestContext)
- {
- return GetHttpHandler (requestContext);
- }
- }
-}
+++ /dev/null
-//
-// UrlRoutingHandler.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008-2010 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Web;
-
-namespace System.Web.Routing
-{
- [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public abstract class UrlRoutingHandler : IHttpHandler
- {
- RouteCollection routes;
-
- bool IHttpHandler.IsReusable {
- get { return IsReusable; }
- }
-
- protected virtual bool IsReusable { get { return false; } }
-
- public RouteCollection RouteCollection {
- get {
- if (routes == null)
- routes = RouteTable.Routes;
- return routes;
- }
- set { routes = value; }
- }
-
- void IHttpHandler.ProcessRequest (HttpContext context)
- {
- ProcessRequest (context);
- }
-
- protected virtual void ProcessRequest (HttpContext httpContext)
- {
- ProcessRequest (new HttpContextWrapper (httpContext));
- }
-
- protected virtual void ProcessRequest (HttpContextBase httpContext)
- {
- if (httpContext == null)
- throw new ArgumentNullException ("httpContext");
-
- var rd = RouteCollection.GetRouteData (httpContext);
- if (rd == null)
- throw new HttpException ("The incoming request does not match any route");
- if (rd.RouteHandler == null)
- throw new InvalidOperationException ("No IRouteHandler is assigned to the selected route");
-
- RequestContext rc = new RequestContext (httpContext, rd);
-
- var hh = rd.RouteHandler.GetHttpHandler (rc);
- VerifyAndProcessRequest (hh, httpContext);
- }
-
- protected abstract void VerifyAndProcessRequest (IHttpHandler httpHandler, HttpContextBase httpContext);
- }
-}
+++ /dev/null
-//
-// UrlRoutingModule.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Threading;
-using System.Web;
-
-namespace System.Web.Routing
-{
- [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class UrlRoutingModule : IHttpModule
- {
- RouteCollection routes;
- public RouteCollection RouteCollection {
- get {
- if (routes == null)
- routes = RouteTable.Routes;
- return routes;
- }
- set { routes = value; }
- }
-
- protected virtual void Dispose ()
- {
- }
-
- void IHttpModule.Dispose ()
- {
- Dispose ();
- }
-
- void IHttpModule.Init (HttpApplication application)
- {
- Init (application);
- }
-
- protected virtual void Init (HttpApplication application)
- {
- application.PostMapRequestHandler += PostMapRequestHandler;
- application.PostResolveRequestCache += PostResolveRequestCache;
- }
-
- void PostMapRequestHandler (object o, EventArgs e)
- {
- var app = (HttpApplication) o;
- PostMapRequestHandler (new HttpContextWrapper (app.Context));
- }
-
- void PostResolveRequestCache (object o, EventArgs e)
- {
- var app = (HttpApplication) o;
- PostResolveRequestCache (new HttpContextWrapper (app.Context));
- }
- [Obsolete]
- public virtual void PostMapRequestHandler (HttpContextBase context)
- {
- }
-
- [MonoTODO]
- public virtual void PostResolveRequestCache (HttpContextBase context)
- {
- if (context == null)
- throw new ArgumentNullException ("context");
-
- var rd = RouteCollection.GetRouteData (context);
- if (rd == null)
- return; // do nothing
-
- if (rd.RouteHandler == null)
- throw new InvalidOperationException ("No IRouteHandler is assigned to the selected route");
-
- if (rd.RouteHandler is StopRoutingHandler)
- return; //stop further processing
-
- var rc = new RequestContext (context, rd);
-
- IHttpHandler http = rd.RouteHandler.GetHttpHandler (rc);
- if (http == null)
- throw new InvalidOperationException ("The mapped IRouteHandler did not return an IHttpHandler");
- context.Request.RequestContext = rc;
- context.RemapHandler (http);
- }
- }
-}
+++ /dev/null
-//
-// VirtualPathData.cs
-//
-// Author:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
-using System.Security.Permissions;
-using System.Web;
-
-namespace System.Web.Routing
-{
- [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class VirtualPathData
- {
- public VirtualPathData (RouteBase route, string virtualPath)
- {
- // arguments can be null.
- Route = route;
- VirtualPath = virtualPath;
- DataTokens = new RouteValueDictionary ();
- }
-
- public RouteValueDictionary DataTokens { get; private set; }
-
- public RouteBase Route { get; set; }
-
- public string VirtualPath { get; set; }
- }
-}
--- /dev/null
+//
+// HttpMethodConstraint.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Web;
+
+namespace System.Web.Routing
+{
+ [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class HttpMethodConstraint : IRouteConstraint
+ {
+ public HttpMethodConstraint (params string[] allowedMethods)
+ {
+ if (allowedMethods == null)
+ throw new ArgumentNullException ("allowedMethods");
+ AllowedMethods = allowedMethods;
+ }
+
+ public ICollection<string> AllowedMethods { get; private set; }
+
+ bool IRouteConstraint.Match (HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
+ {
+ return Match (httpContext, route, parameterName, values, routeDirection);
+ }
+
+ protected virtual bool Match (HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
+ {
+ if (httpContext == null)
+ throw new ArgumentNullException ("httpContext");
+ if (route == null)
+ throw new ArgumentNullException ("route");
+ if (parameterName == null)
+ throw new ArgumentNullException ("parameterName");
+ if (values == null)
+ throw new ArgumentNullException ("values");
+
+ switch (routeDirection) {
+ case RouteDirection.IncomingRequest:
+ // LAMESPEC: .NET allows case-insensitive comparison, which violates RFC 2616
+ return AllowedMethods.Contains (httpContext.Request.HttpMethod);
+
+ case RouteDirection.UrlGeneration:
+ // See: aspnetwebstack's WebAPI equivalent for details.
+ object method;
+
+ if (!values.TryGetValue (parameterName, out method))
+ return true;
+
+ // LAMESPEC: .NET allows case-insensitive comparison, which violates RFC 2616
+ return AllowedMethods.Contains (Convert.ToString (method));
+
+ default:
+ throw new ArgumentException ("Invalid routeDirection: " + routeDirection);
+ }
+ }
+ }
+}
--- /dev/null
+//
+// IRouteConstraint.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Web;
+
+namespace System.Web.Routing
+{
+ [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ public interface IRouteConstraint
+ {
+ bool Match (HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection);
+ }
+}
--- /dev/null
+//
+// IRouteHandler.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Web;
+
+namespace System.Web.Routing
+{
+ [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ public interface IRouteHandler
+ {
+ IHttpHandler GetHttpHandler (RequestContext requestContext);
+ }
+}
--- /dev/null
+//
+// PatternParser.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+// Marek Habersack <mhabersack@novell.com>
+//
+// Copyright (C) 2008-2010 Novell Inc. http://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.Generic;
+using System.Security.Permissions;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Web;
+using System.Web.Util;
+using System.Diagnostics;
+using System.Globalization;
+
+namespace System.Web.Routing
+{
+ sealed class PatternParser
+ {
+ struct PatternSegment
+ {
+ public bool AllLiteral;
+ public List <PatternToken> Tokens;
+ }
+
+ static readonly char[] placeholderDelimiters = { '{', '}' };
+
+ PatternSegment[] segments;
+ Dictionary <string, bool> parameterNames;
+ PatternToken[] tokens;
+
+ int segmentCount;
+ bool haveSegmentWithCatchAll;
+
+ public string Url {
+ get;
+ private set;
+ }
+
+ public PatternParser (string pattern)
+ {
+ this.Url = pattern;
+ Parse ();
+ }
+
+ void Parse ()
+ {
+ string url = Url;
+ parameterNames = new Dictionary <string, bool> (StringComparer.OrdinalIgnoreCase);
+
+ if (!String.IsNullOrEmpty (url)) {
+ if (url [0] == '~' || url [0] == '/')
+ throw new ArgumentException ("Url must not start with '~' or '/'");
+ if (url.IndexOf ('?') >= 0)
+ throw new ArgumentException ("Url must not contain '?'");
+ } else {
+ segments = new PatternSegment [0];
+ tokens = new PatternToken [0];
+ return;
+ }
+
+ string[] parts = url.Split ('/');
+ int partsCount = segmentCount = parts.Length;
+ var allTokens = new List <PatternToken> ();
+ PatternToken tmpToken;
+
+ segments = new PatternSegment [partsCount];
+
+ for (int i = 0; i < partsCount; i++) {
+ if (haveSegmentWithCatchAll)
+ throw new ArgumentException ("A catch-all parameter can only appear as the last segment of the route URL");
+
+ int catchAlls = 0;
+ string part = parts [i];
+ int partLength = part.Length;
+ var tokens = new List <PatternToken> ();
+
+ if (partLength == 0 && i < partsCount - 1)
+ throw new ArgumentException ("Consecutive URL segment separators '/' are not allowed");
+
+ if (part.IndexOf ("{}") != -1)
+ throw new ArgumentException ("Empty URL parameter name is not allowed");
+
+ if (i > 0)
+ allTokens.Add (null);
+
+ if (part.IndexOfAny (placeholderDelimiters) == -1) {
+ // no placeholders here, short-circuit it
+ tmpToken = new PatternToken (PatternTokenType.Literal, part);
+ tokens.Add (tmpToken);
+ allTokens.Add (tmpToken);
+ segments [i].AllLiteral = true;
+ segments [i].Tokens = tokens;
+ continue;
+ }
+
+ string tmp;
+ int from = 0, start;
+ bool allLiteral = true;
+ while (from < partLength) {
+ start = part.IndexOf ('{', from);
+ if (start >= partLength - 2)
+ throw new ArgumentException ("Unterminated URL parameter. It must contain matching '}'");
+
+ if (start < 0) {
+ if (part.IndexOf ('}', from) >= from)
+ throw new ArgumentException ("Unmatched URL parameter closer '}'. A corresponding '{' must precede");
+ tmp = part.Substring (from);
+ tmpToken = new PatternToken (PatternTokenType.Literal, tmp);
+ tokens.Add (tmpToken);
+ allTokens.Add (tmpToken);
+ from += tmp.Length;
+ break;
+ }
+
+ if (from == 0 && start > 0) {
+ tmpToken = new PatternToken (PatternTokenType.Literal, part.Substring (0, start));
+ tokens.Add (tmpToken);
+ allTokens.Add (tmpToken);
+ }
+
+ int end = part.IndexOf ('}', start + 1);
+ int next = part.IndexOf ('{', start + 1);
+
+ if (end < 0 || next >= 0 && next < end)
+ throw new ArgumentException ("Unterminated URL parameter. It must contain matching '}'");
+ if (next == end + 1)
+ throw new ArgumentException ("Two consecutive URL parameters are not allowed. Split into a different segment by '/', or a literal string.");
+
+ if (next == -1)
+ next = partLength;
+
+ string token = part.Substring (start + 1, end - start - 1);
+ PatternTokenType type;
+ if (token [0] == '*') {
+ catchAlls++;
+ haveSegmentWithCatchAll = true;
+ type = PatternTokenType.CatchAll;
+ token = token.Substring (1);
+ } else
+ type = PatternTokenType.Standard;
+
+ if (!parameterNames.ContainsKey (token))
+ parameterNames.Add (token, true);
+
+ tmpToken = new PatternToken (type, token);
+ tokens.Add (tmpToken);
+ allTokens.Add (tmpToken);
+ allLiteral = false;
+
+ if (end < partLength - 1) {
+ token = part.Substring (end + 1, next - end - 1);
+ tmpToken = new PatternToken (PatternTokenType.Literal, token);
+ tokens.Add (tmpToken);
+ allTokens.Add (tmpToken);
+ end += token.Length;
+ }
+
+ if (catchAlls > 1 || (catchAlls == 1 && tokens.Count > 1))
+ throw new ArgumentException ("A path segment that contains more than one section, such as a literal section or a parameter, cannot contain a catch-all parameter.");
+ from = end + 1;
+ }
+
+ segments [i].AllLiteral = allLiteral;
+ segments [i].Tokens = tokens;
+ }
+
+ if (allTokens.Count > 0)
+ this.tokens = allTokens.ToArray ();
+ allTokens = null;
+ }
+
+ RouteValueDictionary AddDefaults (RouteValueDictionary dict, RouteValueDictionary defaults)
+ {
+ if (defaults != null && defaults.Count > 0) {
+ string key;
+ foreach (var def in defaults) {
+ key = def.Key;
+ if (dict.ContainsKey (key))
+ continue;
+ dict.Add (key, def.Value);
+ }
+ }
+
+ return dict;
+ }
+
+ static bool ParametersAreEqual (object a, object b)
+ {
+ if (a is string && b is string) {
+ return String.Equals (a as string, b as string, StringComparison.OrdinalIgnoreCase);
+ } else {
+ // Parameter may be a boxed value type, need to use .Equals() for comparison
+ return object.Equals (a, b);
+ }
+ }
+
+ static bool ParameterIsNonEmpty (object param)
+ {
+ if (param is string)
+ return !string.IsNullOrEmpty (param as string);
+
+ return param != null;
+ }
+
+ bool IsParameterRequired (string parameterName, RouteValueDictionary defaultValues, out object defaultValue)
+ {
+ foreach (var token in tokens) {
+ if (token == null)
+ continue;
+
+ if (string.Equals (token.Name, parameterName, StringComparison.OrdinalIgnoreCase)) {
+ if (token.Type == PatternTokenType.CatchAll) {
+ defaultValue = null;
+ return false;
+ }
+ }
+ }
+
+ if (defaultValues == null)
+ throw new ArgumentNullException ("defaultValues is null?!");
+
+ return !defaultValues.TryGetValue (parameterName, out defaultValue);
+ }
+
+ static string EscapeReservedCharacters (Match m)
+ {
+ if (m == null)
+ throw new ArgumentNullException("m");
+
+ return Uri.HexEscape (m.Value[0]);
+ }
+
+ static string UriEncode (string str)
+ {
+ if (string.IsNullOrEmpty (str))
+ return str;
+
+ string escape = Uri.EscapeUriString (str);
+ return Regex.Replace (escape, "([#?])", new MatchEvaluator (EscapeReservedCharacters));
+ }
+
+ bool MatchSegment (int segIndex, int argsCount, string[] argSegs, List <PatternToken> tokens, RouteValueDictionary ret)
+ {
+ string pathSegment = argSegs [segIndex];
+ int pathSegmentLength = pathSegment != null ? pathSegment.Length : -1;
+ int startIndex = pathSegmentLength - 1;
+ PatternTokenType tokenType;
+ int tokensCount = tokens.Count;
+ PatternToken token;
+ string tokenName;
+
+ for (int tokenIndex = tokensCount - 1; tokenIndex > -1; tokenIndex--) {
+ token = tokens [tokenIndex];
+ if (startIndex < 0)
+ return false;
+
+ tokenType = token.Type;
+ tokenName = token.Name;
+
+ if (segIndex > segmentCount - 1 || tokenType == PatternTokenType.CatchAll) {
+ var sb = new StringBuilder ();
+
+ for (int j = segIndex; j < argsCount; j++) {
+ if (j > segIndex)
+ sb.Append ('/');
+ sb.Append (argSegs [j]);
+ }
+
+ ret.Add (tokenName, sb.ToString ());
+ break;
+ }
+
+ int scanIndex;
+ if (token.Type == PatternTokenType.Literal) {
+ int nameLen = tokenName.Length;
+ if (startIndex + 1 < nameLen)
+ return false;
+ scanIndex = startIndex - nameLen + 1;
+ if (String.Compare (pathSegment, scanIndex, tokenName, 0, nameLen, StringComparison.OrdinalIgnoreCase) != 0)
+ return false;
+ startIndex = scanIndex - 1;
+ continue;
+ }
+
+ // Standard token
+ int nextTokenIndex = tokenIndex - 1;
+ if (nextTokenIndex < 0) {
+ // First token
+ ret.Add (tokenName, pathSegment.Substring (0, startIndex + 1));
+ continue;
+ }
+
+ if (startIndex == 0)
+ return false;
+
+ var nextToken = tokens [nextTokenIndex];
+ string nextTokenName = nextToken.Name;
+
+ // Skip one char, since there can be no empty segments and if the
+ // current token's value happens to be the same as preceeding
+ // literal text, we'll save some time and complexity.
+ scanIndex = startIndex - 1;
+ int lastIndex = pathSegment.LastIndexOf (nextTokenName, scanIndex, StringComparison.OrdinalIgnoreCase);
+ if (lastIndex == -1)
+ return false;
+
+ lastIndex += nextTokenName.Length - 1;
+
+ string sectionValue = pathSegment.Substring (lastIndex + 1, startIndex - lastIndex);
+ if (String.IsNullOrEmpty (sectionValue))
+ return false;
+
+ ret.Add (tokenName, sectionValue);
+ startIndex = lastIndex;
+ }
+
+ return true;
+ }
+
+ public RouteValueDictionary Match (string path, RouteValueDictionary defaults)
+ {
+ var ret = new RouteValueDictionary ();
+ string url = Url;
+ string [] argSegs;
+ int argsCount;
+
+ if (String.IsNullOrEmpty (path)) {
+ argSegs = null;
+ argsCount = 0;
+ } else {
+ // quick check
+ if (String.Compare (url, path, StringComparison.Ordinal) == 0 && url.IndexOf ('{') < 0)
+ return AddDefaults (ret, defaults);
+
+ argSegs = path.Split ('/');
+ argsCount = argSegs.Length;
+
+ if (String.IsNullOrEmpty (argSegs [argsCount - 1]))
+ argsCount--; // path ends with a trailinig '/'
+ }
+ bool haveDefaults = defaults != null && defaults.Count > 0;
+
+ if (argsCount == 1 && String.IsNullOrEmpty (argSegs [0]))
+ argsCount = 0;
+
+ if (!haveDefaults && ((haveSegmentWithCatchAll && argsCount < segmentCount) || (!haveSegmentWithCatchAll && argsCount != segmentCount)))
+ return null;
+
+ int i = 0;
+
+ foreach (PatternSegment segment in segments) {
+ if (i >= argsCount)
+ break;
+
+ if (segment.AllLiteral) {
+ if (String.Compare (argSegs [i], segment.Tokens [0].Name, StringComparison.OrdinalIgnoreCase) != 0)
+ return null;
+ i++;
+ continue;
+ }
+
+ if (!MatchSegment (i, argsCount, argSegs, segment.Tokens, ret))
+ return null;
+ i++;
+ }
+
+ // Check the remaining segments, if any, and see if they are required
+ //
+ // If a segment has more than one section (i.e. there's at least one
+ // literal, then it cannot match defaults
+ //
+ // All of the remaining segments must have all defaults provided and they
+ // must not be literals or the match will fail.
+ if (i < segmentCount) {
+ if (!haveDefaults)
+ return null;
+
+ for (;i < segmentCount; i++) {
+ var segment = segments [i];
+ if (segment.AllLiteral)
+ return null;
+
+ var tokens = segment.Tokens;
+ if (tokens.Count != 1)
+ return null;
+
+ // if token is catch-all, we're done.
+ if (tokens [0].Type == PatternTokenType.CatchAll)
+ break;
+
+ if (!defaults.ContainsKey (tokens [0].Name))
+ return null;
+ }
+ } else if (!haveSegmentWithCatchAll && argsCount > segmentCount)
+ return null;
+
+ return AddDefaults (ret, defaults);
+ }
+
+ public string BuildUrl (Route route, RequestContext requestContext, RouteValueDictionary userValues, RouteValueDictionary constraints, out RouteValueDictionary usedValues)
+ {
+ usedValues = null;
+
+ if (requestContext == null)
+ return null;
+
+ RouteData routeData = requestContext.RouteData;
+ var currentValues = routeData.Values ?? new RouteValueDictionary ();
+ var values = userValues ?? new RouteValueDictionary ();
+ var defaultValues = (route != null ? route.Defaults : null) ?? new RouteValueDictionary ();
+
+ // The set of values we should be using when generating the URL in this route
+ var acceptedValues = new RouteValueDictionary ();
+
+ // Keep track of which new values have been used
+ HashSet<string> unusedNewValues = new HashSet<string> (values.Keys, StringComparer.OrdinalIgnoreCase);
+
+ // This route building logic is based on System.Web.Http's Routing code (which is Apache Licensed by MS)
+ // and which can be found at mono's external/aspnetwebstack/src/System.Web.Http/Routing/HttpParsedRoute.cs
+ // Hopefully this will ensure a much higher compatiblity with MS.NET's System.Web.Routing logic. (pruiz)
+
+ #region Step 1: Get the list of values we're going to use to match and generate this URL
+ // Find out which entries in the URL are valid for the URL we want to generate.
+ // If the URL had ordered parameters a="1", b="2", c="3" and the new values
+ // specified that b="9", then we need to invalidate everything after it. The new
+ // values should then be a="1", b="9", c=<no value>.
+ foreach (var item in parameterNames) {
+ var parameterName = item.Key;
+
+ object newParameterValue;
+ bool hasNewParameterValue = values.TryGetValue (parameterName, out newParameterValue);
+ if (hasNewParameterValue) {
+ unusedNewValues.Remove(parameterName);
+ }
+
+ object currentParameterValue;
+ bool hasCurrentParameterValue = currentValues.TryGetValue (parameterName, out currentParameterValue);
+
+ if (hasNewParameterValue && hasCurrentParameterValue) {
+ if (!ParametersAreEqual (currentParameterValue, newParameterValue)) {
+ // Stop copying current values when we find one that doesn't match
+ break;
+ }
+ }
+
+ // If the parameter is a match, add it to the list of values we will use for URL generation
+ if (hasNewParameterValue) {
+ if (ParameterIsNonEmpty (newParameterValue)) {
+ acceptedValues.Add (parameterName, newParameterValue);
+ }
+ }
+ else {
+ if (hasCurrentParameterValue) {
+ acceptedValues.Add (parameterName, currentParameterValue);
+ }
+ }
+ }
+
+ // Add all remaining new values to the list of values we will use for URL generation
+ foreach (var newValue in values) {
+ if (ParameterIsNonEmpty (newValue.Value) && !acceptedValues.ContainsKey (newValue.Key)) {
+ acceptedValues.Add (newValue.Key, newValue.Value);
+ }
+ }
+
+ // Add all current values that aren't in the URL at all
+ foreach (var currentValue in currentValues) {
+ if (!acceptedValues.ContainsKey (currentValue.Key) && !parameterNames.ContainsKey (currentValue.Key)) {
+ acceptedValues.Add (currentValue.Key, currentValue.Value);
+ }
+ }
+
+ // Add all remaining default values from the route to the list of values we will use for URL generation
+ foreach (var item in parameterNames) {
+ object defaultValue;
+ if (!acceptedValues.ContainsKey (item.Key) && !IsParameterRequired (item.Key, defaultValues, out defaultValue)) {
+ // Add the default value only if there isn't already a new value for it and
+ // only if it actually has a default value, which we determine based on whether
+ // the parameter value is required.
+ acceptedValues.Add (item.Key, defaultValue);
+ }
+ }
+
+ // All required parameters in this URL must have values from somewhere (i.e. the accepted values)
+ foreach (var item in parameterNames) {
+ object defaultValue;
+ if (IsParameterRequired (item.Key, defaultValues, out defaultValue) && !acceptedValues.ContainsKey (item.Key)) {
+ // If the route parameter value is required that means there's
+ // no default value, so if there wasn't a new value for it
+ // either, this route won't match.
+ return null;
+ }
+ }
+
+ // All other default values must match if they are explicitly defined in the new values
+ var otherDefaultValues = new RouteValueDictionary (defaultValues);
+ foreach (var item in parameterNames) {
+ otherDefaultValues.Remove (item.Key);
+ }
+
+ foreach (var defaultValue in otherDefaultValues) {
+ object value;
+ if (values.TryGetValue (defaultValue.Key, out value)) {
+ unusedNewValues.Remove (defaultValue.Key);
+ if (!ParametersAreEqual (value, defaultValue.Value)) {
+ // If there is a non-parameterized value in the route and there is a
+ // new value for it and it doesn't match, this route won't match.
+ return null;
+ }
+ }
+ }
+ #endregion
+
+ #region Step 2: If the route is a match generate the appropriate URL
+
+ var uri = new StringBuilder ();
+ var pendingParts = new StringBuilder ();
+ var pendingPartsAreAllSafe = false;
+ bool blockAllUriAppends = false;
+ var allSegments = new List<PatternSegment?> ();
+
+ // Build a list of segments plus separators we can use as template.
+ foreach (var segment in segments) {
+ if (allSegments.Count > 0)
+ allSegments.Add (null); // separator exposed as null.
+ allSegments.Add (segment);
+ }
+
+ // Finally loop thru al segment-templates building the actual uri.
+ foreach (var item in allSegments) {
+ var segment = item.GetValueOrDefault ();
+
+ // If segment is a separator..
+ if (item == null) {
+ if (pendingPartsAreAllSafe) {
+ // Accept
+ if (pendingParts.Length > 0) {
+ if (blockAllUriAppends)
+ return null;
+
+ // Append any pending literals to the URL
+ uri.Append (pendingParts.ToString ());
+ pendingParts.Length = 0;
+ }
+ }
+ pendingPartsAreAllSafe = false;
+
+ // Guard against appending multiple separators for empty segments
+ if (pendingParts.Length > 0 && pendingParts[pendingParts.Length - 1] == '/') {
+ // Dev10 676725: Route should not be matched if that causes mismatched tokens
+ // Dev11 86819: We will allow empty matches if all subsequent segments are null
+ if (blockAllUriAppends)
+ return null;
+
+ // Append any pending literals to the URI (without the trailing slash) and prevent any future appends
+ uri.Append(pendingParts.ToString (0, pendingParts.Length - 1));
+ pendingParts.Length = 0;
+ } else {
+ pendingParts.Append ("/");
+ }
+#if false
+ } else if (segment.AllLiteral) {
+ // Spezial (optimized) case: all elements of segment are literals.
+ pendingPartsAreAllSafe = true;
+ foreach (var tk in segment.Tokens)
+ pendingParts.Append (tk.Name);
+#endif
+ } else {
+ // Segments are treated as all-or-none. We should never output a partial segment.
+ // If we add any subsegment of this segment to the generated URL, we have to add
+ // the complete match. For example, if the subsegment is "{p1}-{p2}.xml" and we
+ // used a value for {p1}, we have to output the entire segment up to the next "/".
+ // Otherwise we could end up with the partial segment "v1" instead of the entire
+ // segment "v1-v2.xml".
+ bool addedAnySubsegments = false;
+
+ foreach (var token in segment.Tokens) {
+ if (token.Type == PatternTokenType.Literal) {
+ // If it's a literal we hold on to it until we are sure we need to add it
+ pendingPartsAreAllSafe = true;
+ pendingParts.Append (token.Name);
+ } else {
+ if (token.Type == PatternTokenType.Standard || token.Type == PatternTokenType.CatchAll) {
+ if (pendingPartsAreAllSafe) {
+ // Accept
+ if (pendingParts.Length > 0) {
+ if (blockAllUriAppends)
+ return null;
+
+ // Append any pending literals to the URL
+ uri.Append (pendingParts.ToString ());
+ pendingParts.Length = 0;
+
+ addedAnySubsegments = true;
+ }
+ }
+ pendingPartsAreAllSafe = false;
+
+ // If it's a parameter, get its value
+ object acceptedParameterValue;
+ bool hasAcceptedParameterValue = acceptedValues.TryGetValue (token.Name, out acceptedParameterValue);
+ if (hasAcceptedParameterValue)
+ unusedNewValues.Remove (token.Name);
+
+ object defaultParameterValue;
+ defaultValues.TryGetValue (token.Name, out defaultParameterValue);
+
+ if (ParametersAreEqual (acceptedParameterValue, defaultParameterValue)) {
+ // If the accepted value is the same as the default value, mark it as pending since
+ // we won't necessarily add it to the URL we generate.
+ pendingParts.Append (Convert.ToString (acceptedParameterValue, CultureInfo.InvariantCulture));
+ } else {
+ if (blockAllUriAppends)
+ return null;
+
+ // Add the new part to the URL as well as any pending parts
+ if (pendingParts.Length > 0) {
+ // Append any pending literals to the URL
+ uri.Append (pendingParts.ToString ());
+ pendingParts.Length = 0;
+ }
+ uri.Append (Convert.ToString (acceptedParameterValue, CultureInfo.InvariantCulture));
+
+ addedAnySubsegments = true;
+ }
+ } else {
+ Debug.Fail ("Invalid path subsegment type");
+ }
+ }
+ }
+
+ if (addedAnySubsegments) {
+ // See comment above about why we add the pending parts
+ if (pendingParts.Length > 0) {
+ if (blockAllUriAppends)
+ return null;
+
+ // Append any pending literals to the URL
+ uri.Append (pendingParts.ToString ());
+ pendingParts.Length = 0;
+ }
+ }
+ }
+ }
+
+ if (pendingPartsAreAllSafe) {
+ // Accept
+ if (pendingParts.Length > 0) {
+ if (blockAllUriAppends)
+ return null;
+
+ // Append any pending literals to the URI
+ uri.Append (pendingParts.ToString ());
+ }
+ }
+
+ // Process constraints keys
+ if (constraints != null) {
+ // If there are any constraints, mark all the keys as being used so that we don't
+ // generate query string items for custom constraints that don't appear as parameters
+ // in the URI format.
+ foreach (var constraintsItem in constraints) {
+ unusedNewValues.Remove (constraintsItem.Key);
+ }
+ }
+
+ // Encode the URI before we append the query string, otherwise we would double encode the query string
+ var encodedUri = new StringBuilder ();
+ encodedUri.Append (UriEncode (uri.ToString ()));
+ uri = encodedUri;
+
+ // Add remaining new values as query string parameters to the URI
+ if (unusedNewValues.Count > 0) {
+ // Generate the query string
+ bool firstParam = true;
+ foreach (string unusedNewValue in unusedNewValues) {
+ object value;
+ if (acceptedValues.TryGetValue (unusedNewValue, out value)) {
+ uri.Append (firstParam ? '?' : '&');
+ firstParam = false;
+ uri.Append (Uri.EscapeDataString (unusedNewValue));
+ uri.Append ('=');
+ uri.Append (Uri.EscapeDataString (Convert.ToString (value, CultureInfo.InvariantCulture)));
+ }
+ }
+ }
+
+ #endregion
+
+ usedValues = acceptedValues;
+ return uri.ToString();
+ }
+ }
+}
+
--- /dev/null
+//
+// PatternToken.cs
+//
+// Author:
+// Marek Habersack <mhabersack@novell.com>
+//
+// Copyright (C) 2009 Novell Inc. http://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.Text;
+using System.Web;
+
+namespace System.Web.Routing
+{
+ sealed class PatternToken
+ {
+ public PatternTokenType Type {
+ get;
+ private set;
+ }
+
+ public string Name {
+ get;
+ private set;
+ }
+
+ public PatternToken (PatternTokenType type, string name)
+ {
+ this.Type = type;
+ this.Name = name;
+ }
+
+ public override string ToString ()
+ {
+ StringBuilder sb = new StringBuilder ();
+
+ switch (Type) {
+ case PatternTokenType.Standard:
+ sb.Append ("PatternToken_Standard");
+ break;
+
+ case PatternTokenType.Literal:
+ sb.Append ("PatternToken_Literal");
+ break;
+
+ case PatternTokenType.CatchAll:
+ sb.Append ("PatternToken_CatchAll");
+ break;
+
+ default:
+ sb.Append ("PatternToken_UNKNOWN");
+ break;
+ }
+
+ sb.AppendFormat (" [Name = '{0}']", Name);
+
+ return sb.ToString ();
+ }
+ }
+}
--- /dev/null
+//
+// PatternTokenType.cs
+//
+// Author:
+// Marek Habersack <mhabersack@novell.com>
+//
+// Copyright (C) 2009 Novell Inc. http://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.Routing
+{
+ enum PatternTokenType
+ {
+ Standard,
+ Literal,
+ CatchAll
+ }
+}
--- /dev/null
+//
+// RequestContext.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Web;
+
+namespace System.Web.Routing
+{
+ [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class RequestContext
+ {
+ public RequestContext ()
+ {
+ HttpContext = null;
+ RouteData = null;
+ }
+ public RequestContext (HttpContextBase httpContext, RouteData routeData)
+ {
+ if (httpContext == null)
+ throw new ArgumentNullException ("httpContext");
+ if (routeData == null)
+ throw new ArgumentNullException ("routeData");
+
+ HttpContext = httpContext;
+ RouteData = routeData;
+ }
+
+ public virtual HttpContextBase HttpContext { get; set; }
+ public virtual RouteData RouteData { get; set; }
+ }
+}
--- /dev/null
+//
+// Route.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Text.RegularExpressions;
+using System.Web;
+using System.Globalization;
+
+namespace System.Web.Routing
+{
+ [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class Route : RouteBase
+ {
+ static readonly Type httpRequestBaseType = typeof (HttpRequestBase);
+ PatternParser url;
+
+ public RouteValueDictionary Constraints { get; set; }
+
+ public RouteValueDictionary DataTokens { get; set; }
+
+ public RouteValueDictionary Defaults { get; set; }
+
+ public IRouteHandler RouteHandler { get; set; }
+
+ public string Url {
+ get { return url != null ? url.Url : String.Empty; }
+ set { url = value != null ? new PatternParser (value) : new PatternParser (String.Empty); }
+ }
+
+ public Route (string url, IRouteHandler routeHandler)
+ : this (url, null, routeHandler)
+ {
+ }
+
+ public Route (string url, RouteValueDictionary defaults, IRouteHandler routeHandler)
+ : this (url, defaults, null, routeHandler)
+ {
+ }
+
+ public Route (string url, RouteValueDictionary defaults, RouteValueDictionary constraints, IRouteHandler routeHandler)
+ : this (url, defaults, constraints, null, routeHandler)
+ {
+ }
+
+ public Route (string url, RouteValueDictionary defaults, RouteValueDictionary constraints, RouteValueDictionary dataTokens, IRouteHandler routeHandler)
+ {
+ Url = url;
+ Defaults = defaults;
+ Constraints = constraints;
+ DataTokens = dataTokens;
+ RouteHandler = routeHandler;
+ }
+
+ public override RouteData GetRouteData (HttpContextBase httpContext)
+ {
+ var path = httpContext.Request.AppRelativeCurrentExecutionFilePath;
+ var pathInfo = httpContext.Request.PathInfo;
+
+ if (!String.IsNullOrEmpty (pathInfo))
+ path += pathInfo;
+
+ // probably code like this causes ArgumentOutOfRangeException under .NET.
+ // It somehow allows such path that is completely equivalent to the Url. Dunno why.
+ if (Url != path && path.Substring (0, 2) != "~/")
+ return null;
+ path = path.Substring (2);
+
+ var values = url.Match (path, Defaults);
+ if (values == null)
+ return null;
+
+ if (!ProcessConstraints (httpContext, values, RouteDirection.IncomingRequest))
+ return null;
+
+ var rd = new RouteData (this, RouteHandler);
+ RouteValueDictionary rdValues = rd.Values;
+
+ foreach (var p in values)
+ rdValues.Add (p.Key, p.Value);
+
+ RouteValueDictionary dataTokens = DataTokens;
+ if (dataTokens != null) {
+ RouteValueDictionary rdDataTokens = rd.DataTokens;
+ foreach (var token in dataTokens)
+ rdDataTokens.Add (token.Key, token.Value);
+ }
+
+ return rd;
+ }
+
+ public override VirtualPathData GetVirtualPath (RequestContext requestContext, RouteValueDictionary values)
+ {
+ if (requestContext == null)
+ throw new ArgumentNullException ("requestContext");
+ if (url == null)
+ return new VirtualPathData (this, String.Empty);
+
+ // null values is allowed.
+ // if (values == null)
+ // values = requestContext.RouteData.Values;
+
+ RouteValueDictionary usedValues;
+ string resultUrl = url.BuildUrl (this, requestContext, values, Constraints, out usedValues);
+
+ if (resultUrl == null)
+ return null;
+
+ if (!ProcessConstraints (requestContext.HttpContext, usedValues, RouteDirection.UrlGeneration))
+ return null;
+
+ var result = new VirtualPathData (this, resultUrl);
+
+ RouteValueDictionary dataTokens = DataTokens;
+ if (dataTokens != null) {
+ foreach (var item in dataTokens)
+ result.DataTokens[item.Key] = item.Value;
+ }
+
+ return result;
+ }
+
+ private bool ProcessConstraintInternal (HttpContextBase httpContext, Route route, object constraint, string parameterName,
+ RouteValueDictionary values, RouteDirection routeDirection, RequestContext reqContext,
+ out bool invalidConstraint)
+ {
+ invalidConstraint = false;
+ IRouteConstraint irc = constraint as IRouteConstraint;
+ if (irc != null)
+ return irc.Match (httpContext, route, parameterName, values, routeDirection);
+
+ string s = constraint as string;
+ if (s != null) {
+ string v = null;
+ object o;
+
+ // NOTE: If constraint was not an IRouteConstraint, is is asumed
+ // to be an object 'convertible' to string, or at least this is how
+ // ASP.NET seems to work by the tests i've done latelly. (pruiz)
+
+ if (values != null && values.TryGetValue (parameterName, out o))
+ v = Convert.ToString (o, CultureInfo.InvariantCulture);
+
+ if (!String.IsNullOrEmpty (v))
+ return MatchConstraintRegex (v, s);
+ else if (reqContext != null) {
+ RouteData rd = reqContext != null ? reqContext.RouteData : null;
+ RouteValueDictionary rdValues = rd != null ? rd.Values : null;
+
+ if (rdValues == null || rdValues.Count == 0)
+ return false;
+
+ if (!rdValues.TryGetValue (parameterName, out o))
+ return false;
+
+ v = Convert.ToString (o, CultureInfo.InvariantCulture);
+ if (String.IsNullOrEmpty (v))
+ return false;
+
+ return MatchConstraintRegex (v, s);
+ }
+ return false;
+ }
+
+ invalidConstraint = true;
+ return false;
+ }
+
+ static bool MatchConstraintRegex (string value, string constraint)
+ {
+ int len = constraint.Length;
+ if (len > 0) {
+ // Bug #651966 - regexp constraints must be treated
+ // as absolute expressions
+ if (constraint [0] != '^') {
+ constraint = "^" + constraint;
+ len++;
+ }
+
+ if (constraint [len - 1] != '$')
+ constraint += "$";
+ }
+
+ return Regex.IsMatch (value, constraint, RegexOptions.CultureInvariant | RegexOptions.IgnoreCase | RegexOptions.Compiled);
+ }
+
+ protected virtual bool ProcessConstraint (HttpContextBase httpContext, object constraint, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
+ {
+ if (parameterName == null)
+ throw new ArgumentNullException ("parameterName");
+
+ // .NET "compatibility"
+ if (values == null)
+ throw new NullReferenceException ();
+
+ RequestContext reqContext;
+ reqContext = SafeGetContext (httpContext != null ? httpContext.Request : null);
+ bool invalidConstraint;
+ bool ret = ProcessConstraintInternal (httpContext, this, constraint, parameterName, values, routeDirection, reqContext, out invalidConstraint);
+
+ if (invalidConstraint)
+ throw new InvalidOperationException (
+ String.Format (
+ "Constraint parameter '{0}' on the route with URL '{1}' must have a string value type or be a type which implements IRouteConstraint",
+ parameterName, Url
+ )
+ );
+
+ return ret;
+ }
+
+ private bool ProcessConstraints (HttpContextBase httpContext, RouteValueDictionary values, RouteDirection routeDirection)
+ {
+ var constraints = Constraints;
+
+ if (Constraints != null) {
+ foreach (var p in constraints)
+ if (!ProcessConstraint (httpContext, p.Value, p.Key, values, routeDirection))
+ return false;
+ }
+
+ return true;
+ }
+
+ RequestContext SafeGetContext (HttpRequestBase req)
+ {
+ if (req == null || req.GetType () != httpRequestBaseType)
+ return null;
+
+ return req.RequestContext;
+ }
+ }
+}
--- /dev/null
+//
+// RouteBase.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Web;
+
+namespace System.Web.Routing
+{
+ [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public abstract class RouteBase
+ {
+ public abstract RouteData GetRouteData (HttpContextBase httpContext);
+ public abstract VirtualPathData GetVirtualPath (RequestContext requestContext, RouteValueDictionary values);
+ }
+}
--- /dev/null
+//
+// RouteCollection.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Collections.ObjectModel;
+using System.IO;
+using System.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Web;
+using System.Web.Hosting;
+
+namespace System.Web.Routing
+{
+ [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class RouteCollection : Collection<RouteBase>
+ {
+ class Lock : IDisposable
+ {
+ //RouteCollection owner;
+ //bool read;
+
+ public Lock (RouteCollection owner, bool read)
+ {
+ //this.owner = owner;
+ //this.read = read;
+ }
+
+ public void Dispose ()
+ {
+ //if (read)
+ // owner.read_lock = null;
+ //else
+ // owner_write_lock = null;
+ }
+ }
+
+ public RouteCollection ()
+ : this (null)
+ {
+ }
+
+ public RouteCollection (VirtualPathProvider virtualPathProvider)
+ {
+ // null argument is allowed
+ //provider = virtualPathProvider;
+
+ read_lock = new Lock (this, true);
+ write_lock = new Lock (this, false);
+ }
+
+ //VirtualPathProvider provider;
+ Dictionary<string,RouteBase> d = new Dictionary<string,RouteBase> ();
+
+ Lock read_lock, write_lock;
+
+ public RouteBase this [string name] {
+ get {
+ foreach (var p in d)
+ if (p.Key == name)
+ return p.Value;
+ return null;
+ }
+ }
+
+ public bool LowercaseUrls { get; set; }
+ public bool AppendTrailingSlash { get; set; }
+ public bool RouteExistingFiles { get; set; }
+
+ public void Add (string name, RouteBase item)
+ {
+ lock (GetWriteLock ()) {
+ base.Add (item);
+ if (!String.IsNullOrEmpty (name))
+ d.Add (name, item);
+ }
+ }
+
+ protected override void ClearItems ()
+ {
+ lock (GetWriteLock ())
+ base.ClearItems ();
+ }
+
+ public IDisposable GetReadLock ()
+ {
+ return read_lock;
+ }
+
+ public RouteData GetRouteData (HttpContextBase httpContext)
+ {
+ if (httpContext == null)
+ throw new ArgumentNullException ("httpContext");
+
+ if (httpContext.Request == null)
+ throw new ArgumentException ("The context does not contain any request data.", "httpContext");
+ if (Count == 0)
+ return null;
+ if (!RouteExistingFiles) {
+ var path = httpContext.Request.AppRelativeCurrentExecutionFilePath;
+ VirtualPathProvider vpp = HostingEnvironment.VirtualPathProvider;
+ if (path != "~/" && vpp != null && (vpp.FileExists (path) || vpp.DirectoryExists (path)))
+ return null;
+ }
+ foreach (RouteBase rb in this) {
+ var rd = rb.GetRouteData (httpContext);
+ if (rd != null)
+ return rd;
+ }
+
+ return null;
+ }
+
+ public VirtualPathData GetVirtualPath (RequestContext requestContext, RouteValueDictionary values)
+ {
+ return GetVirtualPath (requestContext, null, values);
+ }
+
+ public VirtualPathData GetVirtualPath (RequestContext requestContext, string name, RouteValueDictionary values)
+ {
+ if (requestContext == null)
+ throw new ArgumentNullException ("httpContext");
+ VirtualPathData vp = null;
+ if (!String.IsNullOrEmpty (name)) {
+ RouteBase rb = this [name];
+ if (rb != null)
+ vp = rb.GetVirtualPath (requestContext, values);
+ else
+ throw new ArgumentException ("A route named '" + name + "' could not be found in the route collection.", "name");
+ } else {
+ foreach (RouteBase rb in this) {
+ vp = rb.GetVirtualPath (requestContext, values);
+ if (vp != null)
+ break;
+ }
+ }
+
+ if (vp != null) {
+ string appPath = requestContext.HttpContext.Request.ApplicationPath;
+ if (appPath != null && (appPath.Length == 0 || !appPath.EndsWith ("/", StringComparison.Ordinal)))
+ appPath += "/";
+
+ string pathWithApp = String.Concat (appPath, vp.VirtualPath);
+ vp.VirtualPath = requestContext.HttpContext.Response.ApplyAppPathModifier (pathWithApp);
+ return vp;
+ }
+
+ return null;
+ }
+
+ public IDisposable GetWriteLock ()
+ {
+ return write_lock;
+ }
+ public void Ignore (string url)
+ {
+ Ignore (url, null);
+ }
+
+ public void Ignore (string url, object constraints)
+ {
+ if (url == null)
+ throw new ArgumentNullException ("url");
+
+ Add (new Route (url, null, new RouteValueDictionary (constraints), new StopRoutingHandler ()));
+ }
+
+ public Route MapPageRoute (string routeName, string routeUrl, string physicalFile)
+ {
+ return MapPageRoute (routeName, routeUrl, physicalFile, true, null, null, null);
+ }
+
+ public Route MapPageRoute (string routeName, string routeUrl, string physicalFile, bool checkPhysicalUrlAccess)
+ {
+ return MapPageRoute (routeName, routeUrl, physicalFile, checkPhysicalUrlAccess, null, null, null);
+ }
+
+ public Route MapPageRoute (string routeName, string routeUrl, string physicalFile, bool checkPhysicalUrlAccess,
+ RouteValueDictionary defaults)
+ {
+ return MapPageRoute (routeName, routeUrl, physicalFile, checkPhysicalUrlAccess, defaults, null, null);
+ }
+
+ public Route MapPageRoute (string routeName, string routeUrl, string physicalFile, bool checkPhysicalUrlAccess,
+ RouteValueDictionary defaults, RouteValueDictionary constraints)
+ {
+ return MapPageRoute (routeName, routeUrl, physicalFile, checkPhysicalUrlAccess, defaults, constraints, null);
+ }
+
+ public Route MapPageRoute (string routeName, string routeUrl, string physicalFile, bool checkPhysicalUrlAccess,
+ RouteValueDictionary defaults, RouteValueDictionary constraints, RouteValueDictionary dataTokens)
+ {
+ if (routeUrl == null)
+ throw new ArgumentNullException ("routeUrl");
+
+ var route = new Route (routeUrl, defaults, constraints, dataTokens, new PageRouteHandler (physicalFile, checkPhysicalUrlAccess));
+ Add (routeName, route);
+
+ return route;
+ }
+ protected override void InsertItem (int index, RouteBase item)
+ {
+ // FIXME: what happens wrt its name?
+ lock (GetWriteLock ())
+ base.InsertItem (index, item);
+ }
+
+ protected override void RemoveItem (int index)
+ {
+ // FIXME: what happens wrt its name?
+ lock (GetWriteLock ()) {
+ string k = GetKey (index);
+ base.RemoveItem (index);
+ if (k != null)
+ d.Remove (k);
+ }
+ }
+
+ protected override void SetItem (int index, RouteBase item)
+ {
+ // FIXME: what happens wrt its name?
+ lock (GetWriteLock ()) {
+ string k = GetKey (index);
+ base.SetItem (index, item);
+ if (k != null)
+ d.Remove (k);
+ }
+ }
+
+ string GetKey (int index)
+ {
+ var item = this [index];
+ foreach (var p in d)
+ if (p.Value == item)
+ return p.Key;
+ return null;
+ }
+ }
+}
--- /dev/null
+//
+// RouteData.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Web;
+
+namespace System.Web.Routing
+{
+ [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class RouteData
+ {
+ public RouteData ()
+ : this (null, null)
+ {
+ }
+
+ public RouteData (RouteBase route, IRouteHandler routeHandler)
+ {
+ // arguments can be null.
+ Route = route;
+ RouteHandler = routeHandler;
+
+ DataTokens = new RouteValueDictionary ();
+ Values = new RouteValueDictionary ();
+ }
+
+ public RouteValueDictionary DataTokens { get; private set; }
+
+ public RouteBase Route { get; set; }
+
+ public IRouteHandler RouteHandler { get; set; }
+
+ public RouteValueDictionary Values { get; private set; }
+
+ public string GetRequiredString (string valueName)
+ {
+ object o;
+ if (!Values.TryGetValue (valueName, out o))
+ throw new InvalidOperationException (String.Format ("value name {0} does not match any of the values.", valueName));
+ string s = o as string;
+ if (String.IsNullOrEmpty (s))
+ throw new InvalidOperationException (String.Format ("The value for the name {0} must be a non-empty string", valueName));
+ return s;
+ }
+ }
+}
--- /dev/null
+//
+// RouteDirection.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+
+namespace System.Web.Routing
+{
+ [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ public enum RouteDirection
+ {
+ IncomingRequest,
+ UrlGeneration
+ }
+}
--- /dev/null
+//
+// RouteTable.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Web;
+
+namespace System.Web.Routing
+{
+ [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class RouteTable
+ {
+ static RouteTable ()
+ {
+ Routes = new RouteCollection ();
+ }
+
+ public static RouteCollection Routes { get; private set; }
+ }
+}
--- /dev/null
+//
+// RouteValueDictionary.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Web;
+
+using PairCollection = System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string, object>>;
+
+namespace System.Web.Routing
+{
+ [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class RouteValueDictionary : IDictionary<string, object>
+ {
+ internal class CaseInsensitiveStringComparer : IEqualityComparer<string>
+ {
+ public static readonly CaseInsensitiveStringComparer Instance = new CaseInsensitiveStringComparer ();
+
+ public int GetHashCode (string obj)
+ {
+ return obj.ToLower (CultureInfo.InvariantCulture).GetHashCode ();
+ }
+
+ public bool Equals (string obj1, string obj2)
+ {
+ return String.Equals (obj1, obj2, StringComparison.OrdinalIgnoreCase);
+ }
+ }
+
+ Dictionary<string,object> d = new Dictionary<string,object> (CaseInsensitiveStringComparer.Instance);
+
+ public RouteValueDictionary ()
+ {
+ }
+
+ public RouteValueDictionary (IDictionary<string, object> dictionary)
+ {
+ if (dictionary == null)
+ throw new ArgumentNullException ("dictionary");
+ foreach (var p in dictionary)
+ Add (p.Key, p.Value);
+ }
+
+ public RouteValueDictionary (object values) // anonymous type instance
+ {
+ if (values == null)
+ return;
+
+ foreach (var pi in values.GetType ().GetProperties ()) {
+ try {
+ Add (pi.Name, pi.GetValue (values, null));
+ } catch {
+ // ignore
+ }
+ }
+ }
+
+ public int Count {
+ get { return d.Count; }
+ }
+
+ bool PairCollection.IsReadOnly {
+ get { return ((PairCollection) d).IsReadOnly; }
+ }
+
+ ICollection<string> IDictionary<string, object>.Keys {
+ get { return d.Keys; }
+ }
+
+ ICollection<Object> IDictionary<string, object>.Values {
+ get { return d.Values; }
+ }
+
+ public object this [string key] {
+ get { object v; return d.TryGetValue (key, out v) ? v : null; }
+ set { d [key] = value; }
+ }
+
+ public Dictionary<string, object>.KeyCollection Keys {
+ get { return d.Keys; }
+ }
+
+ public Dictionary<string, object>.ValueCollection Values {
+ get { return d.Values; }
+ }
+
+ public void Add (string key, object value)
+ {
+ d.Add (key, value);
+ }
+
+ public void Clear ()
+ {
+ d.Clear ();
+ }
+
+ public bool ContainsKey (string key)
+ {
+ return d.ContainsKey (key);
+ }
+
+ public bool ContainsValue (object value)
+ {
+ return d.ContainsValue (value);
+ }
+
+ public Dictionary<string, object>.Enumerator GetEnumerator ()
+ {
+ return d.GetEnumerator ();
+ }
+
+ void ICollection<KeyValuePair<string, object>>.Add (KeyValuePair<string, object> item)
+ {
+ ((PairCollection) d).Add (item);
+ }
+
+ bool ICollection<KeyValuePair<string, object>>.Contains (KeyValuePair<string, object> item)
+ {
+ return ((PairCollection) d).Contains (item);
+ }
+
+ void ICollection<KeyValuePair<string, object>>.CopyTo (KeyValuePair<string, object> [] array, int arrayIndex)
+ {
+ ((PairCollection) d).CopyTo (array, arrayIndex);
+ }
+
+ bool ICollection<KeyValuePair<string, object>>.Remove (KeyValuePair<string, object> item)
+ {
+ return ((PairCollection) d).Remove (item);
+ }
+
+ IEnumerator<KeyValuePair<string, object>> IEnumerable<KeyValuePair<string, object>>.GetEnumerator()
+ {
+ return d.GetEnumerator ();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator ()
+ {
+ return d.GetEnumerator ();
+ }
+
+ public bool Remove (string key)
+ {
+ return d.Remove (key);
+ }
+
+ public bool TryGetValue (string key, out object value)
+ {
+ return d.TryGetValue (key, out value);
+ }
+ }
+}
--- /dev/null
+//
+// PatternParser.cs
+//
+// Author:
+// Marek Habersack <mhabersack@novell.com>
+//
+// Copyright (C) 2009 Novell Inc. http://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.
+//
+#if SYSTEMCORE_DEP
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+
+namespace System.Web.Routing
+{
+ static class RouteValueDictionaryExtensions
+ {
+ public static bool Has (this RouteValueDictionary dict, string key)
+ {
+ if (dict == null)
+ return false;
+
+ return dict.ContainsKey (key);
+ }
+
+ public static bool Has (this RouteValueDictionary dict, string key, object value)
+ {
+ if (dict == null)
+ return false;
+
+ object entryValue;
+ if (dict.TryGetValue (key, out entryValue)) {
+ if (value is string) {
+ if (!(entryValue is string))
+ return false;
+
+ string s1 = value as string;
+ string s2 = entryValue as string;
+ return String.Compare (s1, s2, StringComparison.OrdinalIgnoreCase) == 0;
+ }
+
+ return entryValue == null ? value == null : entryValue.Equals (value);
+ }
+
+ return false;
+ }
+
+ public static bool GetValue (this RouteValueDictionary dict, string key, out object value)
+ {
+ if (dict == null) {
+ value = null;
+ return false;
+ }
+
+ return dict.TryGetValue (key, out value);
+ }
+
+ [Conditional ("DEBUG")]
+ public static void Dump (this RouteValueDictionary dict, string name, string indent)
+ {
+ if (indent == null)
+ indent = String.Empty;
+
+ if (dict == null) {
+ Console.WriteLine (indent + "Dictionary '{0}' is null", name);
+ return;
+ }
+
+ if (dict.Count == 0) {
+ Console.WriteLine (indent + "Dictionary '{0}' is empty", name);
+ return;
+ }
+
+ Console.WriteLine (indent + "Dictionary '{0}':", name);
+ foreach (var de in dict)
+ Console.WriteLine (indent + "\t'{0}' == {1}", de.Key, de.Value);
+ }
+ }
+}
+#endif
--- /dev/null
+//
+// StopRoutingHandler.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Web;
+
+namespace System.Web.Routing
+{
+ [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class StopRoutingHandler : IRouteHandler
+ {
+ protected virtual IHttpHandler GetHttpHandler (RequestContext requestContext)
+ {
+ throw new NotSupportedException ();
+ }
+
+ IHttpHandler IRouteHandler.GetHttpHandler (RequestContext requestContext)
+ {
+ return GetHttpHandler (requestContext);
+ }
+ }
+}
--- /dev/null
+//
+// UrlRoutingHandler.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008-2010 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Web;
+
+namespace System.Web.Routing
+{
+ [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public abstract class UrlRoutingHandler : IHttpHandler
+ {
+ RouteCollection routes;
+
+ bool IHttpHandler.IsReusable {
+ get { return IsReusable; }
+ }
+
+ protected virtual bool IsReusable { get { return false; } }
+
+ public RouteCollection RouteCollection {
+ get {
+ if (routes == null)
+ routes = RouteTable.Routes;
+ return routes;
+ }
+ set { routes = value; }
+ }
+
+ void IHttpHandler.ProcessRequest (HttpContext context)
+ {
+ ProcessRequest (context);
+ }
+
+ protected virtual void ProcessRequest (HttpContext httpContext)
+ {
+ ProcessRequest (new HttpContextWrapper (httpContext));
+ }
+
+ protected virtual void ProcessRequest (HttpContextBase httpContext)
+ {
+ if (httpContext == null)
+ throw new ArgumentNullException ("httpContext");
+
+ var rd = RouteCollection.GetRouteData (httpContext);
+ if (rd == null)
+ throw new HttpException ("The incoming request does not match any route");
+ if (rd.RouteHandler == null)
+ throw new InvalidOperationException ("No IRouteHandler is assigned to the selected route");
+
+ RequestContext rc = new RequestContext (httpContext, rd);
+
+ var hh = rd.RouteHandler.GetHttpHandler (rc);
+ VerifyAndProcessRequest (hh, httpContext);
+ }
+
+ protected abstract void VerifyAndProcessRequest (IHttpHandler httpHandler, HttpContextBase httpContext);
+ }
+}
--- /dev/null
+//
+// UrlRoutingModule.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Threading;
+using System.Web;
+
+namespace System.Web.Routing
+{
+ [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class UrlRoutingModule : IHttpModule
+ {
+ RouteCollection routes;
+ public RouteCollection RouteCollection {
+ get {
+ if (routes == null)
+ routes = RouteTable.Routes;
+ return routes;
+ }
+ set { routes = value; }
+ }
+
+ protected virtual void Dispose ()
+ {
+ }
+
+ void IHttpModule.Dispose ()
+ {
+ Dispose ();
+ }
+
+ void IHttpModule.Init (HttpApplication application)
+ {
+ Init (application);
+ }
+
+ protected virtual void Init (HttpApplication application)
+ {
+ application.PostMapRequestHandler += PostMapRequestHandler;
+ application.PostResolveRequestCache += PostResolveRequestCache;
+ }
+
+ void PostMapRequestHandler (object o, EventArgs e)
+ {
+ var app = (HttpApplication) o;
+ PostMapRequestHandler (new HttpContextWrapper (app.Context));
+ }
+
+ void PostResolveRequestCache (object o, EventArgs e)
+ {
+ var app = (HttpApplication) o;
+ PostResolveRequestCache (new HttpContextWrapper (app.Context));
+ }
+ [Obsolete]
+ public virtual void PostMapRequestHandler (HttpContextBase context)
+ {
+ }
+
+ [MonoTODO]
+ public virtual void PostResolveRequestCache (HttpContextBase context)
+ {
+ if (context == null)
+ throw new ArgumentNullException ("context");
+
+ var rd = RouteCollection.GetRouteData (context);
+ if (rd == null)
+ return; // do nothing
+
+ if (rd.RouteHandler == null)
+ throw new InvalidOperationException ("No IRouteHandler is assigned to the selected route");
+
+ if (rd.RouteHandler is StopRoutingHandler)
+ return; //stop further processing
+
+ var rc = new RequestContext (context, rd);
+
+ IHttpHandler http = rd.RouteHandler.GetHttpHandler (rc);
+ if (http == null)
+ throw new InvalidOperationException ("The mapped IRouteHandler did not return an IHttpHandler");
+ context.Request.RequestContext = rc;
+ context.RemapHandler (http);
+ }
+ }
+}
--- /dev/null
+//
+// VirtualPathData.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Web;
+
+namespace System.Web.Routing
+{
+ [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class VirtualPathData
+ {
+ public VirtualPathData (RouteBase route, string virtualPath)
+ {
+ // arguments can be null.
+ Route = route;
+ VirtualPath = virtualPath;
+ DataTokens = new RouteValueDictionary ();
+ }
+
+ public RouteValueDictionary DataTokens { get; private set; }
+
+ public RouteBase Route { get; set; }
+
+ public string VirtualPath { get; set; }
+ }
+}
System.Web.Util/RequestValidationSource.cs
System.Web.Util/RequestValidator.cs
-../System.Web.Routing/System.Web.Routing/HttpMethodConstraint.cs
-../System.Web.Routing/System.Web.Routing/IRouteConstraint.cs
-../System.Web.Routing/System.Web.Routing/IRouteHandler.cs
-../System.Web.Routing/System.Web.Routing/PatternParser.cs
-../System.Web.Routing/System.Web.Routing/PatternToken.cs
-../System.Web.Routing/System.Web.Routing/PatternTokenType.cs
-../System.Web.Routing/System.Web.Routing/RequestContext.cs
-../System.Web.Routing/System.Web.Routing/Route.cs
-../System.Web.Routing/System.Web.Routing/RouteBase.cs
-../System.Web.Routing/System.Web.Routing/RouteCollection.cs
-../System.Web.Routing/System.Web.Routing/RouteData.cs
-../System.Web.Routing/System.Web.Routing/RouteDirection.cs
-../System.Web.Routing/System.Web.Routing/RouteTable.cs
-../System.Web.Routing/System.Web.Routing/RouteValueDictionary.cs
-../System.Web.Routing/System.Web.Routing/RouteValueDictionaryExtensions.cs
-../System.Web.Routing/System.Web.Routing/StopRoutingHandler.cs
-../System.Web.Routing/System.Web.Routing/UrlRoutingHandler.cs
-../System.Web.Routing/System.Web.Routing/UrlRoutingModule.cs
-../System.Web.Routing/System.Web.Routing/VirtualPathData.cs
+System.Web.Routing/HttpMethodConstraint.cs
+System.Web.Routing/IRouteConstraint.cs
+System.Web.Routing/IRouteHandler.cs
+System.Web.Routing/PatternParser.cs
+System.Web.Routing/PatternToken.cs
+System.Web.Routing/PatternTokenType.cs
+System.Web.Routing/RequestContext.cs
+System.Web.Routing/Route.cs
+System.Web.Routing/RouteBase.cs
+System.Web.Routing/RouteCollection.cs
+System.Web.Routing/RouteData.cs
+System.Web.Routing/RouteDirection.cs
+System.Web.Routing/RouteTable.cs
+System.Web.Routing/RouteValueDictionary.cs
+System.Web.Routing/RouteValueDictionaryExtensions.cs
+System.Web.Routing/StopRoutingHandler.cs
+System.Web.Routing/UrlRoutingHandler.cs
+System.Web.Routing/UrlRoutingModule.cs
+System.Web.Routing/VirtualPathData.cs
-../System.Web.Abstractions/System.Web/HttpApplicationStateBase.cs
-../System.Web.Abstractions/System.Web/HttpApplicationStateWrapper.cs
-../System.Web.Abstractions/System.Web/HttpBrowserCapabilitiesBase.cs
-../System.Web.Abstractions/System.Web/HttpBrowserCapabilitiesWrapper.cs
-../System.Web.Abstractions/System.Web/HttpCachePolicyBase.cs
-../System.Web.Abstractions/System.Web/HttpCachePolicyWrapper.cs
-../System.Web.Abstractions/System.Web/HttpContextBase.cs
-../System.Web.Abstractions/System.Web/HttpContextWrapper.cs
-../System.Web.Abstractions/System.Web/HttpFileCollectionBase.cs
-../System.Web.Abstractions/System.Web/HttpFileCollectionWrapper.cs
-../System.Web.Abstractions/System.Web/HttpPostedFileBase.cs
-../System.Web.Abstractions/System.Web/HttpPostedFileWrapper.cs
-../System.Web.Abstractions/System.Web/HttpRequestBase.cs
-../System.Web.Abstractions/System.Web/HttpRequestWrapper.cs
-../System.Web.Abstractions/System.Web/HttpResponseBase.cs
-../System.Web.Abstractions/System.Web/HttpResponseWrapper.cs
-../System.Web.Abstractions/System.Web/HttpServerUtilityBase.cs
-../System.Web.Abstractions/System.Web/HttpServerUtilityWrapper.cs
-../System.Web.Abstractions/System.Web/HttpSessionStateBase.cs
-../System.Web.Abstractions/System.Web/HttpSessionStateWrapper.cs
-../System.Web.Abstractions/System.Web/HttpStaticObjectsCollectionBase.cs
-../System.Web.Abstractions/System.Web/HttpStaticObjectsCollectionWrapper.cs
+System.Web/HttpApplicationStateBase.cs
+System.Web/HttpApplicationStateWrapper.cs
+System.Web/HttpBrowserCapabilitiesBase.cs
+System.Web/HttpBrowserCapabilitiesWrapper.cs
+System.Web/HttpCachePolicyBase.cs
+System.Web/HttpCachePolicyWrapper.cs
+System.Web/HttpContextBase.cs
+System.Web/HttpContextWrapper.cs
+System.Web/HttpFileCollectionBase.cs
+System.Web/HttpFileCollectionWrapper.cs
+System.Web/HttpPostedFileBase.cs
+System.Web/HttpPostedFileWrapper.cs
+System.Web/HttpRequestBase.cs
+System.Web/HttpRequestWrapper.cs
+System.Web/HttpResponseBase.cs
+System.Web/HttpResponseWrapper.cs
+System.Web/HttpServerUtilityBase.cs
+System.Web/HttpServerUtilityWrapper.cs
+System.Web/HttpSessionStateBase.cs
+System.Web/HttpSessionStateWrapper.cs
+System.Web/HttpStaticObjectsCollectionBase.cs
+System.Web/HttpStaticObjectsCollectionWrapper.cs
System.Collections.Concurrent/SplitOrderedList.cs
--- /dev/null
+//
+// HttpApplicationStateBase.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
+using System.Globalization;
+using System.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public abstract class HttpApplicationStateBase : NameObjectCollectionBase, ICollection, IEnumerable
+ {
+ void NotImplemented ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual string [] AllKeys {
+ get { NotImplemented (); return null; }
+ }
+
+ public virtual HttpApplicationStateBase Contents {
+ get { NotImplemented (); return null; }
+ }
+
+ public override int Count {
+ get { NotImplemented (); return 0; }
+ }
+
+ public virtual bool IsSynchronized {
+ get { NotImplemented (); return false; }
+ }
+
+ public virtual object this [int index] {
+ get { return Get (index); }
+ }
+
+ public virtual object this [string name] {
+ get { return Get (name); }
+ set { Set (name, value); }
+ }
+
+ public virtual HttpStaticObjectsCollectionBase StaticObjects {
+ get { NotImplemented (); return null; }
+ }
+
+ public virtual object SyncRoot {
+ get { NotImplemented (); return null; }
+ }
+
+ public virtual void Add (string name, object value)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void Clear ()
+ {
+ NotImplemented ();
+ }
+
+ public virtual void CopyTo (Array array, int index)
+ {
+ NotImplemented ();
+ }
+
+ public virtual object Get (int index)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual object Get (string name)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public override IEnumerator GetEnumerator ()
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual string GetKey (int index)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual void Lock ()
+ {
+ NotImplemented ();
+ }
+
+ public virtual void Remove (string name)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RemoveAll ()
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RemoveAt (int index)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void Set (string name, object value)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void UnLock ()
+ {
+ NotImplemented ();
+ }
+ }
+}
--- /dev/null
+//
+// HttpApplicationStateWrapper.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
+using System.Globalization;
+using System.Runtime.CompilerServices;
+using System.Runtime.Serialization;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class HttpApplicationStateWrapper : HttpApplicationStateBase
+ {
+ HttpApplicationState w;
+
+ public HttpApplicationStateWrapper (HttpApplicationState httpApplicationState)
+ {
+ if (httpApplicationState == null)
+ throw new ArgumentNullException ("httpApplicationState");
+ w = httpApplicationState;
+ }
+
+ public override string [] AllKeys {
+ get { return w.AllKeys; }
+ }
+
+ public override HttpApplicationStateBase Contents {
+ get { return new HttpApplicationStateWrapper (w.Contents); }
+ }
+
+ public override int Count {
+ get { return w.Count; }
+ }
+
+ public override bool IsSynchronized {
+ get { return ((ICollection) this).IsSynchronized; }
+ }
+
+ public override object this [int index] {
+ get { return Get (index); }
+ }
+
+ public override object this [string name] {
+ get { return Get (name); }
+ set { Set (name, value); }
+ }
+
+ public override NameObjectCollectionBase.KeysCollection Keys {
+ get { return w.Keys; }
+ }
+
+ public override HttpStaticObjectsCollectionBase StaticObjects {
+ get { return new HttpStaticObjectsCollectionWrapper (w.StaticObjects); }
+ }
+
+ public override object SyncRoot {
+ get { return ((ICollection) this).SyncRoot; }
+ }
+
+ public override void Add (string name, object value)
+ {
+ w.Add (name, value);
+ }
+
+ public override void Clear ()
+ {
+ w.Clear ();
+ }
+
+ public override void CopyTo (Array array, int index)
+ {
+ ((ICollection) this).CopyTo (array, index);
+ }
+
+ public override object Get (int index)
+ {
+ return w.Get (index);
+ }
+
+ public override object Get (string name)
+ {
+ return w.Get (name);
+ }
+
+ public override IEnumerator GetEnumerator ()
+ {
+ return w.GetEnumerator ();
+ }
+
+ public override string GetKey (int index)
+ {
+ return w.GetKey (index);
+ }
+
+ [MonoTODO]
+ public override void GetObjectData (SerializationInfo info, StreamingContext context)
+ {
+ w.GetObjectData (info, context);
+
+ throw new NotImplementedException ();
+ }
+
+ public override void Lock ()
+ {
+ w.Lock ();
+ }
+
+ public override void OnDeserialization (object sender)
+ {
+ w.OnDeserialization (sender);
+ }
+
+ public override void Remove (string name)
+ {
+ w.Remove (name);
+ }
+
+ public override void RemoveAll ()
+ {
+ w.RemoveAll ();
+ }
+
+ public override void RemoveAt (int index)
+ {
+ w.RemoveAt (index);
+ }
+
+ public override void Set (string name, object value)
+ {
+ w.Set (name, value);
+ }
+
+ public override void UnLock ()
+ {
+ w.UnLock ();
+ }
+ }
+}
--- /dev/null
+//
+// HttpBrowserCapabilitiesBase.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+using System.Web.UI;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public abstract class HttpBrowserCapabilitiesBase : IFilterResolutionService
+ {
+ void NotImplemented ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual bool ActiveXControls { get { NotImplemented (); return false; } }
+
+ public virtual IDictionary Adapters { get { NotImplemented (); return null; } }
+
+ public virtual bool AOL { get { NotImplemented (); return false; } }
+
+ public virtual bool BackgroundSounds { get { NotImplemented (); return false; } }
+
+ public virtual bool Beta { get { NotImplemented (); return false; } }
+
+ public virtual string Browser { get { NotImplemented (); return null; } }
+
+ public virtual ArrayList Browsers { get { NotImplemented (); return null; } }
+
+ public virtual bool CanCombineFormsInDeck { get { NotImplemented (); return false; } }
+
+ public virtual bool CanInitiateVoiceCall { get { NotImplemented (); return false; } }
+
+ public virtual bool CanRenderAfterInputOrSelectElement { get { NotImplemented (); return false; } }
+
+ public virtual bool CanRenderEmptySelects { get { NotImplemented (); return false; } }
+
+ public virtual bool CanRenderInputAndSelectElementsTogether { get { NotImplemented (); return false; } }
+
+ public virtual bool CanRenderMixedSelects { get { NotImplemented (); return false; } }
+
+ public virtual bool CanRenderOneventAndPrevElementsTogether { get { NotImplemented (); return false; } }
+
+ public virtual bool CanRenderPostBackCards { get { NotImplemented (); return false; } }
+
+ public virtual bool CanRenderSetvarZeroWithMultiSelectionList { get { NotImplemented (); return false; } }
+
+ public virtual bool CanSendMail { get { NotImplemented (); return false; } }
+
+ public virtual IDictionary Capabilities { get; set; }
+
+ public virtual bool CDF { get { NotImplemented (); return false; } }
+
+ public virtual Version ClrVersion { get { NotImplemented (); return null; } }
+
+ public virtual bool Cookies { get { NotImplemented (); return false; } }
+
+ public virtual bool Crawler { get { NotImplemented (); return false; } }
+
+ public virtual int DefaultSubmitButtonLimit { get { NotImplemented (); return 0; } }
+
+ public virtual Version EcmaScriptVersion { get { NotImplemented (); return null; } }
+
+ public virtual bool Frames { get { NotImplemented (); return false; } }
+
+ public virtual int GatewayMajorVersion { get { NotImplemented (); return 0; } }
+
+ public virtual double GatewayMinorVersion { get { NotImplemented (); return 0; } }
+
+ public virtual string GatewayVersion { get { NotImplemented (); return null; } }
+
+ public virtual bool HasBackButton { get { NotImplemented (); return false; } }
+
+ public virtual bool HidesRightAlignedMultiselectScrollbars { get { NotImplemented (); return false; } }
+
+ public virtual string HtmlTextWriter { get; set; }
+
+ public virtual string Id { get { NotImplemented (); return null; } }
+
+ public virtual string InputType { get { NotImplemented (); return null; } }
+
+ public virtual bool IsColor { get { NotImplemented (); return false; } }
+
+ public virtual bool IsMobileDevice { get { NotImplemented (); return false; } }
+
+ public virtual string this [string key] {
+ get { throw new NotImplementedException (); }
+ }
+
+ public virtual bool JavaApplets { get { NotImplemented (); return false; } }
+
+ public virtual Version JScriptVersion { get { NotImplemented (); return null; } }
+
+ public virtual int MajorVersion { get { NotImplemented (); return 0; } }
+
+ public virtual int MaximumHrefLength { get { NotImplemented (); return 0; } }
+
+ public virtual int MaximumRenderedPageSize { get { NotImplemented (); return 0; } }
+
+ public virtual int MaximumSoftkeyLabelLength { get { NotImplemented (); return 0; } }
+
+ public virtual double MinorVersion { get { NotImplemented (); return 0; } }
+
+ public virtual string MinorVersionString { get { NotImplemented (); return null; } }
+
+ public virtual string MobileDeviceManufacturer { get { NotImplemented (); return null; } }
+
+ public virtual string MobileDeviceModel { get { NotImplemented (); return null; } }
+
+ public virtual Version MSDomVersion { get { NotImplemented (); return null; } }
+
+ public virtual int NumberOfSoftkeys { get { NotImplemented (); return 0; } }
+
+ public virtual string Platform { get { NotImplemented (); return null; } }
+
+ public virtual string PreferredImageMime { get { NotImplemented (); return null; } }
+
+ public virtual string PreferredRenderingMime { get { NotImplemented (); return null; } }
+
+ public virtual string PreferredRenderingType { get { NotImplemented (); return null; } }
+
+ public virtual string PreferredRequestEncoding { get { NotImplemented (); return null; } }
+
+ public virtual string PreferredResponseEncoding { get { NotImplemented (); return null; } }
+
+ public virtual bool RendersBreakBeforeWmlSelectAndInput { get { NotImplemented (); return false; } }
+
+ public virtual bool RendersBreaksAfterHtmlLists { get { NotImplemented (); return false; } }
+
+ public virtual bool RendersBreaksAfterWmlAnchor { get { NotImplemented (); return false; } }
+
+ public virtual bool RendersBreaksAfterWmlInput { get { NotImplemented (); return false; } }
+
+ public virtual bool RendersWmlDoAcceptsInline { get { NotImplemented (); return false; } }
+
+ public virtual bool RendersWmlSelectsAsMenuCards { get { NotImplemented (); return false; } }
+
+ public virtual string RequiredMetaTagNameValue { get { NotImplemented (); return null; } }
+
+ public virtual bool RequiresAttributeColonSubstitution { get { NotImplemented (); return false; } }
+
+ public virtual bool RequiresContentTypeMetaTag { get { NotImplemented (); return false; } }
+
+ public virtual bool RequiresControlStateInSession { get { NotImplemented (); return false; } }
+
+ public virtual bool RequiresDBCSCharacter { get { NotImplemented (); return false; } }
+
+ public virtual bool RequiresHtmlAdaptiveErrorReporting { get { NotImplemented (); return false; } }
+
+ public virtual bool RequiresLeadingPageBreak { get { NotImplemented (); return false; } }
+
+ public virtual bool RequiresNoBreakInFormatting { get { NotImplemented (); return false; } }
+
+ public virtual bool RequiresOutputOptimization { get { NotImplemented (); return false; } }
+
+ public virtual bool RequiresPhoneNumbersAsPlainText { get { NotImplemented (); return false; } }
+
+ public virtual bool RequiresSpecialViewStateEncoding { get { NotImplemented (); return false; } }
+
+ public virtual bool RequiresUniqueFilePathSuffix { get { NotImplemented (); return false; } }
+
+ public virtual bool RequiresUniqueHtmlCheckboxNames { get { NotImplemented (); return false; } }
+
+ public virtual bool RequiresUniqueHtmlInputNames { get { NotImplemented (); return false; } }
+
+ public virtual bool RequiresUrlEncodedPostfieldValues { get { NotImplemented (); return false; } }
+
+ public virtual int ScreenBitDepth { get { NotImplemented (); return 0; } }
+
+ public virtual int ScreenCharactersHeight { get { NotImplemented (); return 0; } }
+
+ public virtual int ScreenCharactersWidth { get { NotImplemented (); return 0; } }
+
+ public virtual int ScreenPixelsHeight { get { NotImplemented (); return 0; } }
+
+ public virtual int ScreenPixelsWidth { get { NotImplemented (); return 0; } }
+
+ public virtual bool SupportsAccesskeyAttribute { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsBodyColor { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsBold { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsCacheControlMetaTag { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsCallback { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsCss { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsDivAlign { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsDivNoWrap { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsEmptyStringInCookieValue { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsFontColor { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsFontName { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsFontSize { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsImageSubmit { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsIModeSymbols { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsInputIStyle { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsInputMode { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsItalic { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsJPhoneMultiMediaAttributes { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsJPhoneSymbols { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsQueryStringInFormAction { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsRedirectWithCookie { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsSelectMultiple { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsUncheck { get { NotImplemented (); return false; } }
+
+ public virtual bool SupportsXmlHttp { get { NotImplemented (); return false; } }
+
+ public virtual bool Tables { get { NotImplemented (); return false; } }
+
+ public virtual Type TagWriter { get { NotImplemented (); return null; } }
+
+ public virtual string Type { get { NotImplemented (); return null; } }
+
+ public virtual bool UseOptimizedCacheKey { get { NotImplemented (); return false; } }
+
+ public virtual bool VBScript { get { NotImplemented (); return false; } }
+
+ public virtual string Version { get { NotImplemented (); return null; } }
+
+ public virtual Version W3CDomVersion { get { NotImplemented (); return null; } }
+
+ public virtual bool Win16 { get { NotImplemented (); return false; } }
+
+ public virtual bool Win32 { get { NotImplemented (); return false; } }
+
+ public virtual void AddBrowser (string browserName)
+ {
+ NotImplemented ();
+ }
+
+ public virtual int CompareFilters (string filter1, string filter2)
+ {
+ NotImplemented ();
+ return 0;
+ }
+
+ public virtual HtmlTextWriter CreateHtmlTextWriter (TextWriter w)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual void DisableOptimizedCacheKey ()
+ {
+ NotImplemented ();
+ }
+
+ public virtual bool EvaluateFilter (string filterName)
+ {
+ NotImplemented ();
+ return false;
+ }
+
+ public virtual Version [] GetClrVersions ()
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual bool IsBrowser (string browserName)
+ {
+ NotImplemented ();
+ return false;
+ }
+ }
+}
--- /dev/null
+//
+// HttpBrowserCapabilitiesWrapper.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+using System.Web.UI;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class HttpBrowserCapabilitiesWrapper : HttpBrowserCapabilitiesBase
+ {
+ HttpBrowserCapabilities w;
+
+ public HttpBrowserCapabilitiesWrapper (HttpBrowserCapabilities httpBrowserCapabilities)
+ {
+ if (httpBrowserCapabilities == null)
+ throw new ArgumentNullException ("httpBrowserCapabilities");
+ w = httpBrowserCapabilities;
+ }
+
+
+ public override bool ActiveXControls {
+ get { return w.ActiveXControls; }
+ }
+
+ public override IDictionary Adapters {
+ get { return w.Adapters; }
+ }
+
+ public override bool AOL {
+ get { return w.AOL; }
+ }
+
+ public override bool BackgroundSounds {
+ get { return w.BackgroundSounds; }
+ }
+
+ public override bool Beta {
+ get { return w.Beta; }
+ }
+
+ public override string Browser {
+ get { return w.Browser; }
+ }
+
+ public override ArrayList Browsers {
+ get { return w.Browsers; }
+ }
+
+ public override bool CanCombineFormsInDeck {
+ get { return w.CanCombineFormsInDeck; }
+ }
+
+ public override bool CanInitiateVoiceCall {
+ get { return w.CanInitiateVoiceCall; }
+ }
+
+ public override bool CanRenderAfterInputOrSelectElement {
+ get { return w.CanRenderAfterInputOrSelectElement; }
+ }
+
+ public override bool CanRenderEmptySelects {
+ get { return w.CanRenderEmptySelects; }
+ }
+
+ public override bool CanRenderInputAndSelectElementsTogether {
+ get { return w.CanRenderInputAndSelectElementsTogether; }
+ }
+
+ public override bool CanRenderMixedSelects {
+ get { return w.CanRenderMixedSelects; }
+ }
+
+ public override bool CanRenderOneventAndPrevElementsTogether {
+ get { return w.CanRenderOneventAndPrevElementsTogether; }
+ }
+
+ public override bool CanRenderPostBackCards {
+ get { return w.CanRenderPostBackCards; }
+ }
+
+ public override bool CanRenderSetvarZeroWithMultiSelectionList {
+ get { return w.CanRenderSetvarZeroWithMultiSelectionList; }
+ }
+
+ public override bool CanSendMail {
+ get { return w.CanSendMail; }
+ }
+
+ public override IDictionary Capabilities {
+ get { return w.Capabilities; } set { w.Capabilities = value; }
+ }
+
+ public override bool CDF {
+ get { return w.CDF; }
+ }
+
+ public override Version ClrVersion {
+ get { return w.ClrVersion; }
+ }
+
+ public override bool Cookies {
+ get { return w.Cookies; }
+ }
+
+ public override bool Crawler {
+ get { return w.Crawler; }
+ }
+
+ public override int DefaultSubmitButtonLimit {
+ get { return w.DefaultSubmitButtonLimit; }
+ }
+
+ public override Version EcmaScriptVersion {
+ get { return w.EcmaScriptVersion; }
+ }
+
+ public override bool Frames {
+ get { return w.Frames; }
+ }
+
+ public override int GatewayMajorVersion {
+ get { return w.GatewayMajorVersion; }
+ }
+
+ public override double GatewayMinorVersion {
+ get { return w.GatewayMinorVersion; }
+ }
+
+ public override string GatewayVersion {
+ get { return w.GatewayVersion; }
+ }
+
+ public override bool HasBackButton {
+ get { return w.HasBackButton; }
+ }
+
+ public override bool HidesRightAlignedMultiselectScrollbars {
+ get { return w.HidesRightAlignedMultiselectScrollbars; }
+ }
+
+ public override string HtmlTextWriter {
+ get { return w.HtmlTextWriter; } set { w.HtmlTextWriter = value; }
+ }
+
+ public override string Id {
+ get { return w.Id; }
+ }
+
+ public override string InputType {
+ get { return w.InputType; }
+ }
+
+ public override bool IsColor {
+ get { return w.IsColor; }
+ }
+
+ public override bool IsMobileDevice {
+ get { return w.IsMobileDevice; }
+ }
+
+ public override string this [string key] {
+ get { throw new NotImplementedException (); }
+ }
+
+ public override bool JavaApplets {
+ get { return w.JavaApplets; }
+ }
+
+ public override Version JScriptVersion {
+ get { return w.JScriptVersion; }
+ }
+
+ public override int MajorVersion {
+ get { return w.MajorVersion; }
+ }
+
+ public override int MaximumHrefLength {
+ get { return w.MaximumHrefLength; }
+ }
+
+ public override int MaximumRenderedPageSize {
+ get { return w.MaximumRenderedPageSize; }
+ }
+
+ public override int MaximumSoftkeyLabelLength {
+ get { return w.MaximumSoftkeyLabelLength; }
+ }
+
+ public override double MinorVersion {
+ get { return w.MinorVersion; }
+ }
+
+ public override string MinorVersionString {
+ get { return w.MinorVersionString; }
+ }
+
+ public override string MobileDeviceManufacturer {
+ get { return w.MobileDeviceManufacturer; }
+ }
+
+ public override string MobileDeviceModel {
+ get { return w.MobileDeviceModel; }
+ }
+
+ public override Version MSDomVersion {
+ get { return w.MSDomVersion; }
+ }
+
+ public override int NumberOfSoftkeys {
+ get { return w.NumberOfSoftkeys; }
+ }
+
+ public override string Platform {
+ get { return w.Platform; }
+ }
+
+ public override string PreferredImageMime {
+ get { return w.PreferredImageMime; }
+ }
+
+ public override string PreferredRenderingMime {
+ get { return w.PreferredRenderingMime; }
+ }
+
+ public override string PreferredRenderingType {
+ get { return w.PreferredRenderingType; }
+ }
+
+ public override string PreferredRequestEncoding {
+ get { return w.PreferredRequestEncoding; }
+ }
+
+ public override string PreferredResponseEncoding {
+ get { return w.PreferredResponseEncoding; }
+ }
+
+ public override bool RendersBreakBeforeWmlSelectAndInput {
+ get { return w.RendersBreakBeforeWmlSelectAndInput; }
+ }
+
+ public override bool RendersBreaksAfterHtmlLists {
+ get { return w.RendersBreaksAfterHtmlLists; }
+ }
+
+ public override bool RendersBreaksAfterWmlAnchor {
+ get { return w.RendersBreaksAfterWmlAnchor; }
+ }
+
+ public override bool RendersBreaksAfterWmlInput {
+ get { return w.RendersBreaksAfterWmlInput; }
+ }
+
+ public override bool RendersWmlDoAcceptsInline {
+ get { return w.RendersWmlDoAcceptsInline; }
+ }
+
+ public override bool RendersWmlSelectsAsMenuCards {
+ get { return w.RendersWmlSelectsAsMenuCards; }
+ }
+
+ public override string RequiredMetaTagNameValue {
+ get { return w.RequiredMetaTagNameValue; }
+ }
+
+ public override bool RequiresAttributeColonSubstitution {
+ get { return w.RequiresAttributeColonSubstitution; }
+ }
+
+ public override bool RequiresContentTypeMetaTag {
+ get { return w.RequiresContentTypeMetaTag; }
+ }
+
+ public override bool RequiresControlStateInSession {
+ get { return w.RequiresControlStateInSession; }
+ }
+
+ public override bool RequiresDBCSCharacter {
+ get { return w.RequiresDBCSCharacter; }
+ }
+
+ public override bool RequiresHtmlAdaptiveErrorReporting {
+ get { return w.RequiresHtmlAdaptiveErrorReporting; }
+ }
+
+ public override bool RequiresLeadingPageBreak {
+ get { return w.RequiresLeadingPageBreak; }
+ }
+
+ public override bool RequiresNoBreakInFormatting {
+ get { return w.RequiresNoBreakInFormatting; }
+ }
+
+ public override bool RequiresOutputOptimization {
+ get { return w.RequiresOutputOptimization; }
+ }
+
+ public override bool RequiresPhoneNumbersAsPlainText {
+ get { return w.RequiresPhoneNumbersAsPlainText; }
+ }
+
+ public override bool RequiresSpecialViewStateEncoding {
+ get { return w.RequiresSpecialViewStateEncoding; }
+ }
+
+ public override bool RequiresUniqueFilePathSuffix {
+ get { return w.RequiresUniqueFilePathSuffix; }
+ }
+
+ public override bool RequiresUniqueHtmlCheckboxNames {
+ get { return w.RequiresUniqueHtmlCheckboxNames; }
+ }
+
+ public override bool RequiresUniqueHtmlInputNames {
+ get { return w.RequiresUniqueHtmlInputNames; }
+ }
+
+ public override bool RequiresUrlEncodedPostfieldValues {
+ get { return w.RequiresUrlEncodedPostfieldValues; }
+ }
+
+ public override int ScreenBitDepth {
+ get { return w.ScreenBitDepth; }
+ }
+
+ public override int ScreenCharactersHeight {
+ get { return w.ScreenCharactersHeight; }
+ }
+
+ public override int ScreenCharactersWidth {
+ get { return w.ScreenCharactersWidth; }
+ }
+
+ public override int ScreenPixelsHeight {
+ get { return w.ScreenPixelsHeight; }
+ }
+
+ public override int ScreenPixelsWidth {
+ get { return w.ScreenPixelsWidth; }
+ }
+
+ public override bool SupportsAccesskeyAttribute {
+ get { return w.SupportsAccesskeyAttribute; }
+ }
+
+ public override bool SupportsBodyColor {
+ get { return w.SupportsBodyColor; }
+ }
+
+ public override bool SupportsBold {
+ get { return w.SupportsBold; }
+ }
+
+ public override bool SupportsCacheControlMetaTag {
+ get { return w.SupportsCacheControlMetaTag; }
+ }
+
+ public override bool SupportsCallback {
+ get { return w.SupportsCallback; }
+ }
+
+ public override bool SupportsCss {
+ get { return w.SupportsCss; }
+ }
+
+ public override bool SupportsDivAlign {
+ get { return w.SupportsDivAlign; }
+ }
+
+ public override bool SupportsDivNoWrap {
+ get { return w.SupportsDivNoWrap; }
+ }
+
+ public override bool SupportsEmptyStringInCookieValue {
+ get { return w.SupportsEmptyStringInCookieValue; }
+ }
+
+ public override bool SupportsFontColor {
+ get { return w.SupportsFontColor; }
+ }
+
+ public override bool SupportsFontName {
+ get { return w.SupportsFontName; }
+ }
+
+ public override bool SupportsFontSize {
+ get { return w.SupportsFontSize; }
+ }
+
+ public override bool SupportsImageSubmit {
+ get { return w.SupportsImageSubmit; }
+ }
+
+ public override bool SupportsIModeSymbols {
+ get { return w.SupportsIModeSymbols; }
+ }
+
+ public override bool SupportsInputIStyle {
+ get { return w.SupportsInputIStyle; }
+ }
+
+ public override bool SupportsInputMode {
+ get { return w.SupportsInputMode; }
+ }
+
+ public override bool SupportsItalic {
+ get { return w.SupportsItalic; }
+ }
+
+ public override bool SupportsJPhoneMultiMediaAttributes {
+ get { return w.SupportsJPhoneMultiMediaAttributes; }
+ }
+
+ public override bool SupportsJPhoneSymbols {
+ get { return w.SupportsJPhoneSymbols; }
+ }
+
+ public override bool SupportsQueryStringInFormAction {
+ get { return w.SupportsQueryStringInFormAction; }
+ }
+
+ public override bool SupportsRedirectWithCookie {
+ get { return w.SupportsRedirectWithCookie; }
+ }
+
+ public override bool SupportsSelectMultiple {
+ get { return w.SupportsSelectMultiple; }
+ }
+
+ public override bool SupportsUncheck {
+ get { return w.SupportsUncheck; }
+ }
+
+ public override bool SupportsXmlHttp {
+ get { return w.SupportsXmlHttp; }
+ }
+
+ public override bool Tables {
+ get { return w.Tables; }
+ }
+
+ public override Type TagWriter {
+ get { return w.TagWriter; }
+ }
+
+ public override string Type {
+ get { return w.Type; }
+ }
+
+ public override bool UseOptimizedCacheKey {
+ get { return w.UseOptimizedCacheKey; }
+ }
+
+ public override bool VBScript {
+ get { return w.VBScript; }
+ }
+
+ public override string Version {
+ get { return w.Version; }
+ }
+
+ public override Version W3CDomVersion {
+ get { return w.W3CDomVersion; }
+ }
+
+ public override bool Win16 {
+ get { return w.Win16; }
+ }
+
+ public override bool Win32 {
+ get { return w.Win32; }
+ }
+
+ public override void AddBrowser (string browserName)
+ {
+ w.AddBrowser (browserName);
+ }
+
+ [MonoTODO]
+ public override int CompareFilters (string filter1, string filter2)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override HtmlTextWriter CreateHtmlTextWriter (TextWriter w)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override void DisableOptimizedCacheKey ()
+ {
+ w.DisableOptimizedCacheKey ();
+ }
+
+ [MonoTODO]
+ public override bool EvaluateFilter (string filterName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override Version [] GetClrVersions ()
+ {
+ return w.GetClrVersions ();
+ }
+
+ public override bool IsBrowser (string browserName)
+ {
+ return w.IsBrowser (browserName);
+ }
+ }
+}
--- /dev/null
+//
+// HttpCachePolicyBase.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public abstract class HttpCachePolicyBase
+ {
+ void NotImplemented ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual HttpCacheVaryByContentEncodings VaryByContentEncodings { get { NotImplemented (); return null; } }
+
+ public virtual HttpCacheVaryByHeaders VaryByHeaders { get { NotImplemented (); return null; } }
+
+ public virtual HttpCacheVaryByParams VaryByParams { get { NotImplemented (); return null; } }
+
+ public virtual void AddValidationCallback (HttpCacheValidateHandler handler, object data)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void AppendCacheExtension (string extension)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetAllowResponseInBrowserHistory (bool allow)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetCacheability (HttpCacheability cacheability)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetCacheability (HttpCacheability cacheability, string field)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetETag (string etag)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetETagFromFileDependencies ()
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetExpires (DateTime date)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetLastModified (DateTime date)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetLastModifiedFromFileDependencies ()
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetMaxAge (TimeSpan delta)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetNoServerCaching ()
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetNoStore ()
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetNoTransforms ()
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetOmitVaryStar (bool omit)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetProxyMaxAge (TimeSpan delta)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetRevalidation (HttpCacheRevalidation revalidation)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetSlidingExpiration (bool slide)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetValidUntilExpires (bool validUntilExpires)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void SetVaryByCustom (string custom)
+ {
+ NotImplemented ();
+ }
+ }
+}
--- /dev/null
+//
+// HttpCachePolicyWrapper.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class HttpCachePolicyWrapper : HttpCachePolicyBase
+ {
+ HttpCachePolicy w;
+
+ public HttpCachePolicyWrapper (HttpCachePolicy httpCachePolicy)
+ {
+ if (httpCachePolicy == null)
+ throw new ArgumentNullException ("httpCachePolicy");
+ w = httpCachePolicy;
+ }
+
+ public override HttpCacheVaryByContentEncodings VaryByContentEncodings {
+ get { return w.VaryByContentEncodings; }
+ }
+
+ public override HttpCacheVaryByHeaders VaryByHeaders {
+ get { return w.VaryByHeaders; }
+ }
+
+ public override HttpCacheVaryByParams VaryByParams {
+ get { return w.VaryByParams; }
+ }
+
+ public override void AddValidationCallback (HttpCacheValidateHandler handler, object data)
+ {
+ w.AddValidationCallback (handler, data);
+ }
+
+ public override void AppendCacheExtension (string extension)
+ {
+ w.AppendCacheExtension (extension);
+ }
+
+ public override void SetAllowResponseInBrowserHistory (bool allow)
+ {
+ w.SetAllowResponseInBrowserHistory (allow);
+ }
+
+ public override void SetCacheability (HttpCacheability cacheability)
+ {
+ w.SetCacheability (cacheability);
+ }
+
+ public override void SetCacheability (HttpCacheability cacheability, string field)
+ {
+ w.SetCacheability (cacheability, field);
+ }
+
+ public override void SetVaryByCustom (string custom)
+ {
+ w.SetVaryByCustom (custom);
+ }
+
+ public override void SetETag (string etag)
+ {
+ w.SetETag (etag);
+ }
+
+ public override void SetETagFromFileDependencies ()
+ {
+ w.SetETagFromFileDependencies ();
+ }
+
+ public override void SetExpires (DateTime date)
+ {
+ w.SetExpires (date);
+ }
+
+ public override void SetLastModified (DateTime date)
+ {
+ w.SetLastModified (date);
+ }
+
+ public override void SetLastModifiedFromFileDependencies ()
+ {
+ w.SetLastModifiedFromFileDependencies ();
+ }
+
+ public override void SetMaxAge (TimeSpan delta)
+ {
+ w.SetMaxAge (delta);
+ }
+
+ public override void SetNoServerCaching ()
+ {
+ w.SetNoServerCaching ();
+ }
+
+ public override void SetNoStore ()
+ {
+ w.SetNoStore ();
+ }
+
+ public override void SetNoTransforms ()
+ {
+ w.SetNoTransforms ();
+ }
+
+ public override void SetOmitVaryStar (bool omit)
+ {
+ w.SetOmitVaryStar (omit);
+ }
+
+ public override void SetProxyMaxAge (TimeSpan delta)
+ {
+ w.SetProxyMaxAge (delta);
+ }
+
+ public override void SetRevalidation (HttpCacheRevalidation revalidation)
+ {
+ w.SetRevalidation (revalidation);
+ }
+
+ public override void SetSlidingExpiration (bool slide)
+ {
+ w.SetSlidingExpiration (slide);
+ }
+
+ public override void SetValidUntilExpires (bool validUntilExpires)
+ {
+ w.SetValidUntilExpires (validUntilExpires);
+ }
+ }
+}
--- /dev/null
+//
+// HttpContextBase.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+using System.Web.Profile;
+using System.Web.SessionState;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public abstract class HttpContextBase : IServiceProvider
+ {
+ void NotImplemented ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual Exception [] AllErrors { get { NotImplemented (); return null; } }
+
+ public virtual HttpApplicationStateBase Application { get { NotImplemented (); return null; } }
+
+ public virtual HttpApplication ApplicationInstance { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual Cache Cache { get { NotImplemented (); return null; } }
+
+ public virtual IHttpHandler CurrentHandler { get { NotImplemented (); return null; } }
+
+ public virtual RequestNotification CurrentNotification { get { NotImplemented (); return default (RequestNotification); } }
+
+ public virtual Exception Error { get { NotImplemented (); return null; } }
+
+ public virtual IHttpHandler Handler { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual bool IsCustomErrorEnabled { get { NotImplemented (); return false; } }
+
+ public virtual bool IsDebuggingEnabled { get { NotImplemented (); return false; } }
+
+ public virtual bool IsPostNotification { get { NotImplemented (); return false; } }
+
+ public virtual IDictionary Items { get { NotImplemented (); return null; } }
+
+ public virtual IHttpHandler PreviousHandler { get { NotImplemented (); return null; } }
+
+ public virtual ProfileBase Profile { get { NotImplemented (); return null; } }
+
+ public virtual HttpRequestBase Request { get { NotImplemented (); return null; } }
+
+ public virtual HttpResponseBase Response { get { NotImplemented (); return null; } }
+
+ public virtual HttpServerUtilityBase Server { get { NotImplemented (); return null; } }
+
+ public virtual HttpSessionStateBase Session { get { NotImplemented (); return null; } }
+
+ public virtual bool SkipAuthorization { get { NotImplemented (); return false; } set { NotImplemented (); } }
+
+ public virtual DateTime Timestamp { get { NotImplemented (); return DateTime.MinValue; } }
+
+ public virtual TraceContext Trace { get { NotImplemented (); return null; } }
+
+ public virtual IPrincipal User { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual void AddError (Exception errorInfo)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void ClearError ()
+ {
+ NotImplemented ();
+ }
+
+ public virtual object GetGlobalResourceObject (string classKey, string resourceKey)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual object GetGlobalResourceObject (string classKey, string resourceKey, CultureInfo culture)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual object GetLocalResourceObject (string virtualPath, string resourceKey)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual object GetLocalResourceObject (string virtualPath, string resourceKey, CultureInfo culture)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual object GetSection (string sectionName)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual object GetService (Type serviceType)
+ {
+ NotImplemented ();
+ return null;
+ }
+ public virtual void RemapHandler (IHttpHandler handler)
+ {
+ NotImplemented ();
+ }
+ public virtual void RewritePath (string path)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RewritePath (string path, bool rebaseClientPath)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RewritePath (string filePath, string pathInfo, string queryString)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RewritePath (string filePath, string pathInfo, string queryString, bool setClientFilePath)
+ {
+ NotImplemented ();
+ }
+ public virtual void SetSessionStateBehavior (SessionStateBehavior sessionStateBehavior)
+ {
+ NotImplemented ();
+ }
+ }
+}
--- /dev/null
+//
+// HttpContextWrapper.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008-2010 Novell Inc. http://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.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+using System.Web.Profile;
+using System.Web.SessionState;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class HttpContextWrapper : HttpContextBase
+ {
+ HttpContext w;
+
+ public HttpContextWrapper (HttpContext httpContext)
+ {
+ if (httpContext == null)
+ throw new ArgumentNullException ("httpContext");
+ w = httpContext;
+ }
+
+ public override Exception [] AllErrors {
+ get { return w.AllErrors; }
+ }
+
+ public override HttpApplicationStateBase Application {
+ get { return new HttpApplicationStateWrapper (w.Application); }
+ }
+
+ public override HttpApplication ApplicationInstance {
+ get { return w.ApplicationInstance; }
+ set { w.ApplicationInstance = value; }
+ }
+
+ public override Cache Cache {
+ get { return w.Cache; }
+ }
+
+ public override IHttpHandler CurrentHandler {
+ get { return w.CurrentHandler; }
+ }
+
+ public override RequestNotification CurrentNotification {
+ get { return w.CurrentNotification; }
+ }
+
+ public override Exception Error {
+ get { return w.Error; }
+ }
+
+ public override IHttpHandler Handler {
+ get { return w.Handler; }
+ set { w.Handler = value; }
+ }
+
+ public override bool IsCustomErrorEnabled {
+ get { return w.IsCustomErrorEnabled; }
+ }
+
+ public override bool IsDebuggingEnabled {
+ get { return w.IsDebuggingEnabled; }
+ }
+
+ public override bool IsPostNotification {
+ get { return w.IsPostNotification; }
+ }
+
+ public override IDictionary Items {
+ get { return w.Items; }
+ }
+
+ public override IHttpHandler PreviousHandler {
+ get { return w.PreviousHandler; }
+ }
+
+ public override ProfileBase Profile {
+ get { return w.Profile; }
+ }
+
+ public override HttpRequestBase Request {
+ get { return new HttpRequestWrapper (w.Request); }
+ }
+
+ public override HttpResponseBase Response {
+ get { return new HttpResponseWrapper (w.Response); }
+ }
+
+ public override HttpServerUtilityBase Server {
+ get { return new HttpServerUtilityWrapper (w.Server); }
+ }
+
+ public override HttpSessionStateBase Session {
+ get { return w.Session == null ? null : new HttpSessionStateWrapper (w.Session); }
+ }
+
+ public override bool SkipAuthorization {
+ get { return w.SkipAuthorization; }
+ set { w.SkipAuthorization = value; }
+ }
+
+ public override DateTime Timestamp {
+ get { return w.Timestamp; }
+ }
+
+ public override TraceContext Trace {
+ get { return w.Trace; }
+ }
+
+ public override IPrincipal User {
+ get { return w.User; }
+ set { w.User = value; }
+ }
+
+ public override void AddError (Exception errorInfo)
+ {
+ w.AddError (errorInfo);
+ }
+
+ public override void ClearError ()
+ {
+ w.ClearError ();
+ }
+
+ public override object GetGlobalResourceObject (string classKey, string resourceKey)
+ {
+ return HttpContext.GetGlobalResourceObject (classKey, resourceKey);
+ }
+
+ public override object GetGlobalResourceObject (string classKey, string resourceKey, CultureInfo culture)
+ {
+ return HttpContext.GetGlobalResourceObject (classKey, resourceKey, culture);
+ }
+
+ public override object GetLocalResourceObject (string overridePath, string resourceKey)
+ {
+ return HttpContext.GetLocalResourceObject (overridePath, resourceKey);
+ }
+
+ public override object GetLocalResourceObject (string overridePath, string resourceKey, CultureInfo culture)
+ {
+ return HttpContext.GetLocalResourceObject (overridePath, resourceKey, culture);
+ }
+
+ public override object GetSection (string sectionName)
+ {
+ return w.GetSection (sectionName);
+ }
+
+ public override object GetService (Type serviceType)
+ {
+ return ((IServiceProvider)w).GetService (serviceType);
+ }
+ public override void RemapHandler (IHttpHandler handler)
+ {
+ w.RemapHandler (handler);
+ }
+ public override void RewritePath (string path)
+ {
+ w.RewritePath (path);
+ }
+
+ public override void RewritePath (string path, bool rebaseClientPath)
+ {
+ w.RewritePath (path, rebaseClientPath);
+ }
+
+ public override void RewritePath (string filePath, string pathInfo, string queryString)
+ {
+ w.RewritePath (filePath, pathInfo, queryString);
+ }
+
+ public override void RewritePath (string filePath, string pathInfo, string queryString, bool setClientFilePath)
+ {
+ w.RewritePath (filePath, pathInfo, queryString, setClientFilePath);
+ }
+ public override void SetSessionStateBehavior (SessionStateBehavior sessionStateBehavior)
+ {
+ w.SetSessionStateBehavior (sessionStateBehavior);
+ }
+ }
+}
--- /dev/null
+//
+// HttpFileCollectionBase.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
+using System.Globalization;
+using System.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public abstract class HttpFileCollectionBase : NameObjectCollectionBase, ICollection, IEnumerable
+ {
+ void NotImplemented ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual string [] AllKeys { get { NotImplemented (); return null; } }
+
+ public override int Count {
+ get { NotImplemented (); return 0; }
+ }
+
+ public virtual bool IsSynchronized { get { NotImplemented (); return false; } }
+
+ public virtual HttpPostedFileBase this [int index] {
+ get { return Get (index); }
+ }
+
+ public virtual HttpPostedFileBase this [string name] {
+ get { return Get (name); }
+ }
+
+ public virtual object SyncRoot { get { NotImplemented (); return null; } }
+
+ public virtual void CopyTo (Array dest, int index)
+ {
+ NotImplemented ();
+ }
+
+ public virtual HttpPostedFileBase Get (int index)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual HttpPostedFileBase Get (string name)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public override IEnumerator GetEnumerator ()
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual string GetKey (int index)
+ {
+ NotImplemented ();
+ return null;
+ }
+ }
+}
--- /dev/null
+//
+// HttpFileCollectionWrapper.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
+using System.Globalization;
+using System.Runtime.CompilerServices;
+using System.Runtime.Serialization;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class HttpFileCollectionWrapper : HttpFileCollectionBase
+ {
+ HttpFileCollection w;
+
+ public HttpFileCollectionWrapper (HttpFileCollection httpFileCollection)
+ {
+ if (httpFileCollection == null)
+ throw new ArgumentNullException ("httpFileCollection");
+ w = httpFileCollection;
+ }
+
+ public override string [] AllKeys {
+ get { return w.AllKeys; }
+ }
+
+ public override int Count {
+ get { return w.Count; }
+ }
+
+ public override bool IsSynchronized {
+ get { return ((ICollection) w).IsSynchronized; }
+ }
+
+ public override HttpPostedFileBase this [int index] {
+ get { return Get (index); }
+ }
+
+ public override HttpPostedFileBase this [string name] {
+ get { return Get (name); }
+ }
+
+ public override NameObjectCollectionBase.KeysCollection Keys {
+ get { return w.Keys; }
+ }
+
+ public override object SyncRoot {
+ get { return ((ICollection) w).SyncRoot; }
+ }
+
+ public override void CopyTo (Array dest, int index)
+ {
+ w.CopyTo (dest, index);
+ }
+
+ public override HttpPostedFileBase Get (int index)
+ {
+ HttpPostedFile file = w.Get (index);
+ if (file == null)
+ return null;
+
+ return new HttpPostedFileWrapper (file);
+ }
+
+ public override HttpPostedFileBase Get (string name)
+ {
+ HttpPostedFile file = w.Get (name);
+ if (file == null)
+ return null;
+
+ return new HttpPostedFileWrapper (file);
+ }
+
+ public override IEnumerator GetEnumerator ()
+ {
+ return w.GetEnumerator ();
+ }
+
+ public override string GetKey (int index)
+ {
+ return w.GetKey (index);
+ }
+
+ public override void GetObjectData (SerializationInfo info, StreamingContext context)
+ {
+ w.GetObjectData (info, context);
+ }
+
+ public override void OnDeserialization (object sender)
+ {
+ w.OnDeserialization (sender);
+ }
+ }
+}
--- /dev/null
+//
+// HttpPostedFileBase.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.IO;
+using System.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public abstract class HttpPostedFileBase
+ {
+ void NotImplemented ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual int ContentLength { get { NotImplemented (); return 0; } }
+
+ public virtual string ContentType { get { NotImplemented (); return null; } }
+
+ public virtual string FileName { get { NotImplemented (); return null; } }
+
+ public virtual Stream InputStream { get { NotImplemented (); return null; } }
+
+ public virtual void SaveAs (string filename)
+ {
+ NotImplemented ();
+ }
+ }
+}
--- /dev/null
+//
+// HttpPostedFileWrapper.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.IO;
+using System.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class HttpPostedFileWrapper : HttpPostedFileBase
+ {
+ HttpPostedFile w;
+
+ public HttpPostedFileWrapper (HttpPostedFile httpPostedFile)
+ {
+ if (httpPostedFile == null)
+ throw new ArgumentNullException ("httpPostedFile");
+ w = httpPostedFile;
+ }
+
+ public override int ContentLength {
+ get { return w.ContentLength; }
+ }
+
+ public override string ContentType {
+ get { return w.ContentType; }
+ }
+
+ public override string FileName {
+ get { return w.FileName; }
+ }
+
+ public override Stream InputStream {
+ get { return w.InputStream; }
+ }
+
+ public override void SaveAs (string filename)
+ {
+ w.SaveAs (filename);
+ }
+ }
+}
--- /dev/null
+//
+// HttpRequestBase.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
+using System.Globalization;
+using System.IO;
+using System.Runtime.CompilerServices;
+using System.Runtime.Serialization;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Text;
+using System.Threading;
+using System.Web.Caching;
+
+using System.Security.Authentication.ExtendedProtection;
+using System.Web.Routing;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public abstract class HttpRequestBase
+ {
+ void NotImplemented ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual string [] AcceptTypes { get { NotImplemented (); return null; } }
+
+ public virtual string AnonymousID { get { NotImplemented (); return null; } }
+
+ public virtual string ApplicationPath { get { NotImplemented (); return null; } }
+
+ public virtual string AppRelativeCurrentExecutionFilePath { get { NotImplemented (); return null; } }
+
+ public virtual HttpBrowserCapabilitiesBase Browser { get { NotImplemented (); return null; } }
+
+ public virtual HttpClientCertificate ClientCertificate { get { NotImplemented (); return null; } }
+
+ public virtual Encoding ContentEncoding { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual int ContentLength { get { NotImplemented (); return 0; } }
+
+ public virtual string ContentType { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual HttpCookieCollection Cookies { get { NotImplemented (); return null; } }
+
+ public virtual string CurrentExecutionFilePath { get { NotImplemented (); return null; } }
+
+ public virtual string CurrentExecutionFilePathExtension { get { NotImplemented (); return null; } }
+
+ public virtual string FilePath { get { NotImplemented (); return null; } }
+
+ public virtual HttpFileCollectionBase Files { get { NotImplemented (); return null; } }
+
+ public virtual Stream Filter { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual NameValueCollection Form { get { NotImplemented (); return null; } }
+
+ public virtual NameValueCollection Headers { get { NotImplemented (); return null; } }
+
+ public virtual string HttpMethod { get { NotImplemented (); return null; } }
+
+ public virtual Stream InputStream { get { NotImplemented (); return null; } }
+ // LAMESPEC: MSDN says NotImplementedException is thrown only when the request is
+ // not IIS7WorkerRequest or ISAPIWorkerRequestInProc, but it is thrown always.
+ public virtual ChannelBinding HttpChannelBinding { get { NotImplemented (); return null; } }
+ public virtual bool IsAuthenticated { get { NotImplemented (); return false; } }
+
+ public virtual bool IsLocal { get { NotImplemented (); return false; } }
+
+ public virtual bool IsSecureConnection { get { NotImplemented (); return false; } }
+
+ public virtual string this [string key] {
+ get { throw new NotImplementedException (); }
+ }
+
+ public virtual WindowsIdentity LogonUserIdentity { get { NotImplemented (); return null; } }
+
+ public virtual NameValueCollection Params { get { NotImplemented (); return null; } }
+
+ public virtual string Path { get { NotImplemented (); return null; } }
+
+ public virtual string PathInfo { get { NotImplemented (); return null; } }
+
+ public virtual string PhysicalApplicationPath { get { NotImplemented (); return null; } }
+
+ public virtual string PhysicalPath { get { NotImplemented (); return null; } }
+
+ public virtual NameValueCollection QueryString { get { NotImplemented (); return null; } }
+
+ public virtual string RawUrl { get { NotImplemented (); return null; } }
+
+ public virtual string RequestType { get { NotImplemented (); return null; } set { NotImplemented (); } }
+ public virtual RequestContext RequestContext {
+ get { NotImplemented (); return null; }
+ internal set { NotImplemented (); }
+ }
+ public virtual NameValueCollection ServerVariables { get { NotImplemented (); return null; } }
+
+ public virtual CancellationToken TimedOutToken { get { NotImplemented (); return default(CancellationToken); } }
+
+ public virtual int TotalBytes { get { NotImplemented (); return 0; } }
+
+ public virtual ReadEntityBodyMode ReadEntityBodyMode { get { NotImplemented(); return ReadEntityBodyMode.Classic; } }
+
+ public virtual UnvalidatedRequestValuesBase Unvalidated { get { NotImplemented (); return null; } }
+
+ public virtual Uri Url { get { NotImplemented (); return null; } }
+
+ public virtual Uri UrlReferrer { get { NotImplemented (); return null; } }
+
+ public virtual string UserAgent { get { NotImplemented (); return null; } }
+
+ public virtual string UserHostAddress { get { NotImplemented (); return null; } }
+
+ public virtual string UserHostName { get { NotImplemented (); return null; } }
+
+ public virtual string [] UserLanguages { get { NotImplemented (); return null; } }
+
+ public virtual void Abort ()
+ {
+ NotImplemented();
+ }
+
+ public virtual byte [] BinaryRead (int count)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual Stream GetBufferedInputStream ()
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual Stream GetBufferlessInputStream ()
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual Stream GetBufferlessInputStream (bool disableMaxRequestLength)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual void InsertEntityBody()
+ {
+ NotImplemented ();
+ }
+
+ public virtual void InsertEntityBody(byte[] buffer, int offset, int count)
+ {
+ NotImplemented ();
+ }
+
+ public virtual double [] MapRawImageCoordinates (string imageFieldName)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual int [] MapImageCoordinates (string imageFieldName)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual string MapPath (string virtualPath)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual string MapPath (string virtualPath, string baseVirtualDir, bool allowCrossAppMapping)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual void SaveAs (string filename, bool includeHeaders)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void ValidateInput ()
+ {
+ NotImplemented ();
+ }
+ }
+}
--- /dev/null
+//
+// HttpRequestWrapper.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
+using System.Globalization;
+using System.IO;
+using System.Runtime.CompilerServices;
+using System.Runtime.Serialization;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Text;
+using System.Threading;
+using System.Web.Caching;
+
+using System.Security.Authentication.ExtendedProtection;
+using System.Web.Routing;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class HttpRequestWrapper : HttpRequestBase
+ {
+ HttpRequest w;
+
+ public HttpRequestWrapper (HttpRequest httpRequest)
+ {
+ if (httpRequest == null)
+ throw new ArgumentNullException ("httpRequest");
+ w = httpRequest;
+ }
+
+ public override string [] AcceptTypes {
+ get { return w.AcceptTypes; }
+ }
+
+ public override string AnonymousID {
+ get { return w.AnonymousID; }
+ }
+
+ public override string ApplicationPath {
+ get { return w.ApplicationPath; }
+ }
+
+ public override string AppRelativeCurrentExecutionFilePath {
+ get { return w.AppRelativeCurrentExecutionFilePath; }
+ }
+
+ public override HttpBrowserCapabilitiesBase Browser {
+ get { return new HttpBrowserCapabilitiesWrapper (w.Browser); }
+ }
+
+ public override HttpClientCertificate ClientCertificate {
+ get { return w.ClientCertificate; }
+ }
+
+ public override Encoding ContentEncoding {
+ get { return w.ContentEncoding; }
+ set { w.ContentEncoding = value; }
+ }
+
+ public override int ContentLength {
+ get { return w.ContentLength; }
+ }
+
+ public override string ContentType {
+ get { return w.ContentType; }
+ set { w.ContentType = value; }
+ }
+
+ public override HttpCookieCollection Cookies {
+ get { return w.Cookies; }
+ }
+
+ public override string CurrentExecutionFilePath {
+ get { return w.CurrentExecutionFilePath; }
+ }
+
+ public override string FilePath {
+ get { return w.FilePath; }
+ }
+
+ public override HttpFileCollectionBase Files {
+ get { return new HttpFileCollectionWrapper (w.Files); }
+ }
+
+ public override Stream Filter {
+ get { return w.Filter; }
+ set { w.Filter = value; }
+ }
+
+ public override NameValueCollection Form {
+ get { return w.Form; }
+ }
+
+ public override NameValueCollection Headers {
+ get { return w.Headers; }
+ }
+
+ public override Stream GetBufferedInputStream ()
+ {
+ return w.GetBufferedInputStream ();
+ }
+
+ public override Stream GetBufferlessInputStream ()
+ {
+ return w.GetBufferlessInputStream ();
+ }
+
+ public override Stream GetBufferlessInputStream (System.Boolean disableMaxRequestLength)
+ {
+ return w.GetBufferlessInputStream (disableMaxRequestLength);
+ }
+
+ public override string HttpMethod {
+ get { return w.HttpMethod; }
+ }
+ public override ChannelBinding HttpChannelBinding {
+ get { return w.HttpChannelBinding; }
+ }
+ public override Stream InputStream {
+ get { return w.InputStream; }
+ }
+
+ public override bool IsAuthenticated {
+ get { return w.IsAuthenticated; }
+ }
+
+ public override bool IsLocal {
+ get { return w.IsLocal; }
+ }
+
+ public override bool IsSecureConnection {
+ get { return w.IsSecureConnection; }
+ }
+
+ public override string this [string key] {
+ get { return w [key]; }
+ }
+
+ public override WindowsIdentity LogonUserIdentity {
+ get { return w.LogonUserIdentity; }
+ }
+
+ public override NameValueCollection Params {
+ get { return w.Params; }
+ }
+
+ public override string Path {
+ get { return w.Path; }
+ }
+
+ public override string PathInfo {
+ get { return w.PathInfo; }
+ }
+
+ public override string PhysicalApplicationPath {
+ get { return w.PhysicalApplicationPath; }
+ }
+
+ public override string PhysicalPath {
+ get { return w.PhysicalPath; }
+ }
+
+ public override NameValueCollection QueryString {
+ get { return w.QueryString; }
+ }
+
+ public override string RawUrl {
+ get { return w.RawUrl; }
+ }
+
+ public override string RequestType {
+ get { return w.RequestType; }
+ set { w.RequestType = value; }
+ }
+ public override RequestContext RequestContext {
+ get { return w.RequestContext; }
+ internal set { w.RequestContext = value; }
+ }
+ public override NameValueCollection ServerVariables {
+ get { return w.ServerVariables; }
+ }
+
+ public virtual CancellationToken TimedOutToken {
+ get { return w.TimedOutToken; }
+ }
+
+ public override int TotalBytes {
+ get { return w.TotalBytes; }
+ }
+
+ public override UnvalidatedRequestValuesBase Unvalidated {
+ get { return new UnvalidatedRequestValuesWrapper (w.Unvalidated); }
+ }
+
+ public override ReadEntityBodyMode ReadEntityBodyMode {
+ get { return ReadEntityBodyMode.Classic; }
+ }
+
+ public override Uri Url {
+ get { return w.Url; }
+ }
+
+ public override Uri UrlReferrer {
+ get { return w.UrlReferrer; }
+ }
+
+ public override string UserAgent {
+ get { return w.UserAgent; }
+ }
+
+ public override string UserHostAddress {
+ get { return w.UserHostAddress; }
+ }
+
+ public override string UserHostName {
+ get { return w.UserHostName; }
+ }
+
+ public override string [] UserLanguages {
+ get { return w.UserLanguages; }
+ }
+
+ public void Abort ()
+ {
+ w.WorkerRequest.CloseConnection();
+ }
+
+ public override byte [] BinaryRead (int count)
+ {
+ return w.BinaryRead (count);
+ }
+
+ public override int [] MapImageCoordinates (string imageFieldName)
+ {
+ return w.MapImageCoordinates (imageFieldName);
+ }
+
+ public override string MapPath (string virtualPath)
+ {
+ return w.MapPath (virtualPath);
+ }
+
+ public override string MapPath (string virtualPath, string baseVirtualDir, bool allowCrossAppMapping)
+ {
+ return w.MapPath (virtualPath, baseVirtualDir, allowCrossAppMapping);
+ }
+
+ public override double [] MapRawImageCoordinates (System.String imageFieldName)
+ {
+ return w.MapRawImageCoordinates (imageFieldName);
+ }
+
+ public override void SaveAs (string filename, bool includeHeaders)
+ {
+ w.SaveAs (filename, includeHeaders);
+ }
+
+ public override void ValidateInput ()
+ {
+ w.ValidateInput ();
+ }
+ }
+}
--- /dev/null
+//
+// HttpResponseBase.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
+using System.Globalization;
+using System.IO;
+using System.Runtime.CompilerServices;
+using System.Runtime.Serialization;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Text;
+using System.Web.Caching;
+using System.Threading;
+
+using System.Web.Routing;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public abstract class HttpResponseBase
+ {
+ void NotImplemented ()
+ {
+ throw new NotImplementedException ();
+ }
+
+
+ public virtual bool Buffer { get { NotImplemented (); return false; } set { NotImplemented (); } }
+
+ public virtual bool BufferOutput { get { NotImplemented (); return false; } set { NotImplemented (); } }
+
+ public virtual HttpCachePolicyBase Cache { get { NotImplemented (); return null; } }
+
+ public virtual string CacheControl { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual string Charset { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual CancellationToken ClientDisconnectedToken { get { NotImplemented (); return CancellationToken.None; } }
+
+ public virtual Encoding ContentEncoding { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual string ContentType { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual HttpCookieCollection Cookies { get { NotImplemented (); return null; } }
+
+ public virtual int Expires { get { NotImplemented (); return 0; } set { NotImplemented (); } }
+
+ public virtual DateTime ExpiresAbsolute { get { NotImplemented (); return DateTime.MinValue; } set { NotImplemented (); } }
+
+ public virtual Stream Filter { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual Encoding HeaderEncoding { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual NameValueCollection Headers { get { NotImplemented (); return null; } }
+
+ public virtual bool IsClientConnected { get { NotImplemented (); return false; } }
+
+ public virtual bool IsRequestBeingRedirected { get { NotImplemented (); return false; } }
+
+ public virtual TextWriter Output { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual Stream OutputStream { get { NotImplemented (); return null; } }
+
+ public virtual string RedirectLocation { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual string Status { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual int StatusCode { get { NotImplemented (); return 0; } set { NotImplemented (); } }
+
+ public virtual string StatusDescription { get { NotImplemented (); return null; } set { NotImplemented (); } }
+
+ public virtual int SubStatusCode { get { NotImplemented (); return 0; } set { NotImplemented (); } }
+
+ public virtual bool SuppressContent { get { NotImplemented (); return false; } set { NotImplemented (); } }
+
+ public virtual bool SuppressFormsAuthenticationRedirect { get { NotImplemented (); return false; } set { NotImplemented (); } }
+
+ public virtual bool TrySkipIisCustomErrors { get { NotImplemented (); return false; } set { NotImplemented (); } }
+
+
+ public virtual void AddCacheDependency (params CacheDependency [] dependencies)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void AddCacheItemDependencies (ArrayList cacheKeys)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void AddCacheItemDependencies (string [] cacheKeys)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void AddCacheItemDependency (string cacheKey)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void AddFileDependencies (ArrayList filenames)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void AddFileDependencies (string [] filenames)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void AddFileDependency (string filename)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void AddHeader (string name, string value)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void AppendCookie (HttpCookie cookie)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void AppendHeader (string name, string value)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void AppendToLog (string param)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual string ApplyAppPathModifier (string virtualPath)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+
+ public virtual void BinaryWrite (byte [] buffer)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void Clear ()
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void ClearContent ()
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void ClearHeaders ()
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void Close ()
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void DisableKernelCache ()
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void End ()
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void Flush ()
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void Pics (string value)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void Redirect (string url)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void Redirect (string url, bool endResponse)
+ {
+ NotImplemented ();
+ }
+ public virtual void RedirectPermanent (string url)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RedirectPermanent (string url, bool endResponse)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RedirectToRoute (object routeValues)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RedirectToRoute (RouteValueDictionary routeValues)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RedirectToRoute (string routeName)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RedirectToRoute (string routeName, object routeValues)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RedirectToRoute (string routeName, RouteValueDictionary routeValues)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RedirectToRoutePermanent (object routeValues)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RedirectToRoutePermanent (RouteValueDictionary routeValues)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RedirectToRoutePermanent (string routeName)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RedirectToRoutePermanent (string routeName, object routeValues)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RedirectToRoutePermanent (string routeName, RouteValueDictionary routeValues)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RemoveOutputCacheItem (string path, string providerName)
+ {
+ NotImplemented ();
+ }
+ public virtual void RemoveOutputCacheItem (string path)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void SetCookie (HttpCookie cookie)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void TransmitFile (string filename)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void TransmitFile (string filename, long offset, long length)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void Write (char ch)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void Write (object obj)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void Write (string s)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void Write (char [] buffer, int index, int count)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void WriteFile (string filename)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void WriteFile (string filename, bool readIntoMemory)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void WriteFile (IntPtr fileHandle, long offset, long size)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void WriteFile (string filename, long offset, long size)
+ {
+ NotImplemented ();
+ }
+
+
+ public virtual void WriteSubstitution (HttpResponseSubstitutionCallback callback)
+ {
+ NotImplemented ();
+ }
+ }
+}
--- /dev/null
+//
+// HttpResponseWrapper.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
+using System.Globalization;
+using System.IO;
+using System.Runtime.CompilerServices;
+using System.Runtime.Serialization;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Text;
+using System.Web.Caching;
+using System.Threading;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class HttpResponseWrapper : HttpResponseBase
+ {
+ HttpResponse w;
+
+ public HttpResponseWrapper (HttpResponse httpResponse)
+ {
+ if (httpResponse == null)
+ throw new ArgumentNullException ("httpResponse");
+ w = httpResponse;
+ }
+
+ public override bool Buffer {
+ get { return w.Buffer; }
+ set { w.Buffer = value; }
+ }
+
+ public override bool BufferOutput {
+ get { return w.BufferOutput; }
+ set { w.BufferOutput = value; }
+ }
+
+ public override HttpCachePolicyBase Cache {
+ get { return new HttpCachePolicyWrapper (w.Cache); }
+ }
+
+ public override string CacheControl {
+ get { return w.CacheControl; }
+ set { w.CacheControl = value; }
+ }
+
+ public override string Charset {
+ get { return w.Charset; }
+ set { w.Charset = value; }
+ }
+
+ public override CancellationToken ClientDisconnectedToken {
+ get { return CancellationToken.None; }
+ }
+
+ public override Encoding ContentEncoding {
+ get { return w.ContentEncoding; }
+ set { w.ContentEncoding = value; }
+ }
+
+ public override string ContentType {
+ get { return w.ContentType; }
+ set { w.ContentType = value; }
+ }
+
+ public override HttpCookieCollection Cookies {
+ get { return w.Cookies; }
+ }
+
+ public override int Expires {
+ get { return w.Expires; }
+ set { w.Expires = value; }
+ }
+
+ public override DateTime ExpiresAbsolute {
+ get { return w.ExpiresAbsolute; }
+ set { w.ExpiresAbsolute = value; }
+ }
+
+ public override Stream Filter {
+ get { return w.Filter; }
+ set { w.Filter = value; }
+ }
+
+ public override Encoding HeaderEncoding {
+ get { return w.HeaderEncoding; }
+ set { w.HeaderEncoding = value; }
+ }
+
+ public override NameValueCollection Headers {
+ get { return w.Headers; }
+ }
+
+ public override bool IsClientConnected {
+ get { return w.IsClientConnected; }
+ }
+
+ public override bool IsRequestBeingRedirected {
+ get { return w.IsRequestBeingRedirected; }
+ }
+
+ public override TextWriter Output {
+ get { return w.Output; }
+ set { w.Output = value; }
+ }
+
+ public override Stream OutputStream {
+ get { return w.OutputStream; }
+ }
+
+ public override string RedirectLocation {
+ get { return w.RedirectLocation; }
+ set { w.RedirectLocation = value; }
+ }
+
+ public override string Status {
+ get { return w.Status; }
+ set { w.Status = value; }
+ }
+
+ public override int StatusCode {
+ get { return w.StatusCode; }
+ set { w.StatusCode = value; }
+ }
+
+ public override string StatusDescription {
+ get { return w.StatusDescription; }
+ set { w.StatusDescription = value; }
+ }
+
+ public override int SubStatusCode {
+ get { return w.SubStatusCode; }
+ set { w.SubStatusCode = value; }
+ }
+
+ public override bool SuppressContent {
+ get { return w.SuppressContent; }
+ set { w.SuppressContent = value; }
+ }
+
+ public override bool SuppressFormsAuthenticationRedirect {
+ get { return w.SuppressFormsAuthenticationRedirect; }
+ set { w.SuppressFormsAuthenticationRedirect = value; }
+ }
+
+ public override bool TrySkipIisCustomErrors {
+ get { return w.TrySkipIisCustomErrors; }
+ set { w.TrySkipIisCustomErrors = value; }
+ }
+
+ public override void AddCacheDependency (params CacheDependency [] dependencies)
+ {
+ w.AddCacheDependency (dependencies);
+ }
+
+ public override void AddCacheItemDependencies (ArrayList cacheKeys)
+ {
+ w.AddCacheItemDependencies (cacheKeys);
+ }
+
+ public override void AddCacheItemDependencies (string [] cacheKeys)
+ {
+ w.AddCacheItemDependencies (cacheKeys);
+ }
+
+ public override void AddCacheItemDependency (string cacheKey)
+ {
+ w.AddCacheItemDependency (cacheKey);
+ }
+
+ public override void AddFileDependencies (ArrayList filenames)
+ {
+ w.AddFileDependencies (filenames);
+ }
+
+ public override void AddFileDependencies (string [] filenames)
+ {
+ w.AddFileDependencies (filenames);
+ }
+
+ public override void AddFileDependency (string filename)
+ {
+ w.AddFileDependency (filename);
+ }
+
+ public override void AddHeader (string name, string value)
+ {
+ w.AddHeader (name, value);
+ }
+
+ public override void AppendCookie (HttpCookie cookie)
+ {
+ w.AppendCookie (cookie);
+ }
+
+ public override void AppendHeader (string name, string value)
+ {
+ w.AppendHeader (name, value);
+ }
+
+ public override void AppendToLog (string param)
+ {
+ w.AppendToLog (param);
+ }
+
+ public override string ApplyAppPathModifier (string overridePath)
+ {
+ return w.ApplyAppPathModifier (overridePath);
+ }
+
+ public override void BinaryWrite (byte [] buffer)
+ {
+ w.BinaryWrite (buffer);
+ }
+
+ public override void Clear ()
+ {
+ w.Clear ();
+ }
+
+ public override void ClearContent ()
+ {
+ w.ClearContent ();
+ }
+
+ public override void ClearHeaders ()
+ {
+ w.ClearHeaders ();
+ }
+
+ public override void Close ()
+ {
+ w.Close ();
+ }
+
+ public override void DisableKernelCache ()
+ {
+ w.DisableKernelCache ();
+ }
+
+ public override void End ()
+ {
+ w.End ();
+ }
+
+ public override void Flush ()
+ {
+ w.Flush ();
+ }
+
+ public override void Pics (string value)
+ {
+ w.Pics (value);
+ }
+
+ public override void Redirect (string url)
+ {
+ w.Redirect (url);
+ }
+
+ public override void Redirect (string url, bool endResponse)
+ {
+ w.Redirect (url, endResponse);
+ }
+ public override void RedirectPermanent (string url)
+ {
+ w.RedirectPermanent (url);
+ }
+
+ public override void RedirectPermanent (string url, bool endResponse)
+ {
+ w.RedirectPermanent (url, endResponse);
+ }
+
+ public override void RemoveOutputCacheItem (string path, string providerName)
+ {
+ HttpResponse.RemoveOutputCacheItem (path, providerName);
+ }
+ public override void RemoveOutputCacheItem (string path)
+ {
+ HttpResponse.RemoveOutputCacheItem (path);
+ }
+
+ public override void SetCookie (HttpCookie cookie)
+ {
+ w.SetCookie (cookie);
+ }
+
+ public override void TransmitFile (string filename)
+ {
+ w.TransmitFile (filename);
+ }
+
+ public override void TransmitFile (string filename, long offset, long length)
+ {
+ w.TransmitFile (filename, offset, length);
+ }
+
+ public override void Write (char ch)
+ {
+ w.Write (ch);
+ }
+
+ public override void Write (object obj)
+ {
+ w.Write (obj);
+ }
+
+ public override void Write (string s)
+ {
+ w.Write (s);
+ }
+
+ public override void Write (char [] buffer, int index, int count)
+ {
+ w.Write (buffer, index, count);
+ }
+
+ public override void WriteFile (string filename)
+ {
+ w.WriteFile (filename);
+ }
+
+ public override void WriteFile (string filename, bool readIntoMemory)
+ {
+ w.WriteFile (filename, readIntoMemory);
+ }
+
+ public override void WriteFile (IntPtr fileHandle, long offset, long size)
+ {
+ w.WriteFile (fileHandle, offset, size);
+ }
+
+ public override void WriteFile (string filename, long offset, long size)
+ {
+ w.WriteFile (filename, offset, size);
+ }
+
+ public override void WriteSubstitution (HttpResponseSubstitutionCallback callback)
+ {
+ w.WriteSubstitution (callback);
+ }
+ }
+}
--- /dev/null
+//
+// HttpServerUtilityBase.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
+using System.Globalization;
+using System.IO;
+using System.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+using System.Web.Profile;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public abstract class HttpServerUtilityBase
+ {
+ void NotImplemented ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual string MachineName { get { NotImplemented (); return null; } }
+
+ public virtual int ScriptTimeout { get { NotImplemented (); return 0; } set { NotImplemented (); } }
+
+
+ public virtual void ClearError ()
+ {
+ NotImplemented ();
+ }
+
+ public virtual object CreateObject (string progID)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual object CreateObject (Type type)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual object CreateObjectFromClsid (string clsid)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual void Execute (string path)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void Execute (string path, bool preserveForm)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void Execute (string path, TextWriter writer)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void Execute (string path, TextWriter writer, bool preserveForm)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void Execute (IHttpHandler handler, TextWriter writer, bool preserveForm)
+ {
+ NotImplemented ();
+ }
+
+ public virtual Exception GetLastError ()
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual string HtmlDecode (string s)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual void HtmlDecode (string s, TextWriter output)
+ {
+ NotImplemented ();
+ }
+
+ public virtual string HtmlEncode (string s)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual void HtmlEncode (string s, TextWriter output)
+ {
+ NotImplemented ();
+ }
+
+ public virtual string MapPath (string path)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual void Transfer (string path)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void Transfer (string path, bool preserveForm)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void Transfer (IHttpHandler handler, bool preserveForm)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void TransferRequest (string path)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void TransferRequest (string path, bool preserveForm)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void TransferRequest (string path, bool preserveForm, string method, NameValueCollection headers)
+ {
+ NotImplemented ();
+ }
+
+ public virtual string UrlDecode (string s)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual void UrlDecode (string s, TextWriter output)
+ {
+ NotImplemented ();
+ }
+
+ public virtual string UrlEncode (string s)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual void UrlEncode (string s, TextWriter output)
+ {
+ NotImplemented ();
+ }
+
+ public virtual string UrlPathEncode (string s)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual byte [] UrlTokenDecode (string input)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual string UrlTokenEncode (byte [] input)
+ {
+ NotImplemented ();
+ return null;
+ }
+ }
+}
--- /dev/null
+//
+// HttpServerUtilityWrapper.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
+using System.Globalization;
+using System.IO;
+using System.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+using System.Web.Profile;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class HttpServerUtilityWrapper : HttpServerUtilityBase
+ {
+ HttpServerUtility w;
+
+ public HttpServerUtilityWrapper (HttpServerUtility httpServerUtility)
+ {
+ if (httpServerUtility == null)
+ throw new ArgumentNullException ("httpServerUtility");
+ w = httpServerUtility;
+ }
+
+ public override string MachineName {
+ get { return w.MachineName; }
+ }
+
+ public override int ScriptTimeout {
+ get { return w.ScriptTimeout; }
+ set { w.ScriptTimeout = value; }
+ }
+
+ public override void ClearError ()
+ {
+ w.ClearError ();
+ }
+
+ public override object CreateObject (string progID)
+ {
+ return w.CreateObject (progID);
+ }
+
+ public override object CreateObject (Type type)
+ {
+ return w.CreateObject (type);
+ }
+
+ public override object CreateObjectFromClsid (string clsid)
+ {
+ return w.CreateObjectFromClsid (clsid);
+ }
+
+ public override void Execute (string path)
+ {
+ w.Execute (path);
+ }
+
+ public override void Execute (string path, bool preserveForm)
+ {
+ w.Execute (path, preserveForm);
+ }
+
+ public override void Execute (string path, TextWriter writer)
+ {
+ w.Execute (path, writer);
+ }
+
+ public override void Execute (string path, TextWriter writer, bool preserveForm)
+ {
+ w.Execute (path, writer, preserveForm);
+ }
+
+ public override void Execute (IHttpHandler handler, TextWriter writer, bool preserveForm)
+ {
+ w.Execute (handler, writer, preserveForm);
+ }
+
+ public override Exception GetLastError ()
+ {
+ return w.GetLastError ();
+ }
+
+ public override string HtmlDecode (string s)
+ {
+ return w.HtmlDecode (s);
+ }
+
+ public override void HtmlDecode (string s, TextWriter output)
+ {
+ w.HtmlDecode (s, output);
+ }
+
+ public override string HtmlEncode (string s)
+ {
+ return w.HtmlEncode (s);
+ }
+
+ public override void HtmlEncode (string s, TextWriter output)
+ {
+ w.HtmlEncode (s, output);
+ }
+
+ public override string MapPath (string path)
+ {
+ return w.MapPath (path);
+ }
+
+ public override void Transfer (string path)
+ {
+ w.Transfer (path);
+ }
+
+ public override void Transfer (string path, bool preserveForm)
+ {
+ w.Transfer (path, preserveForm);
+ }
+
+ public override void Transfer (IHttpHandler handler, bool preserveForm)
+ {
+ w.Transfer (handler, preserveForm);
+ }
+
+ [MonoTODO]
+ public override void TransferRequest (string path)
+ {
+ // return TransferRequest (path);
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override void TransferRequest (string path, bool preserveForm)
+ {
+ // return TransferRequest (path, preserveForm);
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override void TransferRequest (string path, bool preserveForm, string method, NameValueCollection headers)
+ {
+ // return TransferRequest (path, preserveForm, method, headers);
+ throw new NotImplementedException ();
+ }
+
+ public override string UrlDecode (string s)
+ {
+ return w.UrlDecode (s);
+ }
+
+ public override void UrlDecode (string s, TextWriter output)
+ {
+ w.UrlDecode (s, output);
+ }
+
+ public override string UrlEncode (string s)
+ {
+ return w.UrlEncode (s);
+ }
+
+ public override void UrlEncode (string s, TextWriter output)
+ {
+ w.UrlEncode (s, output);
+ }
+
+ public override string UrlPathEncode (string s)
+ {
+ return w.UrlPathEncode (s);
+ }
+
+ [MonoTODO]
+ public override byte [] UrlTokenDecode (string input)
+ {
+ // return w.UrlTokenDecode (input);
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override string UrlTokenEncode (byte [] input)
+ {
+ // return w.UrlTokenEncode (input);
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+//
+// HttpSessionStateBase.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
+using System.Globalization;
+using System.IO;
+using System.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+using System.Web.SessionState;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public abstract class HttpSessionStateBase : ICollection, IEnumerable
+ {
+ void NotImplemented ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual int CodePage { get { NotImplemented (); return 0; } set { NotImplemented (); } }
+
+ public virtual HttpSessionStateBase Contents { get { NotImplemented (); return null; } }
+
+ public virtual HttpCookieMode CookieMode { get { NotImplemented (); return default (HttpCookieMode); } }
+
+ public virtual int Count { get { NotImplemented (); return 0; } }
+
+ public virtual bool IsCookieless { get { NotImplemented (); return false; } }
+
+ public virtual bool IsNewSession { get { NotImplemented (); return false; } }
+
+ public virtual bool IsReadOnly { get { NotImplemented (); return false; } }
+
+ public virtual bool IsSynchronized { get { NotImplemented (); return false; } }
+
+ public virtual object this [int index] {
+ get { NotImplemented (); return null; }
+ set { NotImplemented (); }
+ }
+
+ public virtual object this [string name] {
+ get { NotImplemented (); return null; }
+ set { NotImplemented (); }
+ }
+
+ public virtual NameObjectCollectionBase.KeysCollection Keys { get { NotImplemented (); return null; } }
+
+ public virtual int LCID { get { NotImplemented (); return 0; } set { NotImplemented (); } }
+
+ public virtual SessionStateMode Mode { get { NotImplemented (); return default (SessionStateMode); } }
+
+ public virtual string SessionID { get { NotImplemented (); return null; } }
+
+ public virtual HttpStaticObjectsCollectionBase StaticObjects { get { NotImplemented (); return null; } }
+
+ public virtual object SyncRoot { get { NotImplemented (); return null; } }
+
+ public virtual int Timeout { get { NotImplemented (); return 0; } set { NotImplemented (); } }
+
+
+ public virtual void Abandon ()
+ {
+ NotImplemented ();
+ }
+
+ public virtual void Add (string name, object value)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void Clear ()
+ {
+ NotImplemented ();
+ }
+
+ public virtual void CopyTo (Array array, int index)
+ {
+ NotImplemented ();
+ }
+
+ public virtual IEnumerator GetEnumerator ()
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual void Remove (string name)
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RemoveAll ()
+ {
+ NotImplemented ();
+ }
+
+ public virtual void RemoveAt (int index)
+ {
+ NotImplemented ();
+ }
+ }
+}
--- /dev/null
+//
+// HttpSessionStateWrapper.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
+using System.Globalization;
+using System.IO;
+using System.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+using System.Web.SessionState;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class HttpSessionStateWrapper : HttpSessionStateBase
+ {
+ HttpSessionState w;
+
+ public HttpSessionStateWrapper (HttpSessionState httpSessionState)
+ {
+ if (httpSessionState == null)
+ throw new ArgumentNullException ("httpSessionState");
+ w = httpSessionState;
+ }
+
+ public override int CodePage {
+ get { return w.CodePage; }
+ set { w.CodePage = value; }
+ }
+
+ public override HttpSessionStateBase Contents {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override HttpCookieMode CookieMode {
+ //get { return w.CookieMode; }
+ get { throw new NotImplementedException (); }
+ }
+
+ public override int Count {
+ get { return w.Count; }
+ }
+
+ public override bool IsCookieless {
+ get { return w.IsCookieless; }
+ }
+
+ public override bool IsNewSession {
+ get { return w.IsNewSession; }
+ }
+
+ public override bool IsReadOnly {
+ get { return w.IsReadOnly; }
+ }
+
+ public override bool IsSynchronized {
+ get { return w.IsSynchronized; }
+ }
+
+ public override object this [int index] {
+ get { return w [index]; }
+ set { w [index] = value; }
+ }
+
+ public override object this [string name] {
+ get { return w [name]; }
+ set { w [name] = value; }
+ }
+
+ public override NameObjectCollectionBase.KeysCollection Keys {
+ get { return w.Keys; }
+ }
+
+ public override int LCID {
+ get { return w.LCID; }
+ set { w.LCID = value; }
+ }
+
+ public override SessionStateMode Mode {
+ get { return w.Mode; }
+ }
+
+ public override string SessionID {
+ get { return w.SessionID; }
+ }
+
+ public override HttpStaticObjectsCollectionBase StaticObjects {
+ get { throw new NotImplementedException (); }
+ }
+
+ public override object SyncRoot {
+ get { return w.SyncRoot; }
+ }
+
+ public override int Timeout {
+ get { return w.Timeout; }
+ set { w.Timeout = value; }
+ }
+
+ public override void Abandon ()
+ {
+ w.Abandon ();
+ }
+
+ public override void Add (string name, object value)
+ {
+ w.Add (name, value);
+ }
+
+ public override void Clear ()
+ {
+ w.Clear ();
+ }
+
+ public override void CopyTo (Array array, int index)
+ {
+ w.CopyTo (array, index);
+ }
+
+ public override IEnumerator GetEnumerator ()
+ {
+ return w.GetEnumerator ();
+ }
+
+ public override void Remove (string name)
+ {
+ w.Remove (name);
+ }
+
+ public override void RemoveAll ()
+ {
+ w.RemoveAll ();
+ }
+
+ public override void RemoveAt (int index)
+ {
+ w.RemoveAt (index);
+ }
+ }
+}
--- /dev/null
+//
+// HttpStaticObjectsCollectionBase.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
+using System.Globalization;
+using System.IO;
+using System.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+using System.Web.SessionState;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public abstract class HttpStaticObjectsCollectionBase : ICollection, IEnumerable
+ {
+ void NotImplemented ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual int Count { get { NotImplemented (); return 0; } }
+
+ public virtual bool IsReadOnly { get { NotImplemented (); return false; } }
+
+ public virtual bool IsSynchronized { get { NotImplemented (); return false; } }
+
+ public virtual object this [string name] {
+ get { NotImplemented (); return null; }
+ }
+
+ public virtual bool NeverAccessed { get { NotImplemented (); return false; } }
+
+ public virtual object SyncRoot { get { NotImplemented (); return null; } }
+
+ public virtual void CopyTo (Array array, int index)
+ {
+ NotImplemented ();
+ }
+
+ public virtual IEnumerator GetEnumerator ()
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual object GetObject (string name)
+ {
+ NotImplemented ();
+ return null;
+ }
+
+ public virtual void Serialize (BinaryWriter writer)
+ {
+ NotImplemented ();
+ }
+ }
+}
--- /dev/null
+//
+// HttpStaticObjectsCollectionWrapper.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2008 Novell Inc. http://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.Collections.Specialized;
+using System.Globalization;
+using System.IO;
+using System.Runtime.CompilerServices;
+using System.Security.Permissions;
+using System.Security.Principal;
+using System.Web.Caching;
+using System.Web.SessionState;
+
+namespace System.Web
+{
+ [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ public class HttpStaticObjectsCollectionWrapper : HttpStaticObjectsCollectionBase
+ {
+ HttpStaticObjectsCollection w;
+
+ public HttpStaticObjectsCollectionWrapper (HttpStaticObjectsCollection httpStaticObjectsCollection)
+ {
+ if (httpStaticObjectsCollection == null)
+ throw new ArgumentNullException ("httpStaticObjectsCollection");
+ w = httpStaticObjectsCollection;
+ }
+
+ public override int Count {
+ get { return w.Count; }
+ }
+
+ public override bool IsReadOnly {
+ get { return w.IsReadOnly; }
+ }
+
+ public override bool IsSynchronized {
+ get { return w.IsSynchronized; }
+ }
+
+ public override object this [string name] {
+ get { return w [name]; }
+ }
+
+ public override bool NeverAccessed {
+ get { return w.NeverAccessed; }
+ }
+
+ public override object SyncRoot {
+ get { return w.SyncRoot; }
+ }
+
+ public override void CopyTo (Array array, int index)
+ {
+ w.CopyTo (array, index);
+ }
+
+ public override IEnumerator GetEnumerator ()
+ {
+ return w.GetEnumerator ();
+ }
+
+ public override object GetObject (string name)
+ {
+ return w.GetObject (name);
+ }
+
+ public override void Serialize (BinaryWriter writer)
+ {
+ w.Serialize (writer);
+ }
+ }
+}