Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / XmlHierarchicalDataSourceView.cs / 1305376 / XmlHierarchicalDataSourceView.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.Web.Util; using System.Xml; ////// Represents a hierarchical view of an XmlDataSource. /// public class XmlHierarchicalDataSourceView : HierarchicalDataSourceView { private XmlDataSource _owner; private string _viewPath; ////// Creates a new instance of XmlHierarchicalDataSourceView. /// internal XmlHierarchicalDataSourceView(XmlDataSource owner, string viewPath) { Debug.Assert(owner != null); _owner = owner; _viewPath = viewPath; } public override IHierarchicalEnumerable Select() { XmlNode root = _owner.GetXmlDocument(); XmlNodeList nodes = null; if (!String.IsNullOrEmpty(_viewPath)) { XmlNode node = root.SelectSingleNode(_viewPath); if (node != null) { nodes = node.ChildNodes; } } else { if (_owner.XPath.Length > 0) { nodes = root.SelectNodes(_owner.XPath); } else { nodes = root.ChildNodes; } } return new XmlHierarchicalEnumerable(nodes); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// 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.Web.Util; using System.Xml; ////// Represents a hierarchical view of an XmlDataSource. /// public class XmlHierarchicalDataSourceView : HierarchicalDataSourceView { private XmlDataSource _owner; private string _viewPath; ////// Creates a new instance of XmlHierarchicalDataSourceView. /// internal XmlHierarchicalDataSourceView(XmlDataSource owner, string viewPath) { Debug.Assert(owner != null); _owner = owner; _viewPath = viewPath; } public override IHierarchicalEnumerable Select() { XmlNode root = _owner.GetXmlDocument(); XmlNodeList nodes = null; if (!String.IsNullOrEmpty(_viewPath)) { XmlNode node = root.SelectSingleNode(_viewPath); if (node != null) { nodes = node.ChildNodes; } } else { if (_owner.XPath.Length > 0) { nodes = root.SelectNodes(_owner.XPath); } else { nodes = root.ChildNodes; } } return new XmlHierarchicalEnumerable(nodes); } } } // 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
- SchemaNames.cs
- EntityDataSourceStatementEditor.cs
- IsolatedStorageFileStream.cs
- ContentDefinition.cs
- ToolStripComboBox.cs
- SqlCommandSet.cs
- ConfigXmlAttribute.cs
- COM2PictureConverter.cs
- RelationshipConstraintValidator.cs
- MatrixCamera.cs
- CancellationHandler.cs
- DecoderExceptionFallback.cs
- QilValidationVisitor.cs
- Padding.cs
- figurelengthconverter.cs
- DefaultValueTypeConverter.cs
- SoapServerProtocol.cs
- EntityDesignerDataSourceView.cs
- LogManagementAsyncResult.cs
- BasePattern.cs
- Vector3DAnimation.cs
- RenderData.cs
- ManagedFilter.cs
- EditorZoneBase.cs
- InputChannelBinder.cs
- infer.cs
- IndexedGlyphRun.cs
- Freezable.cs
- UrlPath.cs
- ExpressionBindingsDialog.cs
- DeleteMemberBinder.cs
- RadioButtonPopupAdapter.cs
- CodeAccessPermission.cs
- DesignerAdapterAttribute.cs
- RedirectionProxy.cs
- ResourceDisplayNameAttribute.cs
- ToolStripDropDown.cs
- EFColumnProvider.cs
- _emptywebproxy.cs
- SplitContainerDesigner.cs
- SolidColorBrush.cs
- AuthenticationModuleElement.cs
- NotCondition.cs
- SHA1Managed.cs
- WebPartExportVerb.cs
- TextTreeTextBlock.cs
- PassportAuthentication.cs
- DescriptionAttribute.cs
- OdbcConnectionStringbuilder.cs
- WindowsProgressbar.cs
- ReadOnlyDataSource.cs
- LongPath.cs
- HtmlTableRowCollection.cs
- GridViewDeletedEventArgs.cs
- PlainXmlDeserializer.cs
- DynamicRenderer.cs
- TypeToStringValueConverter.cs
- DispatchWrapper.cs
- OpCodes.cs
- BitmapDownload.cs
- DataTableTypeConverter.cs
- MessageQueueInstaller.cs
- TextTreeUndoUnit.cs
- SerializationInfo.cs
- HttpContextServiceHost.cs
- MultiTrigger.cs
- SecurityUtils.cs
- SiblingIterators.cs
- _ConnectStream.cs
- WorkflowEnvironment.cs
- Table.cs
- SoapSchemaMember.cs
- ZipIOExtraFieldZip64Element.cs
- ThrowHelper.cs
- FunctionImportMapping.cs
- _NetRes.cs
- ViewStateException.cs
- BlurEffect.cs
- ComponentEditorForm.cs
- EntityViewGenerator.cs
- CodeDirectionExpression.cs
- BitmapImage.cs
- GlobalizationAssembly.cs
- TableCellCollection.cs
- AttachInfo.cs
- PersonalizationStateQuery.cs
- SafePEFileHandle.cs
- StringDictionaryWithComparer.cs
- OdbcConnectionFactory.cs
- SynchronizationFilter.cs
- SqlRemoveConstantOrderBy.cs
- ResourceSetExpression.cs
- AutomationFocusChangedEventArgs.cs
- ZoneMembershipCondition.cs
- AutomationElementCollection.cs
- ProxyAttribute.cs
- _BaseOverlappedAsyncResult.cs
- OutKeywords.cs
- Visual3D.cs
- NativeMethods.cs