Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / UI / WebControls / XmlHierarchicalDataSourceView.cs / 1 / 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.Security.Permissions; using System.Text; using System.Web; using System.Web.UI; using System.Web.Util; using System.Xml; ////// Represents a hierarchical view of an XmlDataSource. /// [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 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.Security.Permissions; using System.Text; using System.Web; using System.Web.UI; using System.Web.Util; using System.Xml; ////// Represents a hierarchical view of an XmlDataSource. /// [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 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
- LoginCancelEventArgs.cs
- ScrollItemPatternIdentifiers.cs
- GetWinFXPath.cs
- URLString.cs
- ClientTarget.cs
- Point3D.cs
- DefaultTextStore.cs
- SQLMoneyStorage.cs
- DataServiceProviderWrapper.cs
- FirewallWrapper.cs
- ImportFileRequest.cs
- TaiwanCalendar.cs
- SettingsPropertyCollection.cs
- SR.cs
- RadioButtonPopupAdapter.cs
- PanelStyle.cs
- ListView.cs
- BaseDataBoundControl.cs
- TablePatternIdentifiers.cs
- XpsFontSerializationService.cs
- PropertyTab.cs
- TraceHelpers.cs
- NoneExcludedImageIndexConverter.cs
- PointCollectionConverter.cs
- WebEventCodes.cs
- HebrewNumber.cs
- VectorAnimationUsingKeyFrames.cs
- EntityCommandCompilationException.cs
- ToolStripPanel.cs
- SetterBaseCollection.cs
- PersistChildrenAttribute.cs
- CompositeCollectionView.cs
- WebServiceBindingAttribute.cs
- CompoundFileStreamReference.cs
- FlowLayoutSettings.cs
- TextBlock.cs
- MembershipUser.cs
- Control.cs
- ContainerSelectorActiveEvent.cs
- XmlEventCache.cs
- BitSet.cs
- HitTestParameters.cs
- DesignTimeParseData.cs
- TimeoutValidationAttribute.cs
- PasswordDeriveBytes.cs
- DataSourceCacheDurationConverter.cs
- WindowsStatusBar.cs
- DictionarySectionHandler.cs
- DataGridCellsPanel.cs
- UnaryNode.cs
- GridViewAutoFormat.cs
- XPathNodeIterator.cs
- _OSSOCK.cs
- AffineTransform3D.cs
- DocumentScope.cs
- ProvidersHelper.cs
- QilExpression.cs
- RangeValidator.cs
- NamespaceExpr.cs
- MarkupWriter.cs
- HelpProvider.cs
- XmlWriter.cs
- DeclarativeConditionsCollection.cs
- DomNameTable.cs
- TypedTableHandler.cs
- FileClassifier.cs
- ZoneButton.cs
- ReadOnlyHierarchicalDataSourceView.cs
- updateconfighost.cs
- StorageComplexTypeMapping.cs
- RangeValidator.cs
- WebServiceBindingAttribute.cs
- CssClassPropertyAttribute.cs
- SqlCacheDependencyDatabaseCollection.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- XhtmlConformanceSection.cs
- DBCommand.cs
- MouseEvent.cs
- DBSqlParserTableCollection.cs
- WebPartCancelEventArgs.cs
- SecurityUniqueId.cs
- Buffer.cs
- ColorKeyFrameCollection.cs
- DPCustomTypeDescriptor.cs
- BaseComponentEditor.cs
- ValueTable.cs
- ImmutableObjectAttribute.cs
- PathTooLongException.cs
- ErrorHandlingReceiver.cs
- ScriptControlDescriptor.cs
- OAVariantLib.cs
- WebControlAdapter.cs
- CommandBinding.cs
- BamlRecords.cs
- RegexParser.cs
- SerializationHelper.cs
- AmbientProperties.cs
- TdsRecordBufferSetter.cs
- BoolExpression.cs
- XmlFormatExtensionAttribute.cs