Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / Configuration / UrlMappingsSection.cs / 1 / 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. // //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AbsoluteQuery.cs
- KeyNotFoundException.cs
- WinInetCache.cs
- MemoryStream.cs
- RegistrationServices.cs
- IisTraceListener.cs
- DataGridViewCellFormattingEventArgs.cs
- SortFieldComparer.cs
- SqlBulkCopyColumnMappingCollection.cs
- ScalarType.cs
- HttpListenerTimeoutManager.cs
- BinaryOperationBinder.cs
- TableLayoutStyle.cs
- DynamicFilterExpression.cs
- IdnElement.cs
- JavaScriptString.cs
- ContextStaticAttribute.cs
- EmptyStringExpandableObjectConverter.cs
- FieldNameLookup.cs
- DataException.cs
- WebPartConnection.cs
- ContextStack.cs
- CodeRegionDirective.cs
- EncodingInfo.cs
- StateItem.cs
- PageContentCollection.cs
- LayoutDump.cs
- DataFormats.cs
- WmlLabelAdapter.cs
- WindowsGrip.cs
- ExchangeUtilities.cs
- CommandHelper.cs
- SmiTypedGetterSetter.cs
- SafeNativeMethodsOther.cs
- ZoomingMessageFilter.cs
- MarginsConverter.cs
- Process.cs
- _SecureChannel.cs
- DbConnectionFactory.cs
- UniqueSet.cs
- MenuEventArgs.cs
- PointF.cs
- XmlC14NWriter.cs
- TextBoxRenderer.cs
- GlyphCache.cs
- PathSegment.cs
- TypeDescriptor.cs
- OneToOneMappingSerializer.cs
- WCFServiceClientProxyGenerator.cs
- CalendarDesigner.cs
- SmiGettersStream.cs
- Logging.cs
- ChildChangedEventArgs.cs
- TemplateInstanceAttribute.cs
- DiscoveryDocumentSearchPattern.cs
- VirtualPathProvider.cs
- TransformValueSerializer.cs
- COM2PropertyDescriptor.cs
- SmtpException.cs
- XpsImageSerializationService.cs
- BaseDataListActionList.cs
- VirtualPathUtility.cs
- FileVersion.cs
- SafeFileMapViewHandle.cs
- SerializationFieldInfo.cs
- WindowsFormsLinkLabel.cs
- DetailsViewRowCollection.cs
- GridViewCommandEventArgs.cs
- GeometryHitTestResult.cs
- ProgressiveCrcCalculatingStream.cs
- XmlDocument.cs
- SchemaTableOptionalColumn.cs
- PerformanceCountersElement.cs
- TableLayoutStyleCollection.cs
- ContractMapping.cs
- InvalidWMPVersionException.cs
- mediaeventargs.cs
- FacetEnabledSchemaElement.cs
- PathFigureCollection.cs
- AppSettingsExpressionBuilder.cs
- XXXInfos.cs
- XmlAttributeCollection.cs
- ProfileEventArgs.cs
- Matrix3DStack.cs
- basemetadatamappingvisitor.cs
- ListItemCollection.cs
- Rotation3DAnimationBase.cs
- OlePropertyStructs.cs
- ListChunk.cs
- RawStylusSystemGestureInputReport.cs
- Buffer.cs
- XmlDataSourceView.cs
- XmlDataSourceNodeDescriptor.cs
- XmlStreamedByteStreamReader.cs
- StorageAssociationSetMapping.cs
- ContextInformation.cs
- CombinedGeometry.cs
- TableLayoutColumnStyleCollection.cs
- JsonReader.cs
- ScrollItemPatternIdentifiers.cs