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
- DataGridViewColumnCollectionDialog.cs
- Subset.cs
- filewebresponse.cs
- RSAPKCS1KeyExchangeFormatter.cs
- SQLInt16.cs
- AutomationPatternInfo.cs
- FindCriteria11.cs
- ExpressionVisitor.cs
- DataSetUtil.cs
- XmlnsPrefixAttribute.cs
- TemplatePagerField.cs
- CompilerError.cs
- WindowsRichEdit.cs
- SqlGenerator.cs
- MachineKeyConverter.cs
- CustomErrorsSectionWrapper.cs
- WmpBitmapEncoder.cs
- CoreSwitches.cs
- BooleanSwitch.cs
- MenuDesigner.cs
- _AcceptOverlappedAsyncResult.cs
- ContourSegment.cs
- CompModHelpers.cs
- FloaterParagraph.cs
- EncoderNLS.cs
- SettingsPropertyValueCollection.cs
- UnitySerializationHolder.cs
- AsyncWaitHandle.cs
- RuntimeResourceSet.cs
- WindowsToolbar.cs
- CreateUserWizard.cs
- CodeTryCatchFinallyStatement.cs
- _OverlappedAsyncResult.cs
- RoleGroupCollection.cs
- HwndStylusInputProvider.cs
- ClassHandlersStore.cs
- XmlSchemaValidationException.cs
- XmlBufferReader.cs
- CodeNamespaceImport.cs
- ListMarkerSourceInfo.cs
- Part.cs
- EllipseGeometry.cs
- DynamicDataManager.cs
- ConstraintEnumerator.cs
- FontSource.cs
- OleServicesContext.cs
- FusionWrap.cs
- Tokenizer.cs
- WindowsListViewGroupHelper.cs
- EventHandlerList.cs
- ColorEditor.cs
- LookupNode.cs
- ConnectionStringSettingsCollection.cs
- UpdateProgress.cs
- PersonalizationProviderHelper.cs
- ContractMapping.cs
- ScalarType.cs
- DynamicPropertyHolder.cs
- WebPartConnectionsConfigureVerb.cs
- PartialCachingAttribute.cs
- TypeHelpers.cs
- GlyphRun.cs
- SecuritySessionSecurityTokenAuthenticator.cs
- SystemIPv4InterfaceProperties.cs
- InvalidOperationException.cs
- ColumnBinding.cs
- ColorContextHelper.cs
- EndpointConfigContainer.cs
- NamedPipeAppDomainProtocolHandler.cs
- OracleRowUpdatedEventArgs.cs
- SQlBooleanStorage.cs
- UnsafeNativeMethodsTablet.cs
- ConnectionsZone.cs
- TimeSpanStorage.cs
- HandleCollector.cs
- ClientSponsor.cs
- CodeSubDirectoriesCollection.cs
- IriParsingElement.cs
- MasterPageParser.cs
- TraceLevelStore.cs
- Help.cs
- HostedElements.cs
- BooleanSwitch.cs
- RegexCapture.cs
- IxmlLineInfo.cs
- DuplicateMessageDetector.cs
- WebService.cs
- SystemResourceHost.cs
- CompilerError.cs
- TagPrefixAttribute.cs
- SapiRecoContext.cs
- KerberosRequestorSecurityToken.cs
- DynamicExpression.cs
- SingleStorage.cs
- DbLambda.cs
- VarRefManager.cs
- ProcessModelSection.cs
- XmlSchemaComplexType.cs
- VsPropertyGrid.cs
- WindowsToolbarItemAsMenuItem.cs