Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / ProtocolsConfiguration.cs / 1305376 / 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; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // 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; } } } // 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
- HandlerWithFactory.cs
- webeventbuffer.cs
- _RequestLifetimeSetter.cs
- FixedSOMTable.cs
- TextDpi.cs
- DictionaryContent.cs
- UIElement.cs
- Logging.cs
- DeviceSpecificDialogCachedState.cs
- SqlFlattener.cs
- ListBindableAttribute.cs
- TreeView.cs
- ConditionalWeakTable.cs
- EncryptedKeyIdentifierClause.cs
- COSERVERINFO.cs
- CodeDOMProvider.cs
- SymmetricKeyWrap.cs
- BmpBitmapEncoder.cs
- DesignTimeParseData.cs
- TypeForwardedToAttribute.cs
- XamlClipboardData.cs
- CodePageUtils.cs
- ListCollectionView.cs
- RemotingConfiguration.cs
- XmlFormatReaderGenerator.cs
- HostingEnvironment.cs
- HttpRuntime.cs
- ParseElement.cs
- CaseInsensitiveHashCodeProvider.cs
- DeleteMemberBinder.cs
- HttpRequest.cs
- ColorAnimationBase.cs
- CFStream.cs
- ChannelDispatcherCollection.cs
- UrlPath.cs
- StrongNameUtility.cs
- PriorityRange.cs
- ListViewContainer.cs
- CodeDomConfigurationHandler.cs
- SweepDirectionValidation.cs
- MouseButton.cs
- SettingsPropertyNotFoundException.cs
- MethodSet.cs
- _CookieModule.cs
- Console.cs
- EdmComplexPropertyAttribute.cs
- ValidatedControlConverter.cs
- ToolBarTray.cs
- ShaperBuffers.cs
- CaretElement.cs
- GridErrorDlg.cs
- XmlJsonReader.cs
- MouseEventArgs.cs
- HttpRuntime.cs
- basevalidator.cs
- ProtocolsSection.cs
- ListContractAdapter.cs
- GeneralTransformCollection.cs
- ColorTranslator.cs
- TransformationRules.cs
- FlagsAttribute.cs
- AppSecurityManager.cs
- HotCommands.cs
- UpnEndpointIdentity.cs
- QueueAccessMode.cs
- LayoutManager.cs
- DbConnectionPoolCounters.cs
- NullToBooleanConverter.cs
- TypeExtension.cs
- WebPartDeleteVerb.cs
- UnsafeNativeMethods.cs
- WebRequest.cs
- URLBuilder.cs
- DataGridViewCellEventArgs.cs
- ToolStripDesigner.cs
- Convert.cs
- SortKey.cs
- XsdDateTime.cs
- DocumentGrid.cs
- IPGlobalProperties.cs
- Wizard.cs
- AutomationEventArgs.cs
- VisualStyleTypesAndProperties.cs
- XmlnsCache.cs
- RestHandlerFactory.cs
- VirtualPathProvider.cs
- InputScopeAttribute.cs
- ParserExtension.cs
- ExtenderControl.cs
- coordinatorfactory.cs
- Menu.cs
- TemplatedMailWebEventProvider.cs
- MenuItemStyleCollection.cs
- UnknownBitmapEncoder.cs
- ParseElementCollection.cs
- ErrorFormatter.cs
- SizeChangedInfo.cs
- ArraySet.cs
- PersonalizationAdministration.cs
- RowsCopiedEventArgs.cs