Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); // check duplicate Id /* 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; } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ErrorInfoXmlDocument.cs
- Parameter.cs
- XmlSchemaInferenceException.cs
- MatrixStack.cs
- FusionWrap.cs
- ProxyOperationRuntime.cs
- TagPrefixCollection.cs
- CounterSampleCalculator.cs
- Wildcard.cs
- CngKeyCreationParameters.cs
- NavigationEventArgs.cs
- ComponentSerializationService.cs
- BinaryConverter.cs
- SiteMapPath.cs
- WebSysDescriptionAttribute.cs
- WorkflowRuntimeServiceElementCollection.cs
- InvokeProviderWrapper.cs
- XmlTextEncoder.cs
- Thread.cs
- SQLBoolean.cs
- _ListenerResponseStream.cs
- TemplateXamlTreeBuilder.cs
- StrokeNodeEnumerator.cs
- SqlBulkCopy.cs
- CodeGenerationManager.cs
- CodeTypeDeclarationCollection.cs
- InputManager.cs
- SharedPersonalizationStateInfo.cs
- UserNameSecurityTokenAuthenticator.cs
- AdornerPresentationContext.cs
- DbDeleteCommandTree.cs
- DataGridToolTip.cs
- FileInfo.cs
- CuspData.cs
- HtmlShim.cs
- DataGridViewCellStyleChangedEventArgs.cs
- SecurityElement.cs
- Parameter.cs
- MultipartContentParser.cs
- AssemblyInfo.cs
- IPHostEntry.cs
- SchemaHelper.cs
- UIElement3DAutomationPeer.cs
- DataGridViewTextBoxEditingControl.cs
- ImageSource.cs
- DetailsViewDeleteEventArgs.cs
- ViewStateException.cs
- NativeMethodsCLR.cs
- UTF7Encoding.cs
- SineEase.cs
- Mapping.cs
- TrustManager.cs
- UIAgentMonitorHandle.cs
- OleDbSchemaGuid.cs
- TemplateBuilder.cs
- ClientCredentialsSecurityTokenManager.cs
- GridViewRow.cs
- MultipleViewProviderWrapper.cs
- CodeLabeledStatement.cs
- DeviceContext2.cs
- JournalEntryListConverter.cs
- SplashScreen.cs
- xamlnodes.cs
- LocatorPartList.cs
- DynamicPropertyHolder.cs
- VersionedStreamOwner.cs
- Vector3DCollectionConverter.cs
- DependentList.cs
- UIElementParagraph.cs
- Point3DCollectionConverter.cs
- Camera.cs
- InputEventArgs.cs
- _HTTPDateParse.cs
- DiagnosticTraceSource.cs
- DynamicPhysicalDiscoSearcher.cs
- TableParagraph.cs
- WorkflowIdleBehavior.cs
- UnsafeNativeMethods.cs
- CollectionViewGroupInternal.cs
- SqlEnums.cs
- ParameterRefs.cs
- X509ServiceCertificateAuthentication.cs
- SafeCertificateContext.cs
- ParsedAttributeCollection.cs
- XmlUrlResolver.cs
- CategoryNameCollection.cs
- Cursor.cs
- SplitterDesigner.cs
- CommandManager.cs
- Metafile.cs
- InvokePattern.cs
- GroupItem.cs
- ClientEventManager.cs
- TagMapCollection.cs
- ColumnHeader.cs
- SafeNativeMethods.cs
- WebCodeGenerator.cs
- SelectionHighlightInfo.cs
- ContentTextAutomationPeer.cs
- OdbcEnvironment.cs