Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / Configuration / ProtocolsConfiguration.cs / 2 / ProtocolsConfiguration.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System.IO; using System.Runtime.Serialization.Formatters; using System.Threading; using System.Runtime.InteropServices; using System.ComponentModel; using System.Collections; using System.Configuration; using System.Reflection; using System.Globalization; using System.Web.Hosting; using System.Web.Security; using System.Web.Util; using System.Xml; internal class ProtocolsConfiguration { private Hashtable _protocolEntries = new Hashtable(); internal ProtocolsConfiguration(XmlNode section) { // process XML section in order and apply the directives HandlerBase.CheckForUnrecognizedAttributes(section); foreach (XmlNode child in section.ChildNodes) { // skip whitespace and comments if (IsIgnorableAlsoCheckForNonElement(child)) continue; // processelements if (child.Name == "add") { String id = HandlerBase.RemoveRequiredAttribute(child, "id"); String phType = HandlerBase.RemoveRequiredAttribute(child, "processHandlerType"); String ahType = HandlerBase.RemoveRequiredAttribute(child, "appDomainHandlerType"); bool validate = true; HandlerBase.GetAndRemoveBooleanAttribute(child, "validate", ref validate); HandlerBase.CheckForUnrecognizedAttributes(child); HandlerBase.CheckForNonCommentChildNodes(child); // /* TEMPORARY allow duplicates for easy Indigo machine.config update if (_protocolEntries[id] != null) { throw new ConfigurationErrorsException( SR.GetString(SR.Dup_protocol_id, id), child); } */ // add entry /* TEMPORARY hide errors and ignore bad tags to let breaking changes through */ try { _protocolEntries[id] = new ProtocolsConfigurationEntry( id, phType, ahType, validate, ConfigurationErrorsException.GetFilename(child), ConfigurationErrorsException.GetLineNumber(child)); } catch { } } else { HandlerBase.ThrowUnrecognizedElement(child); } } } private bool IsIgnorableAlsoCheckForNonElement(XmlNode node) { if (node.NodeType == XmlNodeType.Comment || node.NodeType == XmlNodeType.Whitespace) { return true; } if (node.NodeType != XmlNodeType.Element) { throw new ConfigurationErrorsException( SR.GetString(SR.Config_base_elements_only), node); } return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System.IO; using System.Runtime.Serialization.Formatters; using System.Threading; using System.Runtime.InteropServices; using System.ComponentModel; using System.Collections; using System.Configuration; using System.Reflection; using System.Globalization; using System.Web.Hosting; using System.Web.Security; using System.Web.Util; using System.Xml; internal class ProtocolsConfiguration { private Hashtable _protocolEntries = new Hashtable(); internal ProtocolsConfiguration(XmlNode section) { // process XML section in order and apply the directives HandlerBase.CheckForUnrecognizedAttributes(section); foreach (XmlNode child in section.ChildNodes) { // skip whitespace and comments if (IsIgnorableAlsoCheckForNonElement(child)) continue; // processelements if (child.Name == "add") { String id = HandlerBase.RemoveRequiredAttribute(child, "id"); String phType = HandlerBase.RemoveRequiredAttribute(child, "processHandlerType"); String ahType = HandlerBase.RemoveRequiredAttribute(child, "appDomainHandlerType"); bool validate = true; HandlerBase.GetAndRemoveBooleanAttribute(child, "validate", ref validate); HandlerBase.CheckForUnrecognizedAttributes(child); HandlerBase.CheckForNonCommentChildNodes(child); // /* TEMPORARY allow duplicates for easy Indigo machine.config update if (_protocolEntries[id] != null) { throw new ConfigurationErrorsException( SR.GetString(SR.Dup_protocol_id, id), child); } */ // add entry /* TEMPORARY hide errors and ignore bad tags to let breaking changes through */ try { _protocolEntries[id] = new ProtocolsConfigurationEntry( id, phType, ahType, validate, ConfigurationErrorsException.GetFilename(child), ConfigurationErrorsException.GetLineNumber(child)); } catch { } } else { HandlerBase.ThrowUnrecognizedElement(child); } } } private bool IsIgnorableAlsoCheckForNonElement(XmlNode node) { if (node.NodeType == XmlNodeType.Comment || node.NodeType == XmlNodeType.Whitespace) { return true; } if (node.NodeType != XmlNodeType.Element) { throw new ConfigurationErrorsException( SR.GetString(SR.Config_base_elements_only), node); } return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TraceHandler.cs
- BinaryMethodMessage.cs
- WebControlToolBoxItem.cs
- QuadraticBezierSegment.cs
- ConfigXmlElement.cs
- TriggerActionCollection.cs
- HttpModulesSection.cs
- XmlAttributeAttribute.cs
- COM2FontConverter.cs
- HtmlTextArea.cs
- oledbconnectionstring.cs
- AutomationTextAttribute.cs
- JsonReader.cs
- _TransmitFileOverlappedAsyncResult.cs
- HtmlElementEventArgs.cs
- CompiledQueryCacheEntry.cs
- CopyOnWriteList.cs
- DuplicateDetector.cs
- SizeAnimationBase.cs
- RefreshEventArgs.cs
- UnionCodeGroup.cs
- RedBlackList.cs
- BuildDependencySet.cs
- CssStyleCollection.cs
- WpfKnownMember.cs
- DllNotFoundException.cs
- InkCanvasAutomationPeer.cs
- TextSegment.cs
- Tokenizer.cs
- HtmlContainerControl.cs
- CodeTypeDelegate.cs
- ControlValuePropertyAttribute.cs
- ReadOnlyObservableCollection.cs
- RegexTree.cs
- CodeTypeReferenceCollection.cs
- DataGridCell.cs
- DayRenderEvent.cs
- StoreAnnotationsMap.cs
- ProfileSettingsCollection.cs
- dataSvcMapFileLoader.cs
- SimpleLine.cs
- HttpResponseHeader.cs
- InnerItemCollectionView.cs
- PropertyValueChangedEvent.cs
- ProfileService.cs
- XmlCodeExporter.cs
- SynchronizationContext.cs
- ServiceModelTimeSpanValidator.cs
- PenLineJoinValidation.cs
- SmtpNegotiateAuthenticationModule.cs
- SqlCacheDependency.cs
- SqlParameterizer.cs
- DocumentStatusResources.cs
- Label.cs
- XmlSchemaSimpleTypeRestriction.cs
- LogSwitch.cs
- TextChangedEventArgs.cs
- StoreItemCollection.cs
- ResourcePool.cs
- JulianCalendar.cs
- AddressingVersion.cs
- CollectionViewGroupRoot.cs
- Splitter.cs
- XmlSchemaDatatype.cs
- DynamicMetaObject.cs
- SessionPageStatePersister.cs
- BuildProviderCollection.cs
- FilterEventArgs.cs
- TransactionFlowBindingElement.cs
- IncrementalReadDecoders.cs
- _FtpControlStream.cs
- HttpHeaderCollection.cs
- processwaithandle.cs
- ProbeDuplexAsyncResult.cs
- unitconverter.cs
- BuildProviderCollection.cs
- XmlDataLoader.cs
- DataBoundControlHelper.cs
- ADConnectionHelper.cs
- AsymmetricKeyExchangeDeformatter.cs
- StateItem.cs
- TextMarkerSource.cs
- WebBaseEventKeyComparer.cs
- XComponentModel.cs
- Environment.cs
- CollectionBase.cs
- CodeIdentifier.cs
- DbDataSourceEnumerator.cs
- MetricEntry.cs
- TreeView.cs
- ImageMapEventArgs.cs
- WindowsButton.cs
- RoleService.cs
- DriveInfo.cs
- ToolStripRendererSwitcher.cs
- Matrix.cs
- LicenseManager.cs
- PageThemeCodeDomTreeGenerator.cs
- ThemeConfigurationDialog.cs
- StringArrayConverter.cs