Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / XmlUtils / System / Xml / Xsl / QIL / QilNode.cs / 1 / QilNode.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Xsl;
namespace System.Xml.Xsl.Qil {
///
/// A node in the QIL tree.
///
///
/// Don't construct QIL nodes directly; instead, use the QilFactory .
/// This base internal class is not abstract and may be instantiated in some cases (for example, true/false boolean literals).
///
internal class QilNode : IList {
protected QilNodeType nodeType;
protected XmlQueryType xmlType;
protected ISourceLineInfo sourceLine;
protected object annotation;
//-----------------------------------------------
// Constructor
//-----------------------------------------------
///
/// Construct a new node
///
public QilNode(QilNodeType nodeType) {
this.nodeType = nodeType;
}
///
/// Construct a new node
///
public QilNode(QilNodeType nodeType, XmlQueryType xmlType) {
this.nodeType = nodeType;
this.xmlType = xmlType;
}
//-----------------------------------------------
// QilNode methods
//-----------------------------------------------
///
/// Access the QIL node type.
///
public QilNodeType NodeType {
get { return this.nodeType; }
set { this.nodeType = value; }
}
///
/// Access the QIL type.
///
public virtual XmlQueryType XmlType {
get { return this.xmlType; }
set { this.xmlType = value; }
}
///
/// Line info information for tools support.
///
public ISourceLineInfo SourceLine {
get { return this.sourceLine; }
set { this.sourceLine = value; }
}
///
/// Access an annotation which may have been attached to this node.
///
public object Annotation {
get { return this.annotation; }
set { this.annotation = value; }
}
///
/// Create a new deep copy of this node.
///
public virtual QilNode DeepClone(QilFactory f) {
return new QilCloneVisitor(f).Clone(this);
}
///
/// Create a shallow copy of this node, copying all the fields.
///
public virtual QilNode ShallowClone(QilFactory f) {
QilNode n = (QilNode) MemberwiseClone();
f.TraceNode(n);
return n;
}
//-----------------------------------------------
// IList methods -- override
//-----------------------------------------------
public virtual int Count {
get { return 0; }
}
public virtual QilNode this[int index] {
get { throw new IndexOutOfRangeException(); }
set { throw new IndexOutOfRangeException(); }
}
public virtual void Insert(int index, QilNode node) {
throw new NotSupportedException();
}
public virtual void RemoveAt(int index) {
throw new NotSupportedException();
}
//-----------------------------------------------
// IList methods -- no need to override
//-----------------------------------------------
public IEnumerator GetEnumerator() {
return new IListEnumerator(this);
}
IEnumerator IEnumerable.GetEnumerator() {
return new IListEnumerator(this);
}
public virtual bool IsReadOnly {
get { return false; }
}
public virtual void Add(QilNode node) {
Insert(Count, node);
}
public virtual void Add(IList list) {
for (int i = 0; i < list.Count; i++)
Insert(Count, list[i]);
}
public virtual void Clear() {
for (int index = Count - 1; index >= 0; index--)
RemoveAt(index);
}
public virtual bool Contains(QilNode node) {
return IndexOf(node) != -1;
}
public virtual void CopyTo(QilNode[] array, int index) {
for (int i = 0; i < Count; i++)
array[index + i] = this[i];
}
public virtual bool Remove(QilNode node) {
int index = IndexOf(node);
if (index >= 0) {
RemoveAt(index);
return true;
}
return false;
}
public virtual int IndexOf(QilNode node) {
for (int i = 0; i < Count; i++)
if (node.Equals(this[i]))
return i;
return -1;
}
//-----------------------------------------------
// Debug
//-----------------------------------------------
#if QIL_TRACE_NODE_CREATION
private int nodeId;
private string nodeLoc;
public int NodeId {
get { return nodeId; }
set { nodeId = value; }
}
public string NodeLocation {
get { return nodeLoc; }
set { nodeLoc = value; }
}
#endif
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Xsl;
namespace System.Xml.Xsl.Qil {
///
/// A node in the QIL tree.
///
///
/// Don't construct QIL nodes directly; instead, use the QilFactory .
/// This base internal class is not abstract and may be instantiated in some cases (for example, true/false boolean literals).
///
internal class QilNode : IList {
protected QilNodeType nodeType;
protected XmlQueryType xmlType;
protected ISourceLineInfo sourceLine;
protected object annotation;
//-----------------------------------------------
// Constructor
//-----------------------------------------------
///
/// Construct a new node
///
public QilNode(QilNodeType nodeType) {
this.nodeType = nodeType;
}
///
/// Construct a new node
///
public QilNode(QilNodeType nodeType, XmlQueryType xmlType) {
this.nodeType = nodeType;
this.xmlType = xmlType;
}
//-----------------------------------------------
// QilNode methods
//-----------------------------------------------
///
/// Access the QIL node type.
///
public QilNodeType NodeType {
get { return this.nodeType; }
set { this.nodeType = value; }
}
///
/// Access the QIL type.
///
public virtual XmlQueryType XmlType {
get { return this.xmlType; }
set { this.xmlType = value; }
}
///
/// Line info information for tools support.
///
public ISourceLineInfo SourceLine {
get { return this.sourceLine; }
set { this.sourceLine = value; }
}
///
/// Access an annotation which may have been attached to this node.
///
public object Annotation {
get { return this.annotation; }
set { this.annotation = value; }
}
///
/// Create a new deep copy of this node.
///
public virtual QilNode DeepClone(QilFactory f) {
return new QilCloneVisitor(f).Clone(this);
}
///
/// Create a shallow copy of this node, copying all the fields.
///
public virtual QilNode ShallowClone(QilFactory f) {
QilNode n = (QilNode) MemberwiseClone();
f.TraceNode(n);
return n;
}
//-----------------------------------------------
// IList methods -- override
//-----------------------------------------------
public virtual int Count {
get { return 0; }
}
public virtual QilNode this[int index] {
get { throw new IndexOutOfRangeException(); }
set { throw new IndexOutOfRangeException(); }
}
public virtual void Insert(int index, QilNode node) {
throw new NotSupportedException();
}
public virtual void RemoveAt(int index) {
throw new NotSupportedException();
}
//-----------------------------------------------
// IList methods -- no need to override
//-----------------------------------------------
public IEnumerator GetEnumerator() {
return new IListEnumerator(this);
}
IEnumerator IEnumerable.GetEnumerator() {
return new IListEnumerator(this);
}
public virtual bool IsReadOnly {
get { return false; }
}
public virtual void Add(QilNode node) {
Insert(Count, node);
}
public virtual void Add(IList list) {
for (int i = 0; i < list.Count; i++)
Insert(Count, list[i]);
}
public virtual void Clear() {
for (int index = Count - 1; index >= 0; index--)
RemoveAt(index);
}
public virtual bool Contains(QilNode node) {
return IndexOf(node) != -1;
}
public virtual void CopyTo(QilNode[] array, int index) {
for (int i = 0; i < Count; i++)
array[index + i] = this[i];
}
public virtual bool Remove(QilNode node) {
int index = IndexOf(node);
if (index >= 0) {
RemoveAt(index);
return true;
}
return false;
}
public virtual int IndexOf(QilNode node) {
for (int i = 0; i < Count; i++)
if (node.Equals(this[i]))
return i;
return -1;
}
//-----------------------------------------------
// Debug
//-----------------------------------------------
#if QIL_TRACE_NODE_CREATION
private int nodeId;
private string nodeLoc;
public int NodeId {
get { return nodeId; }
set { nodeId = value; }
}
public string NodeLocation {
get { return nodeLoc; }
set { nodeLoc = value; }
}
#endif
}
}
// 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
- SerializerDescriptor.cs
- Application.cs
- CryptoConfig.cs
- SmiXetterAccessMap.cs
- XmlSchemaProviderAttribute.cs
- SchemaManager.cs
- FlatButtonAppearance.cs
- System.Data.OracleClient_BID.cs
- FederatedMessageSecurityOverHttp.cs
- VarRemapper.cs
- AuthorizationSection.cs
- ConfigurationElementCollection.cs
- XDeferredAxisSource.cs
- OracleInternalConnection.cs
- ArrayWithOffset.cs
- shaperfactoryquerycacheentry.cs
- InputLanguageEventArgs.cs
- FileDialogPermission.cs
- XmlExpressionDumper.cs
- DataGridViewCellStyleConverter.cs
- LoginCancelEventArgs.cs
- BitmapEffect.cs
- CryptoConfig.cs
- PagedDataSource.cs
- X509UI.cs
- Help.cs
- UdpUtility.cs
- TextElement.cs
- CodeBlockBuilder.cs
- XmlArrayItemAttribute.cs
- SecureStringHasher.cs
- WebPartConnectionsDisconnectVerb.cs
- UserControlParser.cs
- UnsafeNativeMethods.cs
- PropertiesTab.cs
- EntitySqlQueryCacheEntry.cs
- DataBinder.cs
- Splitter.cs
- WindowsButton.cs
- UIElement.cs
- DeadCharTextComposition.cs
- XmlNodeChangedEventArgs.cs
- SafeBitVector32.cs
- TemplateField.cs
- ReadOnlyDataSourceView.cs
- ObjectDataProvider.cs
- Registry.cs
- FolderBrowserDialog.cs
- TypeBuilderInstantiation.cs
- SplashScreen.cs
- SafePointer.cs
- Random.cs
- WinEventHandler.cs
- XmlSchemaSimpleContent.cs
- TabletDevice.cs
- HtmlInputRadioButton.cs
- ellipse.cs
- QueryContinueDragEvent.cs
- WindowsListViewSubItem.cs
- LogRestartAreaEnumerator.cs
- MiniLockedBorderGlyph.cs
- ImageListStreamer.cs
- MemoryRecordBuffer.cs
- Tool.cs
- TextTreeFixupNode.cs
- BrowserCapabilitiesFactory35.cs
- InvalidOleVariantTypeException.cs
- TriggerCollection.cs
- FilterableAttribute.cs
- ExpressionBuilderContext.cs
- SecurityContext.cs
- StorageAssociationTypeMapping.cs
- UnsafeNativeMethodsTablet.cs
- PageSetupDialog.cs
- SystemColorTracker.cs
- Internal.cs
- ChannelCredentials.cs
- SystemIPAddressInformation.cs
- EventData.cs
- EventMap.cs
- KeyNotFoundException.cs
- MultipartContentParser.cs
- ProfileProvider.cs
- EntityDataSourceReferenceGroup.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- EndpointIdentityExtension.cs
- BaseParagraph.cs
- Component.cs
- DataSourceNameHandler.cs
- FrameworkContentElement.cs
- CallbackValidator.cs
- CacheHelper.cs
- WorkflowRuntimeServiceElementCollection.cs
- RtfToXamlReader.cs
- ReadonlyMessageFilter.cs
- DataServiceSaveChangesEventArgs.cs
- OracleInternalConnection.cs
- CodeDomLocalizationProvider.cs
- SqlUserDefinedTypeAttribute.cs
- FixedTextPointer.cs