Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / xsp / System / Web / Configuration / UrlMapping.cs / 1 / UrlMapping.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 UrlMapping : ConfigurationElement { private static ConfigurationPropertyCollection _properties; #region Property Declarations private static readonly ConfigurationProperty _propUrl = new ConfigurationProperty("url", typeof(string), null, StdValidatorsAndConverters.WhiteSpaceTrimStringConverter, new CallbackValidator(typeof(string), ValidateUrl), ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey); private static readonly ConfigurationProperty _propMappedUrl = new ConfigurationProperty("mappedUrl", typeof(string), null, StdValidatorsAndConverters.WhiteSpaceTrimStringConverter, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.IsRequired); #endregion static UrlMapping() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propUrl); _properties.Add(_propMappedUrl); } internal UrlMapping() { } public UrlMapping(string url, string mappedUrl) { base[_propUrl] = url; base[_propMappedUrl] = mappedUrl; } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("url", IsRequired = true, IsKey = true)] public string Url { get { return (string)base[_propUrl]; } } [ConfigurationProperty("mappedUrl", IsRequired = true)] public string MappedUrl { get { return (string)base[_propMappedUrl]; } } static private void ValidateUrl(object value) { // The Url cannot be an empty string. Use the std validator for that StdValidatorsAndConverters.NonEmptyStringValidator.Validate(value); string url = (string)value; if (!UrlPath.IsAppRelativePath(url)) { throw new ConfigurationErrorsException(SR.GetString(SR.UrlMappings_only_app_relative_url_allowed, url)); } } } } // 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 UrlMapping : ConfigurationElement { private static ConfigurationPropertyCollection _properties; #region Property Declarations private static readonly ConfigurationProperty _propUrl = new ConfigurationProperty("url", typeof(string), null, StdValidatorsAndConverters.WhiteSpaceTrimStringConverter, new CallbackValidator(typeof(string), ValidateUrl), ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey); private static readonly ConfigurationProperty _propMappedUrl = new ConfigurationProperty("mappedUrl", typeof(string), null, StdValidatorsAndConverters.WhiteSpaceTrimStringConverter, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.IsRequired); #endregion static UrlMapping() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propUrl); _properties.Add(_propMappedUrl); } internal UrlMapping() { } public UrlMapping(string url, string mappedUrl) { base[_propUrl] = url; base[_propMappedUrl] = mappedUrl; } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("url", IsRequired = true, IsKey = true)] public string Url { get { return (string)base[_propUrl]; } } [ConfigurationProperty("mappedUrl", IsRequired = true)] public string MappedUrl { get { return (string)base[_propMappedUrl]; } } static private void ValidateUrl(object value) { // The Url cannot be an empty string. Use the std validator for that StdValidatorsAndConverters.NonEmptyStringValidator.Validate(value); string url = (string)value; if (!UrlPath.IsAppRelativePath(url)) { throw new ConfigurationErrorsException(SR.GetString(SR.UrlMappings_only_app_relative_url_allowed, url)); } } } } // 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
- SqlConnectionPoolGroupProviderInfo.cs
- CollectionChangeEventArgs.cs
- DocobjHost.cs
- HandlerBase.cs
- InstanceCreationEditor.cs
- SpecialFolderEnumConverter.cs
- ResXFileRef.cs
- DynamicField.cs
- DataServiceQueryProvider.cs
- XmlSchemaInferenceException.cs
- TimeoutException.cs
- CustomPopupPlacement.cs
- CharacterHit.cs
- InheritanceService.cs
- NullToBooleanConverter.cs
- DBBindings.cs
- TreeNode.cs
- SafeTimerHandle.cs
- ExpressionBuilder.cs
- DataFormat.cs
- FileDialog_Vista_Interop.cs
- XmlChoiceIdentifierAttribute.cs
- SqlParameterCollection.cs
- Tag.cs
- TypeReference.cs
- TogglePattern.cs
- X509ClientCertificateAuthenticationElement.cs
- X509LogoTypeExtension.cs
- SoapEnumAttribute.cs
- TransformerInfoCollection.cs
- RunInstallerAttribute.cs
- handlecollector.cs
- LicenseManager.cs
- GridLength.cs
- AccessorTable.cs
- cookiecollection.cs
- mongolianshape.cs
- FixedHyperLink.cs
- altserialization.cs
- wgx_commands.cs
- ImageDrawing.cs
- CodeGen.cs
- MessageEventSubscriptionService.cs
- ClaimSet.cs
- StateDesignerConnector.cs
- ConstructorBuilder.cs
- TimerElapsedEvenArgs.cs
- CheckBoxStandardAdapter.cs
- ClientBuildManager.cs
- ArgumentDesigner.xaml.cs
- SqlStatistics.cs
- BindingElement.cs
- DataAccessException.cs
- TextServicesCompartment.cs
- SmiGettersStream.cs
- XmlAttributes.cs
- PasswordTextNavigator.cs
- HtmlTableRowCollection.cs
- UnionExpr.cs
- FrameworkContentElement.cs
- StreamUpdate.cs
- XMLSchema.cs
- DateTimeValueSerializerContext.cs
- SmtpNegotiateAuthenticationModule.cs
- CodeAttachEventStatement.cs
- mda.cs
- DataGridViewCellStyleConverter.cs
- DropTarget.cs
- MasterPage.cs
- ReflectEventDescriptor.cs
- ParameterBuilder.cs
- StrongNameIdentityPermission.cs
- OpenTypeLayoutCache.cs
- streamingZipPartStream.cs
- DiscoveryDocumentSerializer.cs
- milexports.cs
- WebPartManagerInternals.cs
- WorkflowTransactionOptions.cs
- StringValidator.cs
- DataStreams.cs
- XmlEncodedRawTextWriter.cs
- RemoteDebugger.cs
- TextSelectionProcessor.cs
- PropertyEmitter.cs
- UserNameSecurityTokenParameters.cs
- Soap.cs
- Typography.cs
- _ChunkParse.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- Directory.cs
- BitmapEffectDrawingContextWalker.cs
- CatalogPartDesigner.cs
- WindowsListViewGroupHelper.cs
- TreeBuilder.cs
- ToolStripRendererSwitcher.cs
- TableHeaderCell.cs
- EventHandlers.cs
- ProcessThreadCollection.cs
- DataServiceException.cs
- KnownBoxes.cs