Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / Configuration / CustomError.cs / 2 / 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 }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RequestCacheEntry.cs
- DeferrableContentConverter.cs
- PropertyOverridesTypeEditor.cs
- ChangesetResponse.cs
- AutomationAttributeInfo.cs
- CategoryAttribute.cs
- BuildDependencySet.cs
- HttpRawResponse.cs
- BatchServiceHost.cs
- TrackBarRenderer.cs
- WebBrowserNavigatingEventHandler.cs
- EDesignUtil.cs
- ConfigXmlWhitespace.cs
- EdmSchemaError.cs
- ListViewItemSelectionChangedEvent.cs
- ListViewGroupItemCollection.cs
- TypedTableBase.cs
- HebrewCalendar.cs
- PathGeometry.cs
- Brush.cs
- ValidatingReaderNodeData.cs
- TreeViewImageKeyConverter.cs
- NativeMethods.cs
- HttpApplication.cs
- EventProviderTraceListener.cs
- InsufficientExecutionStackException.cs
- ListViewUpdatedEventArgs.cs
- EpmContentSerializerBase.cs
- HashHelper.cs
- StrokeCollectionConverter.cs
- WhitespaceRuleLookup.cs
- ObjectQuery.cs
- IdentityHolder.cs
- ThicknessAnimation.cs
- HtmlInputPassword.cs
- dataSvcMapFileLoader.cs
- DBDataPermissionAttribute.cs
- HttpFileCollectionWrapper.cs
- NGCSerializationManagerAsync.cs
- CatalogPartChrome.cs
- nulltextnavigator.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- newitemfactory.cs
- TextChange.cs
- QueryMath.cs
- UpdateDelegates.Generated.cs
- CdpEqualityComparer.cs
- WsatServiceAddress.cs
- ParagraphResult.cs
- WindowsStatic.cs
- TdsEnums.cs
- SqlDataSource.cs
- FileBasedResourceGroveler.cs
- CodeDirectiveCollection.cs
- Italic.cs
- HttpContext.cs
- XmlSerializationReader.cs
- FastEncoderWindow.cs
- ConfigWriter.cs
- AssemblyResolver.cs
- ActiveXContainer.cs
- MetabaseServerConfig.cs
- CompressedStack.cs
- _UriTypeConverter.cs
- TemplateXamlParser.cs
- FullTextLine.cs
- SoapRpcServiceAttribute.cs
- CrossContextChannel.cs
- DrawingContextWalker.cs
- KnownAssembliesSet.cs
- BindingSourceDesigner.cs
- ToolbarAUtomationPeer.cs
- DynamicQueryableWrapper.cs
- ConfigurationHelpers.cs
- RenameRuleObjectDialog.cs
- ListViewInsertionMark.cs
- MethodBody.cs
- StringValidatorAttribute.cs
- uribuilder.cs
- SyndicationPerson.cs
- Typography.cs
- ClosableStream.cs
- EnumValAlphaComparer.cs
- X509CertificateStore.cs
- OperatingSystem.cs
- OrderedDictionary.cs
- InputQueue.cs
- PageThemeParser.cs
- SamlSerializer.cs
- messageonlyhwndwrapper.cs
- EdmPropertyAttribute.cs
- SQLStringStorage.cs
- Cursor.cs
- ObjectKeyFrameCollection.cs
- VisualStyleTypesAndProperties.cs
- HttpCachePolicy.cs
- SRDisplayNameAttribute.cs
- ExpandSegment.cs
- RenderOptions.cs
- PrtCap_Reader.cs