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
- XPathArrayIterator.cs
- UiaCoreProviderApi.cs
- MobileControlDesigner.cs
- WebSysDescriptionAttribute.cs
- VolatileEnlistmentMultiplexing.cs
- DeviceSpecificDesigner.cs
- OutputCacheSettingsSection.cs
- _IPv4Address.cs
- SmtpTransport.cs
- RectKeyFrameCollection.cs
- SiteOfOriginPart.cs
- EntityContainer.cs
- InternalConfigConfigurationFactory.cs
- DataBinding.cs
- LinkLabelLinkClickedEvent.cs
- XmlCharType.cs
- OracleInfoMessageEventArgs.cs
- DataSvcMapFile.cs
- DataGridTablesFactory.cs
- PermissionListSet.cs
- TextPenaltyModule.cs
- FontFaceLayoutInfo.cs
- PropertyGridEditorPart.cs
- webeventbuffer.cs
- CompiledXpathExpr.cs
- RecognizedWordUnit.cs
- Cloud.cs
- RSAPKCS1KeyExchangeFormatter.cs
- ErrorHandler.cs
- TextFormatter.cs
- StyleSelector.cs
- WmlLiteralTextAdapter.cs
- TreeViewHitTestInfo.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- PixelFormatConverter.cs
- LoginName.cs
- _ServiceNameStore.cs
- SQLMoney.cs
- XmlSchemaNotation.cs
- ResourceWriter.cs
- Activity.cs
- VariantWrapper.cs
- SystemEvents.cs
- SoapSchemaMember.cs
- PopupEventArgs.cs
- OperatorExpressions.cs
- MetadataCacheItem.cs
- UserNameSecurityTokenProvider.cs
- LoginView.cs
- WpfPayload.cs
- File.cs
- TraceXPathNavigator.cs
- SendSecurityHeaderElementContainer.cs
- DataBindingCollection.cs
- MessageHeaderInfoTraceRecord.cs
- ContractUtils.cs
- PolicyDesigner.cs
- Slider.cs
- ByteRangeDownloader.cs
- LayoutEngine.cs
- XmlWhitespace.cs
- GridLengthConverter.cs
- Tile.cs
- CurrentTimeZone.cs
- FieldInfo.cs
- __Filters.cs
- XmlMapping.cs
- ConvertEvent.cs
- MergeExecutor.cs
- ButtonBaseAutomationPeer.cs
- WindowsRichEditRange.cs
- DeclarativeCatalogPart.cs
- Expression.DebuggerProxy.cs
- UrlPath.cs
- GAC.cs
- ContainerVisual.cs
- ResourcePermissionBaseEntry.cs
- RegistryPermission.cs
- PropertyExpression.cs
- CultureTableRecord.cs
- InProcStateClientManager.cs
- RepeatEnumerable.cs
- ArcSegment.cs
- CurrencyManager.cs
- NativeObjectSecurity.cs
- BamlLocalizableResource.cs
- DelegateHelpers.Generated.cs
- RuleSettingsCollection.cs
- TraceFilter.cs
- NavigationProperty.cs
- Inflater.cs
- ImageField.cs
- __Error.cs
- DataServiceQueryException.cs
- SamlAttribute.cs
- XamlBrushSerializer.cs
- AnnotationComponentManager.cs
- ConnectionPoolRegistry.cs
- TextEffectResolver.cs
- RequestStatusBarUpdateEventArgs.cs