Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / Configuration / UrlMappingsSection.cs / 2 / 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; } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StringSorter.cs
- PathSegment.cs
- LineServices.cs
- CookieParameter.cs
- HelpKeywordAttribute.cs
- PriorityQueue.cs
- SoapIgnoreAttribute.cs
- TemplatePagerField.cs
- SchemaLookupTable.cs
- DataGridDesigner.cs
- AmbientEnvironment.cs
- WebDescriptionAttribute.cs
- Set.cs
- sqlpipe.cs
- DataGrid.cs
- MetafileHeaderWmf.cs
- ComplusEndpointConfigContainer.cs
- CacheDependency.cs
- SplineQuaternionKeyFrame.cs
- SettingsSection.cs
- IsolatedStorageFilePermission.cs
- Baml2006Reader.cs
- MarshalDirectiveException.cs
- ProtocolsConfigurationHandler.cs
- ServiceReference.cs
- LoginView.cs
- KeyGestureConverter.cs
- HtmlFormWrapper.cs
- InstanceContext.cs
- nulltextcontainer.cs
- CompensationHandlingFilter.cs
- PackageRelationshipCollection.cs
- TextRangeEditLists.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- wgx_render.cs
- TypeConverterHelper.cs
- FactorySettingsElement.cs
- SecondaryIndex.cs
- SQLBytesStorage.cs
- Decimal.cs
- TextSchema.cs
- DateTimePicker.cs
- EntityTemplateUserControl.cs
- CounterCreationDataCollection.cs
- PackageProperties.cs
- Attributes.cs
- ByteStreamGeometryContext.cs
- ColorConverter.cs
- PenContexts.cs
- StorageBasedPackageProperties.cs
- CodeTypeReference.cs
- CreateUserWizardStep.cs
- ConstraintCollection.cs
- BrowserCapabilitiesFactory35.cs
- FunctionImportMapping.cs
- XPathBinder.cs
- TreeNodeStyleCollectionEditor.cs
- AttributeData.cs
- GeometryDrawing.cs
- SmiEventSink_DeferedProcessing.cs
- ValidatorCollection.cs
- AnnouncementDispatcherAsyncResult.cs
- TraceContext.cs
- SQLBinaryStorage.cs
- ToolbarAUtomationPeer.cs
- Unit.cs
- StaticDataManager.cs
- UnicodeEncoding.cs
- GridViewRow.cs
- SqlStream.cs
- SafeSecurityHelper.cs
- DictionaryTraceRecord.cs
- DefaultPropertyAttribute.cs
- SoapHeaderException.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- EnumValAlphaComparer.cs
- InsufficientMemoryException.cs
- RegexNode.cs
- DynamicValidatorEventArgs.cs
- BaseCollection.cs
- DisposableCollectionWrapper.cs
- TableCellCollection.cs
- DrawingServices.cs
- SessionEndingCancelEventArgs.cs
- BoundField.cs
- ConstantExpression.cs
- ButtonAutomationPeer.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- SqlFlattener.cs
- BitmapCodecInfoInternal.cs
- CharacterBuffer.cs
- brushes.cs
- ColorContextHelper.cs
- SpeakCompletedEventArgs.cs
- HMACSHA256.cs
- SqlErrorCollection.cs
- EntityDataSourceDataSelection.cs
- HttpCapabilitiesSectionHandler.cs
- SQLInt32.cs
- ListViewAutomationPeer.cs