Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ValueType.cs
- WaveHeader.cs
- NonVisualControlAttribute.cs
- URLIdentityPermission.cs
- WebContext.cs
- VirtualPathData.cs
- Soap.cs
- DockPanel.cs
- TextContainerChangeEventArgs.cs
- DataContract.cs
- StandardCommands.cs
- XsdCachingReader.cs
- DesignColumn.cs
- ListParaClient.cs
- BindingExpression.cs
- Type.cs
- StorageScalarPropertyMapping.cs
- Int64Converter.cs
- ValidatorCompatibilityHelper.cs
- DiffuseMaterial.cs
- LocalFileSettingsProvider.cs
- XmlUtil.cs
- CompositeFontInfo.cs
- TextBox.cs
- DictionarySectionHandler.cs
- EnvelopedPkcs7.cs
- GuidelineSet.cs
- RuntimeHandles.cs
- TypeSystem.cs
- TdsEnums.cs
- CultureTable.cs
- HttpAsyncResult.cs
- ProfileServiceManager.cs
- RightsManagementLicense.cs
- HttpCachePolicy.cs
- UnicodeEncoding.cs
- AccessibleObject.cs
- KnownIds.cs
- TCPListener.cs
- ReadContentAsBinaryHelper.cs
- ComponentResourceKey.cs
- TextSimpleMarkerProperties.cs
- DatePickerAutomationPeer.cs
- XmlSerializerSection.cs
- EdmFunction.cs
- CustomErrorCollection.cs
- TriggerAction.cs
- HttpListenerRequest.cs
- ConfigurationValidatorAttribute.cs
- HyperLinkColumn.cs
- ReceiveSecurityHeaderElementManager.cs
- XhtmlTextWriter.cs
- ForAllOperator.cs
- PropertyDescriptors.cs
- SerializeAbsoluteContext.cs
- DataSourceControl.cs
- Utils.cs
- DataRow.cs
- TextRangeProviderWrapper.cs
- ItemsChangedEventArgs.cs
- _HelperAsyncResults.cs
- FlowDocumentReaderAutomationPeer.cs
- HttpApplication.cs
- ActivationArguments.cs
- DrawingGroupDrawingContext.cs
- RelationalExpressions.cs
- SQLDoubleStorage.cs
- SqlFunctions.cs
- TriggerBase.cs
- XmlSchemaImport.cs
- XmlTextReader.cs
- SwitchAttribute.cs
- ObjectStateFormatter.cs
- AudienceUriMode.cs
- SafeMemoryMappedFileHandle.cs
- NamespaceEmitter.cs
- PrintDocument.cs
- Viewport3DAutomationPeer.cs
- UndirectedGraph.cs
- ListViewDeletedEventArgs.cs
- CultureTableRecord.cs
- FontFamily.cs
- ContentIterators.cs
- FrameSecurityDescriptor.cs
- WindowsRichEditRange.cs
- Events.cs
- InkCanvasSelection.cs
- CookielessData.cs
- TrailingSpaceComparer.cs
- StyleSelector.cs
- SettingsBase.cs
- AttributeProviderAttribute.cs
- SafeCertificateContext.cs
- PropagatorResult.cs
- RadialGradientBrush.cs
- TextElementCollectionHelper.cs
- ExpressionHelper.cs
- ClientConfigurationHost.cs
- PersonalizationProviderHelper.cs
- AccessibilityApplicationManager.cs