Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Xml / System / Xml / Dom / XmlSignificantWhitespace.cs / 1 / XmlSignificantWhitespace.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 XmlSignificantWhitespace : XmlCharacterData {
protected internal XmlSignificantWhitespace( 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.strSignificantWhitespaceName;
}
}
// Gets the name of the current node without the namespace prefix.
public override String LocalName {
get {
return OwnerDocument.strSignificantWhitespaceName;
}
}
// Gets the type of the current node.
public override XmlNodeType NodeType {
get {
return XmlNodeType.SignificantWhitespace;
}
}
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;
}
}
}
// Creates a duplicate of this node.
public override XmlNode CloneNode(bool deep) {
Debug.Assert( OwnerDocument != null );
return OwnerDocument.CreateSignificantWhitespace( Data );
}
public override String Value {
get {
return Data;
}
set {
if ( CheckOnData( value ) )
Data = value;
else
throw new ArgumentException(Res.GetString(Res.Xdom_WS_Char));
}
}
// Saves the node to the specified XmlWriter.
public override void WriteTo(XmlWriter w) {
w.WriteString(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.SignificantWhitespace;
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.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TextBox.cs
- WebPart.cs
- SqlTypeConverter.cs
- TreeViewAutomationPeer.cs
- ListViewInsertEventArgs.cs
- WindowsStreamSecurityUpgradeProvider.cs
- XamlSerializerUtil.cs
- WindowsFormsLinkLabel.cs
- VisualCollection.cs
- BaseCodeDomTreeGenerator.cs
- HttpProfileBase.cs
- CharUnicodeInfo.cs
- InputBindingCollection.cs
- InfoCardCryptoHelper.cs
- ResXResourceReader.cs
- PropertyEmitterBase.cs
- ReadOnlyDataSource.cs
- ReversePositionQuery.cs
- ServiceDescriptionContext.cs
- HtmlElementEventArgs.cs
- XamlSerializationHelper.cs
- HealthMonitoringSectionHelper.cs
- QuaternionConverter.cs
- XmlAttribute.cs
- XmlWrappingWriter.cs
- AnimationLayer.cs
- DictionaryCustomTypeDescriptor.cs
- DataPointer.cs
- SecurityUtils.cs
- EventDescriptor.cs
- StatusBar.cs
- WorkflowPrinting.cs
- GradientBrush.cs
- VirtualizedItemPattern.cs
- FragmentNavigationEventArgs.cs
- UIAgentRequest.cs
- OpenTypeCommon.cs
- ToolStripItemImageRenderEventArgs.cs
- RotateTransform.cs
- DataControlFieldHeaderCell.cs
- ListViewDeletedEventArgs.cs
- RequiredAttributeAttribute.cs
- KernelTypeValidation.cs
- Win32PrintDialog.cs
- SecurityPolicySection.cs
- ExpressionLexer.cs
- RemoteHelper.cs
- Line.cs
- StartUpEventArgs.cs
- AppDomainProtocolHandler.cs
- DateTimeStorage.cs
- Timer.cs
- Cursors.cs
- PackagingUtilities.cs
- AspNetSynchronizationContext.cs
- TargetParameterCountException.cs
- MailHeaderInfo.cs
- RoutedEventArgs.cs
- StoreUtilities.cs
- LassoSelectionBehavior.cs
- URLString.cs
- DateTimeFormatInfoScanner.cs
- TextHintingModeValidation.cs
- OleDbSchemaGuid.cs
- HostedTcpTransportManager.cs
- PinnedBufferMemoryStream.cs
- AccessKeyManager.cs
- HttpDictionary.cs
- BreakRecordTable.cs
- XmlToDatasetMap.cs
- HttpCapabilitiesEvaluator.cs
- AppSettingsExpressionBuilder.cs
- EditorZoneBase.cs
- DesignerInterfaces.cs
- DetailsViewDeletedEventArgs.cs
- FtpCachePolicyElement.cs
- NotFiniteNumberException.cs
- RepeaterItemEventArgs.cs
- SingleStorage.cs
- ObjectDataSourceStatusEventArgs.cs
- ImmComposition.cs
- RowsCopiedEventArgs.cs
- SmiXetterAccessMap.cs
- LineInfo.cs
- VirtualizedCellInfoCollection.cs
- TypeEnumerableViewSchema.cs
- RunWorkerCompletedEventArgs.cs
- SqlFunctionAttribute.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- ProgressBar.cs
- AttributeTableBuilder.cs
- EventMappingSettings.cs
- MenuAutomationPeer.cs
- RegexCapture.cs
- AsyncContentLoadedEventArgs.cs
- TypeGeneratedEventArgs.cs
- HttpCapabilitiesSectionHandler.cs
- GridItemCollection.cs
- DrawingContextDrawingContextWalker.cs
- IsolatedStorageFileStream.cs