Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / Dom / XmlWhitespace.cs / 1305376 / XmlWhitespace.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml { using System; using System.Xml.XPath; using System.Text; using System.Diagnostics; // Represents the text content of an element or attribute. public class XmlWhitespace : XmlCharacterData { protected internal XmlWhitespace( string strData, XmlDocument doc ) : base( strData, doc ) { if ( !doc.IsLoading && !base.CheckOnData( strData ) ) throw new ArgumentException(Res.GetString(Res.Xdom_WS_Char)); } // Gets the name of the node. public override String Name { get { return OwnerDocument.strNonSignificantWhitespaceName; } } // Gets the name of the current node without the namespace prefix. public override String LocalName { get { return OwnerDocument.strNonSignificantWhitespaceName; } } // Gets the type of the current node. public override XmlNodeType NodeType { get { return XmlNodeType.Whitespace; } } public override XmlNode ParentNode { get { switch (parentNode.NodeType) { case XmlNodeType.Document: return base.ParentNode; case XmlNodeType.Text: case XmlNodeType.CDATA: case XmlNodeType.Whitespace: case XmlNodeType.SignificantWhitespace: XmlNode parent = parentNode.parentNode; while (parent.IsText) { parent = parent.parentNode; } return parent; default: return parentNode; } } } public override String Value { get { return Data; } set { if ( CheckOnData( value ) ) Data = value; else throw new ArgumentException(Res.GetString(Res.Xdom_WS_Char)); } } // Creates a duplicate of this node. public override XmlNode CloneNode(bool deep) { Debug.Assert( OwnerDocument != null ); return OwnerDocument.CreateWhitespace( Data ); } // Saves the node to the specified XmlWriter. public override void WriteTo(XmlWriter w) { w.WriteWhitespace(Data); } // Saves all the children of the node to the specified XmlWriter. public override void WriteContentTo(XmlWriter w) { // Intentionally do nothing } internal override XPathNodeType XPNodeType { get { XPathNodeType xnt = XPathNodeType.Whitespace; DecideXPNodeTypeForTextNodes(this, ref xnt); return xnt; } } internal override bool IsText { get { return true; } } internal override XmlNode PreviousText { get { if (parentNode.IsText) { return parentNode; } return null; } } } } // 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
- HttpException.cs
- ChangeNode.cs
- ExpressionList.cs
- ValidationResult.cs
- HtmlTableCellCollection.cs
- DataBindEngine.cs
- ByValueEqualityComparer.cs
- SqlBulkCopyColumnMapping.cs
- TableRowGroup.cs
- TextPattern.cs
- ScopedKnownTypes.cs
- VScrollProperties.cs
- MachineKeyConverter.cs
- InternalBase.cs
- ColorBlend.cs
- ControllableStoryboardAction.cs
- HtmlEncodedRawTextWriter.cs
- ApplicationInfo.cs
- OracleDateTime.cs
- SafeFileMappingHandle.cs
- TypeNameConverter.cs
- ConfigXmlCDataSection.cs
- GB18030Encoding.cs
- PrinterResolution.cs
- Int64.cs
- HashHelper.cs
- ObjectToken.cs
- DataBinding.cs
- MultiPropertyDescriptorGridEntry.cs
- ComponentSerializationService.cs
- BlockUIContainer.cs
- DefaultCommandConverter.cs
- KeyValueConfigurationCollection.cs
- WorkflowElementDialog.cs
- RemoteWebConfigurationHost.cs
- InvalidPrinterException.cs
- ListBindingHelper.cs
- Baml2006SchemaContext.cs
- ProtocolsConfigurationHandler.cs
- OutputCache.cs
- TitleStyle.cs
- SignedInfo.cs
- FontCollection.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- StylusPointPropertyInfoDefaults.cs
- TextHidden.cs
- CopyOnWriteList.cs
- XmlWrappingWriter.cs
- Menu.cs
- ScriptingScriptResourceHandlerSection.cs
- NetSectionGroup.cs
- StrongNameIdentityPermission.cs
- AttributeXamlType.cs
- XmlTextEncoder.cs
- ContextStack.cs
- PeerTransportElement.cs
- IOException.cs
- WindowVisualStateTracker.cs
- VectorConverter.cs
- TrustLevelCollection.cs
- HierarchicalDataSourceConverter.cs
- StylusButtonEventArgs.cs
- EntityDataSourceStatementEditorForm.cs
- srgsitem.cs
- OdbcTransaction.cs
- ProtocolImporter.cs
- ComplexTypeEmitter.cs
- DefaultPropertyAttribute.cs
- PageCache.cs
- SessionStateSection.cs
- CodeDirectiveCollection.cs
- IsolatedStorageFileStream.cs
- UnwrappedTypesXmlSerializerManager.cs
- GroupJoinQueryOperator.cs
- DictationGrammar.cs
- CellPartitioner.cs
- FacetChecker.cs
- EmptyStringExpandableObjectConverter.cs
- OdbcConnectionFactory.cs
- MruCache.cs
- DnsEndPoint.cs
- GenericsInstances.cs
- DesignerActionUIService.cs
- TranslateTransform3D.cs
- VersionedStreamOwner.cs
- EditorPart.cs
- CreatingCookieEventArgs.cs
- CodeTypeMemberCollection.cs
- MdbDataFileEditor.cs
- TableLayoutSettingsTypeConverter.cs
- ListBoxChrome.cs
- PersonalizationState.cs
- WasEndpointConfigContainer.cs
- MaxValueConverter.cs
- Camera.cs
- EdmItemError.cs
- SqlProvider.cs
- XamlTypeMapper.cs
- SchemaDeclBase.cs
- SafeFindHandle.cs