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
- DataBoundControl.cs
- BitmapEffectInputConnector.cs
- EmptyControlCollection.cs
- ProxySimple.cs
- AttributeEmitter.cs
- SoapSchemaMember.cs
- SQLUtility.cs
- StorageEndPropertyMapping.cs
- GroupQuery.cs
- LoginView.cs
- DocumentsTrace.cs
- Vector3DCollection.cs
- StorageRoot.cs
- ToolStripSeparatorRenderEventArgs.cs
- BidPrivateBase.cs
- TextLineBreak.cs
- baseaxisquery.cs
- NumberSubstitution.cs
- Interlocked.cs
- CollectionDataContract.cs
- RoleGroup.cs
- ColumnMapTranslator.cs
- StateElement.cs
- ColumnHeader.cs
- glyphs.cs
- LicenseManager.cs
- HyperLinkDesigner.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- ReferentialConstraint.cs
- Renderer.cs
- EncryptedXml.cs
- KnownColorTable.cs
- WebDescriptionAttribute.cs
- PixelFormatConverter.cs
- DbConnectionPoolIdentity.cs
- Control.cs
- VisualStyleTypesAndProperties.cs
- ErrorFormatter.cs
- ClientUtils.cs
- StateItem.cs
- FieldAccessException.cs
- HtmlInputText.cs
- BinaryNode.cs
- CopyOfAction.cs
- GPRECT.cs
- LocalValueEnumerator.cs
- StandardOleMarshalObject.cs
- unitconverter.cs
- DataSourceUtil.cs
- UserControl.cs
- EndOfStreamException.cs
- DataGridViewSelectedRowCollection.cs
- _ConnectStream.cs
- IssuanceLicense.cs
- CodeGeneratorAttribute.cs
- handlecollector.cs
- FrameSecurityDescriptor.cs
- Math.cs
- EventListener.cs
- DurableTimerExtension.cs
- DynamicScriptObject.cs
- CodeGeneratorOptions.cs
- BindableAttribute.cs
- DataTable.cs
- WorkflowMarkupSerializerMapping.cs
- TextDecorationCollection.cs
- CompilerResults.cs
- EntityDataSourceStatementEditorForm.cs
- Expressions.cs
- ExecutionEngineException.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- DiscoveryExceptionDictionary.cs
- AnnotationComponentChooser.cs
- WebResourceAttribute.cs
- ProfileManager.cs
- ReceiveActivityValidator.cs
- DataGridRowEventArgs.cs
- InvokeMethodActivity.cs
- ImmutableCommunicationTimeouts.cs
- Mouse.cs
- ExpressionBindingCollection.cs
- StringBlob.cs
- ActivationServices.cs
- ResourceSetExpression.cs
- DataGridSortCommandEventArgs.cs
- LoadedOrUnloadedOperation.cs
- FunctionMappingTranslator.cs
- SplineKeyFrames.cs
- ToolStripScrollButton.cs
- DataServices.cs
- QueryOperationResponseOfT.cs
- DynamicQueryableWrapper.cs
- SubtreeProcessor.cs
- EntityCommandCompilationException.cs
- Hyperlink.cs
- CompilerCollection.cs
- GcHandle.cs
- AutomationTextAttribute.cs
- Convert.cs
- EllipseGeometry.cs