Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Serialization / System / Runtime / Serialization / XmlSerializableServices.cs / 1305376 / XmlSerializableServices.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Runtime.Serialization { using System.Collections.Generic; using System.Xml; using System.Xml.Schema; public static class XmlSerializableServices { [Fx.Tag.SecurityNote(Miscellaneous = "RequiresReview - Static fields are marked SecurityCritical or readonly to prevent" + " data from being modified or leaked to other components in appdomain.")] internal static readonly string ReadNodesMethodName = "ReadNodes"; public static XmlNode[] ReadNodes(XmlReader xmlReader) { if (xmlReader == null) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("xmlReader"); XmlDocument doc = new XmlDocument(); ListnodeList = new List (); if (xmlReader.MoveToFirstAttribute()) { do { if (IsValidAttribute(xmlReader)) { XmlNode node = doc.ReadNode(xmlReader); if (node == null) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.UnexpectedEndOfFile))); nodeList.Add(node); } } while (xmlReader.MoveToNextAttribute()); } xmlReader.MoveToElement(); if (!xmlReader.IsEmptyElement) { int startDepth = xmlReader.Depth; xmlReader.Read(); while (xmlReader.Depth > startDepth && xmlReader.NodeType != XmlNodeType.EndElement) { XmlNode node = doc.ReadNode(xmlReader); if (node == null) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.UnexpectedEndOfFile))); nodeList.Add(node); } } return nodeList.ToArray(); } private static bool IsValidAttribute(XmlReader xmlReader) { return xmlReader.NamespaceURI != Globals.SerializationNamespace && xmlReader.NamespaceURI != Globals.SchemaInstanceNamespace && xmlReader.Prefix != "xmlns" && xmlReader.LocalName != "xmlns"; } internal static string WriteNodesMethodName = "WriteNodes"; public static void WriteNodes(XmlWriter xmlWriter, XmlNode[] nodes) { if (xmlWriter == null) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("xmlWriter"); if (nodes != null) for(int i=0;i
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StylusDownEventArgs.cs
- Identity.cs
- SqlParameterizer.cs
- UIElementAutomationPeer.cs
- PropertyFilter.cs
- CompositeFontParser.cs
- InheritanceContextChangedEventManager.cs
- HashHelper.cs
- Splitter.cs
- DbParameterHelper.cs
- SettingsContext.cs
- ListDictionaryInternal.cs
- ListViewPagedDataSource.cs
- XamlFxTrace.cs
- FieldTemplateFactory.cs
- CodeTypeMemberCollection.cs
- ValueQuery.cs
- EventHandlersDesigner.cs
- RegexFCD.cs
- AuthenticationSection.cs
- SqlUnionizer.cs
- ControlPropertyNameConverter.cs
- DynamicMetaObjectBinder.cs
- EventLogInformation.cs
- PageSettings.cs
- TableCell.cs
- CheckPair.cs
- SiteMapDataSourceView.cs
- SchemaNames.cs
- StylusButtonCollection.cs
- InstanceDataCollection.cs
- ForEach.cs
- ResizeGrip.cs
- sqlnorm.cs
- CompressEmulationStream.cs
- ProxyWebPartConnectionCollection.cs
- EmptyReadOnlyDictionaryInternal.cs
- TextProviderWrapper.cs
- MatrixTransform3D.cs
- ExceptionUtility.cs
- DesignerRegionCollection.cs
- ExpressionConverter.cs
- ContentPropertyAttribute.cs
- ScriptManagerProxy.cs
- AutoGeneratedFieldProperties.cs
- Property.cs
- XamlInt32CollectionSerializer.cs
- LightweightCodeGenerator.cs
- BaseParser.cs
- ConfigXmlAttribute.cs
- TreeView.cs
- __ComObject.cs
- DynamicMethod.cs
- Control.cs
- CultureInfoConverter.cs
- ArrayItemReference.cs
- NativeDirectoryServicesQueryAPIs.cs
- Int32.cs
- PropertyTabAttribute.cs
- ExtensibleClassFactory.cs
- ChannelTraceRecord.cs
- DataGridParentRows.cs
- GCHandleCookieTable.cs
- ObjectNavigationPropertyMapping.cs
- NotSupportedException.cs
- OrderedDictionary.cs
- WsatServiceCertificate.cs
- printdlgexmarshaler.cs
- VSWCFServiceContractGenerator.cs
- DataGridViewTextBoxColumn.cs
- PrivacyNoticeBindingElement.cs
- HeaderCollection.cs
- EntityContainer.cs
- TextAdaptor.cs
- VirtualDirectoryMapping.cs
- DataColumnCollection.cs
- IImplicitResourceProvider.cs
- InkCanvasAutomationPeer.cs
- StackSpiller.Bindings.cs
- SqlInternalConnectionSmi.cs
- ActivityBindForm.cs
- MethodRental.cs
- ControlPersister.cs
- PointIndependentAnimationStorage.cs
- SoapFormatExtensions.cs
- FormViewCommandEventArgs.cs
- ListViewDeleteEventArgs.cs
- COMException.cs
- WindowsEditBox.cs
- XmlSchemaComplexContent.cs
- ObjectDataSourceFilteringEventArgs.cs
- DataGridViewRowPostPaintEventArgs.cs
- CodeTypeParameterCollection.cs
- Light.cs
- ActionMessageFilter.cs
- BypassElementCollection.cs
- DES.cs
- HttpRequest.cs
- XmlSchemaIdentityConstraint.cs
- StringSource.cs