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 / 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
- SQLString.cs
- SkipStoryboardToFill.cs
- DataGridViewHeaderCell.cs
- DataGridViewColumnCollectionDialog.cs
- DataStorage.cs
- RegexCode.cs
- ModuleConfigurationInfo.cs
- ExpressionBuilderCollection.cs
- WebPartsPersonalization.cs
- InsufficientMemoryException.cs
- MouseButtonEventArgs.cs
- DataTableTypeConverter.cs
- ChannelHandler.cs
- EndpointAddressMessageFilter.cs
- HttpProfileGroupBase.cs
- DiffuseMaterial.cs
- ClientUrlResolverWrapper.cs
- DeflateStream.cs
- AuthenticationServiceManager.cs
- RowUpdatingEventArgs.cs
- FormsIdentity.cs
- StringInfo.cs
- Variable.cs
- SchemaSetCompiler.cs
- SystemIPInterfaceProperties.cs
- ObjectViewQueryResultData.cs
- ConnectionProviderAttribute.cs
- WebPartConnectionsCancelEventArgs.cs
- MailAddressCollection.cs
- FrugalMap.cs
- UInt32Converter.cs
- RawUIStateInputReport.cs
- DynamicMethod.cs
- RangeEnumerable.cs
- NavigationProperty.cs
- EncryptedKeyHashIdentifierClause.cs
- WorkflowStateRollbackService.cs
- Point3D.cs
- Walker.cs
- DelegateBodyWriter.cs
- QueryOperator.cs
- CodeObjectCreateExpression.cs
- TextModifierScope.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- PointUtil.cs
- ConfigurationSectionCollection.cs
- EntityDataSourceQueryBuilder.cs
- ContextQuery.cs
- OleDbCommandBuilder.cs
- TextRunTypographyProperties.cs
- QueryPrefixOp.cs
- DataGridHeaderBorder.cs
- InternalConfigRoot.cs
- TextEditorContextMenu.cs
- HtmlInputImage.cs
- MatrixTransform.cs
- RecordBuilder.cs
- PersistChildrenAttribute.cs
- CodeVariableReferenceExpression.cs
- CultureInfoConverter.cs
- HostedBindingBehavior.cs
- AnnotationAuthorChangedEventArgs.cs
- wmiprovider.cs
- FocusChangedEventArgs.cs
- ToolStripPanelDesigner.cs
- EntityDataSourceWizardForm.cs
- DbDataRecord.cs
- RealProxy.cs
- EntityDataSourceChangingEventArgs.cs
- TableLayoutPanelCodeDomSerializer.cs
- ImageFormatConverter.cs
- SelectedDatesCollection.cs
- ExtendedPropertyDescriptor.cs
- XPathNavigator.cs
- Listbox.cs
- ThemeableAttribute.cs
- CodeAttributeDeclaration.cs
- FunctionDescription.cs
- ExceptionHandlersDesigner.cs
- UIHelper.cs
- DoubleLink.cs
- RadioButtonRenderer.cs
- ExtendedProtectionPolicyTypeConverter.cs
- XamlReaderHelper.cs
- CultureSpecificStringDictionary.cs
- ToolboxComponentsCreatingEventArgs.cs
- GridViewPageEventArgs.cs
- StringOutput.cs
- PackagingUtilities.cs
- IdentifierElement.cs
- RepeaterDesigner.cs
- SoapMessage.cs
- ListDataHelper.cs
- Header.cs
- MulticastNotSupportedException.cs
- Dispatcher.cs
- AdornerLayer.cs
- TransformationRules.cs
- SqlParameterizer.cs
- InfoCardSymmetricCrypto.cs