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
- AxHost.cs
- EntityConnection.cs
- ParallelTimeline.cs
- LockedHandleGlyph.cs
- SByteStorage.cs
- WindowsToolbar.cs
- ReaderContextStackData.cs
- PathBox.cs
- GeneralTransform3D.cs
- ValidatedControlConverter.cs
- ReadOnlyAttribute.cs
- FreezableDefaultValueFactory.cs
- TableLayoutColumnStyleCollection.cs
- DataGridLinkButton.cs
- CacheDict.cs
- UpdatePanelTrigger.cs
- TextSegment.cs
- MetaType.cs
- PageThemeBuildProvider.cs
- TextInfo.cs
- NamedPermissionSet.cs
- WebAdminConfigurationHelper.cs
- BindingExpressionUncommonField.cs
- InputElement.cs
- CounterSampleCalculator.cs
- smtppermission.cs
- ColorTransform.cs
- DefaultEventAttribute.cs
- RequestQueryProcessor.cs
- ProcessHost.cs
- ObjectStateFormatter.cs
- Underline.cs
- DPCustomTypeDescriptor.cs
- XmlMembersMapping.cs
- SecurityRuntime.cs
- SequenceDesigner.xaml.cs
- SingleTagSectionHandler.cs
- RemotingAttributes.cs
- DataBinder.cs
- CompositionTarget.cs
- ConfigurationStrings.cs
- WebEventCodes.cs
- TimelineGroup.cs
- LineServicesCallbacks.cs
- SqlRowUpdatingEvent.cs
- DataGridTextBoxColumn.cs
- AutoScrollExpandMessageFilter.cs
- StateDesigner.Helpers.cs
- SafeTokenHandle.cs
- WebBrowserNavigatingEventHandler.cs
- VersionPair.cs
- PartitionResolver.cs
- WriteTimeStream.cs
- CommonProperties.cs
- Page.cs
- HostingEnvironmentSection.cs
- DataServiceResponse.cs
- DataGridHyperlinkColumn.cs
- FormViewDeleteEventArgs.cs
- RenderContext.cs
- Transform.cs
- XmlTextReaderImplHelpers.cs
- SafeNativeMethods.cs
- ParentUndoUnit.cs
- ScaleTransform3D.cs
- SqlSelectStatement.cs
- SoapTypeAttribute.cs
- DesignerActionService.cs
- DbDataRecord.cs
- HostedTransportConfigurationBase.cs
- TextDecorationCollection.cs
- SharedPersonalizationStateInfo.cs
- Rfc4050KeyFormatter.cs
- ObjectDataSourceMethodEditor.cs
- FixedTextContainer.cs
- UnhandledExceptionEventArgs.cs
- TextRunProperties.cs
- Image.cs
- SafeBuffer.cs
- DataFormat.cs
- RijndaelManaged.cs
- TextServicesProperty.cs
- SplitterPanel.cs
- NotifyIcon.cs
- OpenTypeLayoutCache.cs
- SrgsGrammarCompiler.cs
- SignatureHelper.cs
- XmlCharCheckingWriter.cs
- DeploymentExceptionMapper.cs
- DataTablePropertyDescriptor.cs
- Int64Converter.cs
- StringAnimationBase.cs
- ImageFormatConverter.cs
- AdvancedBindingEditor.cs
- Rotation3D.cs
- SqlDataSourceCommandEventArgs.cs
- SafeBitVector32.cs
- DocumentPage.cs
- RoleManagerSection.cs
- WMIGenerator.cs