Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / CustomErrorCollection.cs / 1305376 / CustomErrorCollection.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; [ConfigurationCollection(typeof(CustomError), AddItemName = "error", CollectionType = ConfigurationElementCollectionType.BasicMap)] public sealed class CustomErrorCollection : ConfigurationElementCollection { private static ConfigurationPropertyCollection _properties; static CustomErrorCollection() { _properties = new ConfigurationPropertyCollection(); } public CustomErrorCollection() { } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } // public properties public String[] AllKeys { get { object[] objAllKeys = BaseGetAllKeys(); String[] stringKeys = new String[objAllKeys.Length]; for(int x = 0; x < objAllKeys.Length; x++) { stringKeys[x] = ((Int32)objAllKeys[x]).ToString(CultureInfo.InvariantCulture); } return stringKeys; } } public new CustomError this[string statusCode] { get { return (CustomError)BaseGet((object)Int32.Parse(statusCode, CultureInfo.InvariantCulture)); } } public CustomError this[int index] { get { return (CustomError)BaseGet(index); } set { if (BaseGet(index) != null) { BaseRemoveAt(index); } BaseAdd(index, value); } } // Protected Overrides protected override ConfigurationElement CreateNewElement() { return new CustomError(); } protected override Object GetElementKey(ConfigurationElement element) { return ((CustomError)element).StatusCode; } protected override string ElementName { get { return "error"; } } public override ConfigurationElementCollectionType CollectionType { get { return ConfigurationElementCollectionType.BasicMap; } } // public methods public void Add(CustomError customError) { BaseAdd(customError); } public void Clear() { BaseClear(); } public CustomError Get(int index) { return (CustomError)BaseGet(index); } public CustomError Get(string statusCode) { return (CustomError)BaseGet((object)Int32.Parse(statusCode, CultureInfo.InvariantCulture)); } public String GetKey(int index) { Int32 key = (Int32) BaseGetKey(index); return key.ToString(CultureInfo.InvariantCulture); } public void Remove(string statusCode) { BaseRemove((object)Int32.Parse(statusCode, CultureInfo.InvariantCulture)); } public void RemoveAt(int index) { BaseRemoveAt(index); } public void Set(CustomError customError) { BaseAdd(customError, false); } } } // 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
- WorkItem.cs
- GeometryModel3D.cs
- DocComment.cs
- MimeXmlReflector.cs
- AuthorizationSection.cs
- DuplicateWaitObjectException.cs
- XmlTypeMapping.cs
- TextPointerBase.cs
- SeekableReadStream.cs
- SizeConverter.cs
- MatrixAnimationBase.cs
- FileDialog.cs
- documentsequencetextpointer.cs
- PersonalizableTypeEntry.cs
- IgnoreFlushAndCloseStream.cs
- DataListItemEventArgs.cs
- CompositeKey.cs
- LinqDataSourceContextEventArgs.cs
- basevalidator.cs
- Point.cs
- EventProxy.cs
- ConfigurationManager.cs
- CommonDialog.cs
- EncryptedData.cs
- ProtectedConfiguration.cs
- DesignOnlyAttribute.cs
- ObsoleteAttribute.cs
- SafeNativeMethodsOther.cs
- GB18030Encoding.cs
- InputElement.cs
- ThaiBuddhistCalendar.cs
- MultipleViewPatternIdentifiers.cs
- XmlTextReader.cs
- ToolStripComboBox.cs
- CommandBinding.cs
- NavigateEvent.cs
- CatalogZoneBase.cs
- CLRBindingWorker.cs
- XmlSchemaGroup.cs
- Control.cs
- Size.cs
- HttpStreamMessageEncoderFactory.cs
- DispatcherOperation.cs
- WebPartTransformerAttribute.cs
- DataGridColumn.cs
- LayoutManager.cs
- RemotingClientProxy.cs
- ExclusiveTcpListener.cs
- NonParentingControl.cs
- ActivationWorker.cs
- SQLBytes.cs
- OrderedDictionary.cs
- path.cs
- DocumentAutomationPeer.cs
- DaylightTime.cs
- TraceFilter.cs
- RankException.cs
- DbDataRecord.cs
- ClientBuildManager.cs
- DataException.cs
- WebPartZoneCollection.cs
- ProcessThreadCollection.cs
- WebSysDescriptionAttribute.cs
- RouteData.cs
- SafeBuffer.cs
- MonthCalendar.cs
- SessionPageStateSection.cs
- _PooledStream.cs
- NumericUpDown.cs
- basecomparevalidator.cs
- _ContextAwareResult.cs
- ResourceDescriptionAttribute.cs
- MailMessageEventArgs.cs
- MemberAccessException.cs
- WebMessageEncodingElement.cs
- BitmapEffectRenderDataResource.cs
- ConfigViewGenerator.cs
- SmtpReplyReaderFactory.cs
- DataGridViewCheckBoxColumn.cs
- UICuesEvent.cs
- GridViewDeleteEventArgs.cs
- _Events.cs
- WasEndpointConfigContainer.cs
- Parser.cs
- ClassHandlersStore.cs
- WeakRefEnumerator.cs
- Baml2006ReaderContext.cs
- CfgParser.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- ContextStack.cs
- NativeMethods.cs
- DispatcherObject.cs
- ScriptResourceInfo.cs
- xmlformatgeneratorstatics.cs
- OpacityConverter.cs
- Form.cs
- BlurEffect.cs
- HtmlAnchor.cs
- ToggleButtonAutomationPeer.cs
- TemplatedWizardStep.cs