Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / Configuration / UrlMappingsSection.cs / 3 / UrlMappingsSection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.Globalization; using System.IO; using System.Text; using System.ComponentModel; using System.Web.Util; using System.Diagnostics; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class UrlMappingsSection : ConfigurationSection { private static ConfigurationPropertyCollection _properties; #region Property Declarations private static readonly ConfigurationProperty _propEnabled = new ConfigurationProperty("enabled", typeof(bool), true, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propMappings = new ConfigurationProperty(null, typeof(UrlMappingCollection), null, ConfigurationPropertyOptions.IsDefaultCollection); #endregion static UrlMappingsSection() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propMappings); _properties.Add(_propEnabled); } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("", IsDefaultCollection = true)] public UrlMappingCollection UrlMappings { get { return (UrlMappingCollection)base[_propMappings]; } } [ConfigurationProperty("enabled", DefaultValue = true)] public bool IsEnabled { get { return (bool)base[_propEnabled]; } set { base[_propEnabled] = value; } } internal string HttpResolveMapping(string path) { string result = null; // Convert the 'path' param to be a relative path string relative = UrlPath.MakeVirtualPathAppRelative(path); // Look it up in our map UrlMapping elem = UrlMappings[relative]; if (elem != null) { result = elem.MappedUrl; } return result; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.Globalization; using System.IO; using System.Text; using System.ComponentModel; using System.Web.Util; using System.Diagnostics; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class UrlMappingsSection : ConfigurationSection { private static ConfigurationPropertyCollection _properties; #region Property Declarations private static readonly ConfigurationProperty _propEnabled = new ConfigurationProperty("enabled", typeof(bool), true, ConfigurationPropertyOptions.None); private static readonly ConfigurationProperty _propMappings = new ConfigurationProperty(null, typeof(UrlMappingCollection), null, ConfigurationPropertyOptions.IsDefaultCollection); #endregion static UrlMappingsSection() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propMappings); _properties.Add(_propEnabled); } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("", IsDefaultCollection = true)] public UrlMappingCollection UrlMappings { get { return (UrlMappingCollection)base[_propMappings]; } } [ConfigurationProperty("enabled", DefaultValue = true)] public bool IsEnabled { get { return (bool)base[_propEnabled]; } set { base[_propEnabled] = value; } } internal string HttpResolveMapping(string path) { string result = null; // Convert the 'path' param to be a relative path string relative = UrlPath.MakeVirtualPathAppRelative(path); // Look it up in our map UrlMapping elem = UrlMappings[relative]; if (elem != null) { result = elem.MappedUrl; } return result; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AccessDataSourceWizardForm.cs
- PathSegment.cs
- UnsafeNativeMethods.cs
- CLSCompliantAttribute.cs
- SchemaNamespaceManager.cs
- CLRBindingWorker.cs
- DataGridView.cs
- ScriptingAuthenticationServiceSection.cs
- IssuedTokenServiceElement.cs
- HttpWebResponse.cs
- CodeTypeParameterCollection.cs
- TextSpanModifier.cs
- IfAction.cs
- RemoteTokenFactory.cs
- RepeaterItem.cs
- Main.cs
- ReaderOutput.cs
- XmlSecureResolver.cs
- ConnectionStringsSection.cs
- DbConnectionHelper.cs
- UniformGrid.cs
- CardSpaceSelector.cs
- ToolStripCodeDomSerializer.cs
- PrintDialogException.cs
- EncodingNLS.cs
- AppDomainGrammarProxy.cs
- CheckBoxPopupAdapter.cs
- BitmapData.cs
- DesignerSerializationVisibilityAttribute.cs
- StaticDataManager.cs
- UshortList2.cs
- RegexReplacement.cs
- JournalEntryListConverter.cs
- ConnectorDragDropGlyph.cs
- Mappings.cs
- ExpressionBinding.cs
- ActivityDesignerLayoutSerializers.cs
- TrustSection.cs
- Section.cs
- CommentAction.cs
- SimpleRecyclingCache.cs
- DrawingBrush.cs
- __ConsoleStream.cs
- GridViewCommandEventArgs.cs
- EntitySet.cs
- SqlMethodCallConverter.cs
- hwndwrapper.cs
- CodeLinePragma.cs
- StringBuilder.cs
- DocumentOrderComparer.cs
- ElementAction.cs
- DataGridViewCellStyleConverter.cs
- TextPointerBase.cs
- DesignerForm.cs
- XmlArrayItemAttributes.cs
- DllNotFoundException.cs
- InvalidOperationException.cs
- NetDataContractSerializer.cs
- SessionState.cs
- SurrogateDataContract.cs
- MemberHolder.cs
- DivideByZeroException.cs
- SoapClientProtocol.cs
- RulePatternOps.cs
- ViewPort3D.cs
- AspNetHostingPermission.cs
- HttpRuntimeSection.cs
- EntityContainer.cs
- Crypto.cs
- DecoratedNameAttribute.cs
- LoginView.cs
- RadioButtonBaseAdapter.cs
- CounterSampleCalculator.cs
- DataGridViewComboBoxCell.cs
- Selection.cs
- OracleDataReader.cs
- BrushConverter.cs
- RegexFCD.cs
- ConfigurationManagerHelperFactory.cs
- SuppressMessageAttribute.cs
- XamlVector3DCollectionSerializer.cs
- LayoutTableCell.cs
- SamlAuthenticationClaimResource.cs
- VectorValueSerializer.cs
- ShapingEngine.cs
- OutputScopeManager.cs
- RequestQueryParser.cs
- SqlInfoMessageEvent.cs
- connectionpool.cs
- OpCellTreeNode.cs
- CheckBox.cs
- ComponentResourceKeyConverter.cs
- ConnectionsZone.cs
- OracleLob.cs
- DataGridCellAutomationPeer.cs
- ColorMatrix.cs
- UIElement.cs
- XmlNodeChangedEventArgs.cs
- HttpHeaderCollection.cs
- XXXOnTypeBuilderInstantiation.cs