Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebControls / XmlHierarchicalEnumerable.cs / 2 / XmlHierarchicalEnumerable.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.WebControls {
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing.Design;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Xml;
///
/// An enumerable representing a single level of an XmlHierarchicalDataSourceView.
///
internal sealed class XmlHierarchicalEnumerable : IHierarchicalEnumerable {
private string _path;
private XmlNodeList _nodeList;
///
/// Creates a new instance of XmlHierarchicalEnumerable.
///
internal XmlHierarchicalEnumerable(XmlNodeList nodeList) {
_nodeList = nodeList;
}
internal string Path {
get {
return _path;
}
set {
_path = value;
}
}
IEnumerator IEnumerable.GetEnumerator() {
foreach (XmlNode node in _nodeList) {
if (node.NodeType == XmlNodeType.Element) {
yield return new XmlHierarchyData(this, node);
}
}
}
IHierarchyData IHierarchicalEnumerable.GetHierarchyData(object enumeratedItem) {
return (IHierarchyData)enumeratedItem;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.WebControls {
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing.Design;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Xml;
///
/// An enumerable representing a single level of an XmlHierarchicalDataSourceView.
///
internal sealed class XmlHierarchicalEnumerable : IHierarchicalEnumerable {
private string _path;
private XmlNodeList _nodeList;
///
/// Creates a new instance of XmlHierarchicalEnumerable.
///
internal XmlHierarchicalEnumerable(XmlNodeList nodeList) {
_nodeList = nodeList;
}
internal string Path {
get {
return _path;
}
set {
_path = value;
}
}
IEnumerator IEnumerable.GetEnumerator() {
foreach (XmlNode node in _nodeList) {
if (node.NodeType == XmlNodeType.Element) {
yield return new XmlHierarchyData(this, node);
}
}
}
IHierarchyData IHierarchicalEnumerable.GetHierarchyData(object enumeratedItem) {
return (IHierarchyData)enumeratedItem;
}
}
}
// 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
- OwnerDrawPropertyBag.cs
- FixedPosition.cs
- FontInfo.cs
- ClientUtils.cs
- EnumerableRowCollection.cs
- ShaderEffect.cs
- ToolStripSplitStackLayout.cs
- MarshalByRefObject.cs
- ChineseLunisolarCalendar.cs
- DataGridView.cs
- Propagator.Evaluator.cs
- ToolStripArrowRenderEventArgs.cs
- QilInvokeLateBound.cs
- PropertyInfoSet.cs
- HuffModule.cs
- RoleGroupCollection.cs
- RectangleHotSpot.cs
- WaitHandle.cs
- DateTimeValueSerializerContext.cs
- PreviewPrintController.cs
- LoginCancelEventArgs.cs
- DataTemplateKey.cs
- SqlClientWrapperSmiStream.cs
- SqlFactory.cs
- DataGridViewColumn.cs
- RtfFormatStack.cs
- TaskFormBase.cs
- AnimatedTypeHelpers.cs
- RowsCopiedEventArgs.cs
- GeometryHitTestParameters.cs
- SHA384Managed.cs
- OracleConnectionStringBuilder.cs
- PingOptions.cs
- AxisAngleRotation3D.cs
- TypeReference.cs
- ToolStripSeparator.cs
- DependencyProperty.cs
- SByteStorage.cs
- LineGeometry.cs
- DataSourceView.cs
- SchemaElementLookUpTableEnumerator.cs
- FullTextState.cs
- XmlAttributeCollection.cs
- PerfCounters.cs
- RemoteWebConfigurationHost.cs
- DesignTimeValidationFeature.cs
- StrongName.cs
- ByteFacetDescriptionElement.cs
- KerberosReceiverSecurityToken.cs
- UICuesEvent.cs
- WebRequestModulesSection.cs
- SqlParameterCollection.cs
- StandardBindingElement.cs
- Crc32.cs
- DataGridViewBand.cs
- ConsoleTraceListener.cs
- webproxy.cs
- XmlSerializerFactory.cs
- DocumentApplication.cs
- WindowsGraphicsCacheManager.cs
- CodeMemberEvent.cs
- TileBrush.cs
- LinkedDataMemberFieldEditor.cs
- LicenseException.cs
- TemplateLookupAction.cs
- XmlSchemaInferenceException.cs
- Evidence.cs
- XmlDictionaryString.cs
- MSAANativeProvider.cs
- FormsAuthenticationConfiguration.cs
- Base64Encoder.cs
- DockPanel.cs
- AdRotatorDesigner.cs
- BulletChrome.cs
- XamlTypeMapper.cs
- ImageField.cs
- ImageAttributes.cs
- DocumentPageHost.cs
- PageContent.cs
- StringStorage.cs
- StringCollection.cs
- FramingDecoders.cs
- SerialReceived.cs
- TrimSurroundingWhitespaceAttribute.cs
- ExtensionFile.cs
- indexingfiltermarshaler.cs
- RC2CryptoServiceProvider.cs
- BaseTemplateBuildProvider.cs
- GridSplitter.cs
- ListBindingConverter.cs
- RegistryPermission.cs
- SortDescriptionCollection.cs
- PreProcessInputEventArgs.cs
- SqlTypeSystemProvider.cs
- JournalEntry.cs
- MachineKeyConverter.cs
- xamlnodes.cs
- SafeEventLogWriteHandle.cs
- EndGetFileNameFromUserRequest.cs
- SubtreeProcessor.cs