Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Xaml.Hosting / System / Xaml / Hosting / Configuration / HandlerElementCollection.cs / 1305376 / HandlerElementCollection.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Xaml.Hosting.Configuration { using System; using System.Configuration; using System.Collections.Generic; using System.Web; using System.Runtime; [ConfigurationCollection(typeof(HandlerElement), CollectionType = ConfigurationElementCollectionType.AddRemoveClearMapAlternate)] public sealed class HandlerElementCollection : ConfigurationElementCollection { public HandlerElementCollection() : base(StringComparer.OrdinalIgnoreCase) { } public override ConfigurationElementCollectionType CollectionType { get { return ConfigurationElementCollectionType.AddRemoveClearMapAlternate; } } protected override bool ThrowOnDuplicate { get { return false; } } public HandlerElement this[int index] { get { return (HandlerElement)base.BaseGet(index); } set { if (base.BaseGet(index) != null) { base.BaseRemoveAt(index); } this.BaseAdd(index, value); } } public void Add(HandlerElement handlerElement) { if (!this.IsReadOnly()) { if (handlerElement == null) { throw FxTrace.Exception.ArgumentNull("handlerElement"); } } this.BaseAdd(handlerElement, false); } public void Clear() { base.BaseClear(); } public void Remove(HandlerElement handlerElement) { if (!this.IsReadOnly()) { if (handlerElement == null) { throw FxTrace.Exception.ArgumentNull("handlerElement"); } } this.BaseRemove(this.GetElementKey(handlerElement)); } public void Remove(string xamlRootElementType) { if (!this.IsReadOnly()) { if (xamlRootElementType == null) { throw FxTrace.Exception.ArgumentNull("xamlRootElementType"); } } this.BaseRemove(xamlRootElementType); } public void RemoveAt(int index) { base.BaseRemoveAt(index); } internal bool TryGetHttpHandlerType(Type hostedXamlType, out Type httpHandlerType) { httpHandlerType = null; foreach (HandlerElement handler in this) { if (handler.LoadXamlRootElementType().IsAssignableFrom(hostedXamlType)) { httpHandlerType = handler.LoadHttpHandlerType(); return true; } } return false; } protected override ConfigurationElement CreateNewElement() { return new HandlerElement(); } protected override object GetElementKey(ConfigurationElement element) { if (element == null) { throw FxTrace.Exception.ArgumentNull("element"); } return ((HandlerElement)element).Key; } } } // 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
- SafeNativeMethods.cs
- DataGridViewRow.cs
- ReflectTypeDescriptionProvider.cs
- AsyncResult.cs
- FormsAuthenticationConfiguration.cs
- AliasedSlot.cs
- CursorConverter.cs
- InputBindingCollection.cs
- ReferenceSchema.cs
- SelectingProviderEventArgs.cs
- AddInPipelineAttributes.cs
- JpegBitmapDecoder.cs
- CatalogZone.cs
- LocatorPartList.cs
- IsolationInterop.cs
- StylusSystemGestureEventArgs.cs
- UpdateException.cs
- XPathNavigatorReader.cs
- XmlEncoding.cs
- PackUriHelper.cs
- EnumCodeDomSerializer.cs
- RegexParser.cs
- DbConnectionPoolIdentity.cs
- wmiprovider.cs
- ButtonFieldBase.cs
- Brush.cs
- TcpClientSocketManager.cs
- SafeProcessHandle.cs
- RulePatternOps.cs
- OdbcFactory.cs
- ComplexLine.cs
- SettingsPropertyIsReadOnlyException.cs
- InfoCardBaseException.cs
- SafeEventLogReadHandle.cs
- PermissionAttributes.cs
- WorkflowEnvironment.cs
- Overlapped.cs
- ImageFormatConverter.cs
- ComboBoxAutomationPeer.cs
- WindowsListViewScroll.cs
- WebPartRestoreVerb.cs
- InfoCardRequestException.cs
- CompleteWizardStep.cs
- RegistryPermission.cs
- StrongNamePublicKeyBlob.cs
- RequestFactory.cs
- AppDomainProtocolHandler.cs
- PhysicalFontFamily.cs
- CodeDefaultValueExpression.cs
- MemoryMappedFile.cs
- X509Certificate2Collection.cs
- StylusPoint.cs
- XmlSecureResolver.cs
- HttpHostedTransportConfiguration.cs
- WebPart.cs
- VectorAnimationUsingKeyFrames.cs
- XamlHostingConfiguration.cs
- GcSettings.cs
- CatalogZoneBase.cs
- PageAdapter.cs
- SafeBitVector32.cs
- EntityViewGenerator.cs
- Track.cs
- FileLogRecordHeader.cs
- PassportAuthenticationEventArgs.cs
- OrderedDictionary.cs
- Parser.cs
- sqlinternaltransaction.cs
- TableLayout.cs
- DataMemberConverter.cs
- DataRecordInternal.cs
- NameValuePermission.cs
- MatchingStyle.cs
- ImageIndexConverter.cs
- ClientSettingsStore.cs
- DataColumnMapping.cs
- WindowsGraphics.cs
- ChannelTerminatedException.cs
- LabelEditEvent.cs
- HttpCapabilitiesBase.cs
- InkCanvasAutomationPeer.cs
- FileDialog.cs
- ChildChangedEventArgs.cs
- CommonServiceBehaviorElement.cs
- XslTransform.cs
- SingletonConnectionReader.cs
- SiteIdentityPermission.cs
- ReceiveMessageRecord.cs
- SortedSetDebugView.cs
- FixedSOMTextRun.cs
- ServiceCredentialsElement.cs
- ExportFileRequest.cs
- RectangleHotSpot.cs
- ReliabilityContractAttribute.cs
- selecteditemcollection.cs
- arabicshape.cs
- EdmScalarPropertyAttribute.cs
- InvokePatternIdentifiers.cs
- CultureInfo.cs
- _UriSyntax.cs