Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / UrlMappingsSection.cs / 1305376 / 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; 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. // //----------------------------------------------------------------------------- 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; 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RotateTransform.cs
- DbBuffer.cs
- TableLayout.cs
- TransportContext.cs
- UnionCodeGroup.cs
- SystemIPv6InterfaceProperties.cs
- SolidColorBrush.cs
- BitmapCodecInfoInternal.cs
- SimpleWebHandlerParser.cs
- DataGridViewAdvancedBorderStyle.cs
- SizeAnimationBase.cs
- PixelFormats.cs
- SignatureHelper.cs
- CodeMethodInvokeExpression.cs
- PackageFilter.cs
- RSAOAEPKeyExchangeDeformatter.cs
- Span.cs
- SafeNativeMethods.cs
- DataGridItemCollection.cs
- X509Certificate.cs
- Image.cs
- ISAPIWorkerRequest.cs
- JournalEntryStack.cs
- WorkflowElementDialog.cs
- RowVisual.cs
- EpmAttributeNameBuilder.cs
- CodeDomConfigurationHandler.cs
- DictionaryKeyPropertyAttribute.cs
- ApplicationServiceManager.cs
- GroupQuery.cs
- TextRangeProviderWrapper.cs
- TypeSemantics.cs
- ObjectTokenCategory.cs
- XpsFilter.cs
- ProviderUtil.cs
- ItemsControlAutomationPeer.cs
- ClusterRegistryConfigurationProvider.cs
- SourceItem.cs
- EntityModelSchemaGenerator.cs
- RadialGradientBrush.cs
- QueryOperator.cs
- ActiveDocumentEvent.cs
- TryCatchDesigner.xaml.cs
- SafeNativeMemoryHandle.cs
- SymmetricCryptoHandle.cs
- Marshal.cs
- RolePrincipal.cs
- MessageProperties.cs
- CompositeFontInfo.cs
- TimeoutStream.cs
- PenLineJoinValidation.cs
- PagesChangedEventArgs.cs
- PreloadedPackages.cs
- DataMemberConverter.cs
- ChannelBuilder.cs
- SpotLight.cs
- CodeAssignStatement.cs
- ChineseLunisolarCalendar.cs
- EmbeddedMailObjectsCollection.cs
- ImageEditor.cs
- EditCommandColumn.cs
- AtomServiceDocumentSerializer.cs
- ImageFormatConverter.cs
- GroupBoxDesigner.cs
- ConfigurationElementCollection.cs
- State.cs
- infer.cs
- GridViewUpdatedEventArgs.cs
- SelectedDatesCollection.cs
- FirstMatchCodeGroup.cs
- KeyInterop.cs
- InkSerializer.cs
- TypedTableHandler.cs
- Literal.cs
- IItemProperties.cs
- EncodedStreamFactory.cs
- PictureBox.cs
- XmlSerializerFactory.cs
- MultiView.cs
- UpdatePanelTriggerCollection.cs
- XmlSchemaAttributeGroupRef.cs
- log.cs
- LocalizationComments.cs
- LabelEditEvent.cs
- ActivationArguments.cs
- WizardStepBase.cs
- WebResourceAttribute.cs
- SafeArrayRankMismatchException.cs
- PointKeyFrameCollection.cs
- ParameterToken.cs
- DotExpr.cs
- CroppedBitmap.cs
- SingleSelectRootGridEntry.cs
- DoubleAnimationBase.cs
- RawAppCommandInputReport.cs
- TypeConverterMarkupExtension.cs
- GridViewRowPresenter.cs
- Timer.cs
- ReferencedType.cs
- TemplateDefinition.cs