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
- TraceUtility.cs
- FrameworkTemplate.cs
- SortedList.cs
- PersonalizationProviderCollection.cs
- ArraySubsetEnumerator.cs
- WpfWebRequestHelper.cs
- ProcessProtocolHandler.cs
- GridItemProviderWrapper.cs
- SkewTransform.cs
- HandleCollector.cs
- SoapEnumAttribute.cs
- GridViewColumnCollectionChangedEventArgs.cs
- ResourceProviderFactory.cs
- FontDifferentiator.cs
- IdentityNotMappedException.cs
- ClonableStack.cs
- PeerCustomResolverSettings.cs
- GridViewUpdateEventArgs.cs
- SqlLiftWhereClauses.cs
- IncomingWebRequestContext.cs
- OleDbCommand.cs
- LoginNameDesigner.cs
- HtmlTernaryTree.cs
- TrustManagerMoreInformation.cs
- SHA256.cs
- PolicyVersion.cs
- RecordBuilder.cs
- SafeTokenHandle.cs
- FixedSOMContainer.cs
- ImportCatalogPart.cs
- AdCreatedEventArgs.cs
- Errors.cs
- EdmType.cs
- METAHEADER.cs
- ResourceAssociationTypeEnd.cs
- SQLDecimalStorage.cs
- RawStylusInputCustomData.cs
- OrderToken.cs
- BitmapEffectDrawing.cs
- CodeExpressionCollection.cs
- DefaultProxySection.cs
- CallSiteHelpers.cs
- UpDownEvent.cs
- BaseParagraph.cs
- RuleSettings.cs
- BrowserDefinitionCollection.cs
- BindingExpressionBase.cs
- Vector3DAnimationUsingKeyFrames.cs
- DocumentOrderComparer.cs
- ExcCanonicalXml.cs
- DataServiceKeyAttribute.cs
- DesignColumn.cs
- safelink.cs
- PasswordRecoveryDesigner.cs
- Number.cs
- HtmlHead.cs
- ASCIIEncoding.cs
- BaseTemplateParser.cs
- TraceFilter.cs
- ReaderWriterLockWrapper.cs
- BookmarkScopeInfo.cs
- TimeSpanStorage.cs
- Property.cs
- TreeViewHitTestInfo.cs
- ListBindingConverter.cs
- IUnknownConstantAttribute.cs
- SystemIPv6InterfaceProperties.cs
- SpeechDetectedEventArgs.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- Command.cs
- GeometryModel3D.cs
- Html32TextWriter.cs
- KeyboardNavigation.cs
- TdsValueSetter.cs
- DataSourceXmlSerializationAttribute.cs
- JoinTreeNode.cs
- DocumentGridContextMenu.cs
- DeviceContext2.cs
- RuntimeConfigLKG.cs
- WebConfigurationHostFileChange.cs
- TransformDescriptor.cs
- IODescriptionAttribute.cs
- SplashScreen.cs
- Help.cs
- InvalidTimeZoneException.cs
- ConcurrentStack.cs
- HttpCachePolicyWrapper.cs
- MetadataPropertyCollection.cs
- UniqueIdentifierService.cs
- StringConverter.cs
- WindowsContainer.cs
- CopyNamespacesAction.cs
- TdsParameterSetter.cs
- ObjectResult.cs
- DesignerProperties.cs
- CapiNative.cs
- TypeValidationEventArgs.cs
- FileEnumerator.cs
- TreeNodeCollectionEditorDialog.cs
- ObjectDataSourceMethodEventArgs.cs