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
- ResourceContainer.cs
- reliableinputsessionchannel.cs
- CollectionViewGroupRoot.cs
- UpdateRecord.cs
- WhitespaceRuleLookup.cs
- StateItem.cs
- DefaultValueTypeConverter.cs
- ProviderUtil.cs
- SqlDataSourceFilteringEventArgs.cs
- XmlSchemaComplexContentRestriction.cs
- CompositeActivityValidator.cs
- ArgumentOutOfRangeException.cs
- FontFaceLayoutInfo.cs
- WebPartZone.cs
- NavigationService.cs
- TraceListener.cs
- HttpServerVarsCollection.cs
- SoapEnvelopeProcessingElement.cs
- SessionEndingEventArgs.cs
- IdentityModelDictionary.cs
- ContextMenuAutomationPeer.cs
- VisualTarget.cs
- ListViewAutomationPeer.cs
- HttpBindingExtension.cs
- ConstraintStruct.cs
- LayoutInformation.cs
- TargetPerspective.cs
- ListBindableAttribute.cs
- SymLanguageVendor.cs
- MouseDevice.cs
- OdbcDataAdapter.cs
- ThicknessConverter.cs
- LayoutEvent.cs
- CacheSection.cs
- NumericPagerField.cs
- PackageStore.cs
- ToolStripTextBox.cs
- DBPropSet.cs
- CngAlgorithm.cs
- CodeArgumentReferenceExpression.cs
- XmlSchemaComplexContentRestriction.cs
- Pens.cs
- ProvidePropertyAttribute.cs
- HttpDictionary.cs
- RelationshipFixer.cs
- OracleSqlParser.cs
- PackagePart.cs
- Point4D.cs
- GenericUriParser.cs
- EntityDataSourceUtil.cs
- DbExpressionBuilder.cs
- StylusEventArgs.cs
- WebPartEditorOkVerb.cs
- FixedSOMFixedBlock.cs
- StylusPlugin.cs
- CookieParameter.cs
- ZipIOLocalFileBlock.cs
- LogWriteRestartAreaAsyncResult.cs
- FormView.cs
- Timer.cs
- NotSupportedException.cs
- ExpressionEvaluator.cs
- DataColumnMapping.cs
- EntityDataSourceDesignerHelper.cs
- DiscreteKeyFrames.cs
- UIElementParagraph.cs
- FirstQueryOperator.cs
- VisualStateChangedEventArgs.cs
- LogicalExpr.cs
- TraceLog.cs
- RoleManagerSection.cs
- WasEndpointConfigContainer.cs
- NamedPipeAppDomainProtocolHandler.cs
- SapiAttributeParser.cs
- ObjectSecurity.cs
- ComboBoxRenderer.cs
- SimplePropertyEntry.cs
- EntityKey.cs
- EntitySqlException.cs
- NumberSubstitution.cs
- DataObjectEventArgs.cs
- FormsAuthenticationModule.cs
- IPPacketInformation.cs
- EdmItemError.cs
- PartitionedDataSource.cs
- QueryRewriter.cs
- ItemList.cs
- RootBrowserWindow.cs
- TextAutomationPeer.cs
- ExpressionBuilderCollection.cs
- InfoCardConstants.cs
- sqlcontext.cs
- smtpconnection.cs
- HttpModuleAction.cs
- ScriptingProfileServiceSection.cs
- KnownBoxes.cs
- XmlCharType.cs
- SelectionRange.cs
- RootBrowserWindow.cs
- RegexCapture.cs