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
- HealthMonitoringSection.cs
- ProtectedUri.cs
- ZipIOModeEnforcingStream.cs
- WebServiceTypeData.cs
- ProtocolReflector.cs
- WorkflowServiceBehavior.cs
- RawStylusInputCustomData.cs
- RichTextBox.cs
- DataSourceHelper.cs
- OleDbEnumerator.cs
- COM2IPerPropertyBrowsingHandler.cs
- CodeDelegateInvokeExpression.cs
- DataGridViewTextBoxColumn.cs
- ControlIdConverter.cs
- HtmlTextArea.cs
- XmlBinaryReader.cs
- SiteMapDataSource.cs
- Brushes.cs
- XmlDeclaration.cs
- SafeEventLogReadHandle.cs
- Screen.cs
- RequestCachePolicy.cs
- TrackBar.cs
- SystemDropShadowChrome.cs
- FixedSOMPage.cs
- ScrollEventArgs.cs
- DesignerActionListCollection.cs
- PermissionRequestEvidence.cs
- WebPartMenu.cs
- QilDataSource.cs
- LinkClickEvent.cs
- ClientApiGenerator.cs
- BitStack.cs
- ResourcesGenerator.cs
- SliderAutomationPeer.cs
- SafeRegistryHandle.cs
- DictionarySectionHandler.cs
- TrimSurroundingWhitespaceAttribute.cs
- PrintPreviewDialog.cs
- Page.cs
- AsyncOperation.cs
- StorageMappingFragment.cs
- XmlElementAttributes.cs
- HttpHandlersSection.cs
- Ports.cs
- LineServicesRun.cs
- WindowsPen.cs
- Point4D.cs
- InvalidPrinterException.cs
- SessionEndedEventArgs.cs
- ListenerElementsCollection.cs
- HuffmanTree.cs
- TabPanel.cs
- HighlightComponent.cs
- FastPropertyAccessor.cs
- X509Certificate2Collection.cs
- AppDomainShutdownMonitor.cs
- TranslateTransform.cs
- StorageMappingFragment.cs
- SimpleParser.cs
- _FixedSizeReader.cs
- ToolStripPanel.cs
- ObservableCollection.cs
- SqlGenerator.cs
- OracleException.cs
- PackageFilter.cs
- _SslStream.cs
- OdbcEnvironment.cs
- DispatcherObject.cs
- WsdlBuildProvider.cs
- TypedTableBaseExtensions.cs
- StylusShape.cs
- WindowsImpersonationContext.cs
- SqlUtil.cs
- XmlAttributeProperties.cs
- WebPartTransformer.cs
- Queue.cs
- LateBoundBitmapDecoder.cs
- GetWinFXPath.cs
- ErrorHandlingAcceptor.cs
- ReadContentAsBinaryHelper.cs
- DataBoundControlHelper.cs
- TextBoxRenderer.cs
- RIPEMD160Managed.cs
- MapPathBasedVirtualPathProvider.cs
- ApplicationManager.cs
- Documentation.cs
- ConstraintConverter.cs
- SoundPlayer.cs
- AutomationPropertyInfo.cs
- CodeAttributeArgumentCollection.cs
- Graphics.cs
- TemplateBindingExtension.cs
- NativeMethodsCLR.cs
- PointHitTestParameters.cs
- ExtenderProvidedPropertyAttribute.cs
- XmlLanguageConverter.cs
- SplitterEvent.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- DPTypeDescriptorContext.cs