Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / xsp / System / Web / Configuration / CustomError.cs / 1 / CustomError.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.IO; using System.Text; using System.Globalization; using System.Web.Util; using System.Web.Configuration; using System.Security.Permissions; // class CustomErrorsSection [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class CustomError : ConfigurationElement { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propStatusCode = new ConfigurationProperty("statusCode", typeof(int), null, null, new IntegerValidator(100, 999), ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey); private static readonly ConfigurationProperty _propRedirect = new ConfigurationProperty("redirect", typeof(string), null, null, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.IsRequired); static CustomError() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propStatusCode); _properties.Add(_propRedirect); } internal CustomError() { } public CustomError(int statusCode, string redirect) : this() { StatusCode = statusCode; Redirect = redirect; } // I believe these can be removed public override bool Equals(object customError) { CustomError o = customError as CustomError; return (o != null && o.StatusCode == StatusCode && o.Redirect == Redirect); } public override int GetHashCode() { return HashCodeCombiner.CombineHashCodes(StatusCode, Redirect.GetHashCode()); } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("statusCode", IsRequired = true, IsKey = true)] [IntegerValidator(MinValue = 100, MaxValue = 999)] public int StatusCode { get { return (int)base[_propStatusCode]; } set { base[_propStatusCode] = value; } } [ConfigurationProperty("redirect", IsRequired = true)] [StringValidator(MinLength = 1)] public string Redirect { get { return (string)base[_propRedirect]; } set { base[_propRedirect] = value; } } } // class CustomError } // 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.IO; using System.Text; using System.Globalization; using System.Web.Util; using System.Web.Configuration; using System.Security.Permissions; // class CustomErrorsSection [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class CustomError : ConfigurationElement { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propStatusCode = new ConfigurationProperty("statusCode", typeof(int), null, null, new IntegerValidator(100, 999), ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey); private static readonly ConfigurationProperty _propRedirect = new ConfigurationProperty("redirect", typeof(string), null, null, StdValidatorsAndConverters.NonEmptyStringValidator, ConfigurationPropertyOptions.IsRequired); static CustomError() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propStatusCode); _properties.Add(_propRedirect); } internal CustomError() { } public CustomError(int statusCode, string redirect) : this() { StatusCode = statusCode; Redirect = redirect; } // I believe these can be removed public override bool Equals(object customError) { CustomError o = customError as CustomError; return (o != null && o.StatusCode == StatusCode && o.Redirect == Redirect); } public override int GetHashCode() { return HashCodeCombiner.CombineHashCodes(StatusCode, Redirect.GetHashCode()); } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("statusCode", IsRequired = true, IsKey = true)] [IntegerValidator(MinValue = 100, MaxValue = 999)] public int StatusCode { get { return (int)base[_propStatusCode]; } set { base[_propStatusCode] = value; } } [ConfigurationProperty("redirect", IsRequired = true)] [StringValidator(MinLength = 1)] public string Redirect { get { return (string)base[_propRedirect]; } set { base[_propRedirect] = value; } } } // class CustomError } // 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
- QueryRewriter.cs
- AmbientEnvironment.cs
- SharedStatics.cs
- SchemaMapping.cs
- TextShapeableCharacters.cs
- EventLogSession.cs
- BasicBrowserDialog.designer.cs
- SiteMapNodeItem.cs
- DesignerEventService.cs
- TaskFormBase.cs
- XmlEntity.cs
- ConsoleKeyInfo.cs
- PropertyInfoSet.cs
- SafeLibraryHandle.cs
- CacheHelper.cs
- WorkflowFileItem.cs
- Types.cs
- AspProxy.cs
- XmlDictionaryWriter.cs
- InstanceKeyView.cs
- TemplateXamlParser.cs
- CompilerErrorCollection.cs
- Line.cs
- Crc32.cs
- TagPrefixInfo.cs
- DebugHandleTracker.cs
- DataTableMappingCollection.cs
- WebPartMenu.cs
- NativeCppClassAttribute.cs
- ReferenceEqualityComparer.cs
- OdbcPermission.cs
- PasswordPropertyTextAttribute.cs
- DictionaryBase.cs
- SelectionProviderWrapper.cs
- FixedSOMPage.cs
- SortKey.cs
- DataGridColumn.cs
- XmlWhitespace.cs
- HyperlinkAutomationPeer.cs
- RawStylusActions.cs
- RegistryKey.cs
- XpsS0ValidatingLoader.cs
- Int16AnimationBase.cs
- TreeViewImageKeyConverter.cs
- ShapingWorkspace.cs
- DateTimeOffset.cs
- DbConnectionPoolIdentity.cs
- CapiSymmetricAlgorithm.cs
- EventProvider.cs
- __TransparentProxy.cs
- ToolStripPanelSelectionGlyph.cs
- _DomainName.cs
- Cursors.cs
- prompt.cs
- AdPostCacheSubstitution.cs
- MetadataSet.cs
- ParameterToken.cs
- BooleanKeyFrameCollection.cs
- EncryptedReference.cs
- ObjectListShowCommandsEventArgs.cs
- XmlSchemaChoice.cs
- RenderingEventArgs.cs
- PublisherIdentityPermission.cs
- SchemaMapping.cs
- IntSecurity.cs
- DataGridBoolColumn.cs
- PageHandlerFactory.cs
- DateTimeFormatInfoScanner.cs
- AcceleratedTokenAuthenticator.cs
- RecognizerBase.cs
- PageCanvasSize.cs
- ClickablePoint.cs
- TrackBarDesigner.cs
- OpenFileDialog.cs
- CompositeTypefaceMetrics.cs
- SendingRequestEventArgs.cs
- UnsettableComboBox.cs
- CreationContext.cs
- TypeForwardedToAttribute.cs
- XmlNodeList.cs
- ClassicBorderDecorator.cs
- ScriptComponentDescriptor.cs
- FixedSOMPageConstructor.cs
- SafeNativeMethods.cs
- XmlSchemaCollection.cs
- ResourceAssociationType.cs
- GeneralTransformGroup.cs
- BamlRecordHelper.cs
- WSTrustFeb2005.cs
- Animatable.cs
- TextSelection.cs
- CustomDictionarySources.cs
- WebBrowsableAttribute.cs
- WpfKnownMemberInvoker.cs
- HttpCookie.cs
- StringCollection.cs
- DataGridColumnCollection.cs
- Rect.cs
- DataIdProcessor.cs
- TextRange.cs