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
- StandardCommands.cs
- SystemThemeKey.cs
- InputLanguageProfileNotifySink.cs
- Constants.cs
- NetSectionGroup.cs
- SchemaDeclBase.cs
- WorkflowCommandExtensionItem.cs
- WebSysDescriptionAttribute.cs
- ConnectionPoolManager.cs
- BindToObject.cs
- DataTableMapping.cs
- XmlUnspecifiedAttribute.cs
- TraceListener.cs
- BindingsSection.cs
- WebPartEditorOkVerb.cs
- unsafenativemethodsother.cs
- Route.cs
- ForwardPositionQuery.cs
- GridViewPageEventArgs.cs
- QuaternionValueSerializer.cs
- DefaultSettingsSection.cs
- GenericRootAutomationPeer.cs
- SelectionEditingBehavior.cs
- RepeaterItemCollection.cs
- HwndSource.cs
- InlineObject.cs
- RealizationContext.cs
- GifBitmapDecoder.cs
- ClientRoleProvider.cs
- PersonalizationDictionary.cs
- mediaeventshelper.cs
- ChangePassword.cs
- XmlEncodedRawTextWriter.cs
- DbProviderFactories.cs
- SequenceDesigner.cs
- SafeFileMappingHandle.cs
- Line.cs
- NativeCompoundFileAPIs.cs
- PageMediaSize.cs
- SendSecurityHeaderElement.cs
- InitializationEventAttribute.cs
- DataQuery.cs
- DbBuffer.cs
- StylusPlugInCollection.cs
- CharStorage.cs
- BuildProvider.cs
- ContentIterators.cs
- SafeCryptoKeyHandle.cs
- RelAssertionDirectKeyIdentifierClause.cs
- HttpResponseHeader.cs
- ClickablePoint.cs
- AnimationClockResource.cs
- PagerStyle.cs
- CounterSampleCalculator.cs
- FileReservationCollection.cs
- TextFindEngine.cs
- ClientUrlResolverWrapper.cs
- WrapPanel.cs
- DynamicILGenerator.cs
- TableRowGroup.cs
- DataGridParentRows.cs
- Helpers.cs
- HttpWriter.cs
- NativeMethods.cs
- ImageListStreamer.cs
- EllipseGeometry.cs
- RotateTransform3D.cs
- BitSet.cs
- FileDialogCustomPlace.cs
- XomlCompiler.cs
- TextFormatterHost.cs
- MenuItemBinding.cs
- QuaternionRotation3D.cs
- QueryAccessibilityHelpEvent.cs
- WindowsGraphics2.cs
- WorkflowRuntimeService.cs
- PermissionToken.cs
- PriorityBinding.cs
- PageEventArgs.cs
- IntSecurity.cs
- OwnerDrawPropertyBag.cs
- StylusPoint.cs
- safelink.cs
- SecurityTimestamp.cs
- AuthenticationService.cs
- CellRelation.cs
- XmlDataSourceView.cs
- ConfigXmlElement.cs
- LogLogRecordEnumerator.cs
- control.ime.cs
- WindowsScrollBarBits.cs
- ZoneLinkButton.cs
- CanonicalFontFamilyReference.cs
- ComponentManagerBroker.cs
- HtmlToClrEventProxy.cs
- CodeCatchClauseCollection.cs
- AddingNewEventArgs.cs
- Operand.cs
- HostedAspNetEnvironment.cs
- XmlSerializerSection.cs