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
- SupportingTokenProviderSpecification.cs
- StoreItemCollection.cs
- Button.cs
- Function.cs
- SmtpNetworkElement.cs
- SerializationException.cs
- Calendar.cs
- LayoutDump.cs
- ExpressionBuilder.cs
- ArrayElementGridEntry.cs
- ResolveCriteriaCD1.cs
- WizardSideBarListControlItem.cs
- CharConverter.cs
- DataGrid.cs
- RichTextBoxDesigner.cs
- PeerEndPoint.cs
- XsltOutput.cs
- WebPartDisplayModeEventArgs.cs
- EditorPartChrome.cs
- TaiwanCalendar.cs
- ConfigurationManagerHelperFactory.cs
- InvocationExpression.cs
- ImageInfo.cs
- DecoderExceptionFallback.cs
- EnumerableWrapperWeakToStrong.cs
- XNameTypeConverter.cs
- GraphicsState.cs
- SpellerStatusTable.cs
- QualificationDataItem.cs
- PrinterUnitConvert.cs
- Proxy.cs
- ClaimSet.cs
- DecoderExceptionFallback.cs
- RestClientProxyHandler.cs
- counter.cs
- WebPartConnection.cs
- WeakRefEnumerator.cs
- InternalSafeNativeMethods.cs
- DirectionalLight.cs
- EastAsianLunisolarCalendar.cs
- TextElementCollectionHelper.cs
- DataSet.cs
- OleDbRowUpdatingEvent.cs
- PolyQuadraticBezierSegment.cs
- FixedSOMGroup.cs
- GrowingArray.cs
- BooleanSwitch.cs
- X509Extension.cs
- HttpRequestWrapper.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- WebScriptServiceHostFactory.cs
- DataGridItem.cs
- TimeSpanSecondsConverter.cs
- ReadWriteObjectLock.cs
- WebPartPersonalization.cs
- CodeLinePragma.cs
- DefaultMemberAttribute.cs
- QueryCacheKey.cs
- SerialErrors.cs
- FixedLineResult.cs
- InkCanvasFeedbackAdorner.cs
- ProcessHostServerConfig.cs
- RemotingException.cs
- TraceContextRecord.cs
- ForeignConstraint.cs
- DataControlPagerLinkButton.cs
- HttpRequestCacheValidator.cs
- DataRowComparer.cs
- EventLogPermission.cs
- UpdateManifestForBrowserApplication.cs
- KnownTypeAttribute.cs
- InstanceDataCollectionCollection.cs
- ErrorCodes.cs
- InvalidComObjectException.cs
- ArraySortHelper.cs
- BitmapImage.cs
- PermissionRequestEvidence.cs
- DesignerActionTextItem.cs
- InvalidBodyAccessException.cs
- controlskin.cs
- ConstNode.cs
- basevalidator.cs
- WmlImageAdapter.cs
- DbProviderFactories.cs
- Graphics.cs
- DynamicEndpoint.cs
- OdbcDataAdapter.cs
- HtmlInputRadioButton.cs
- FixedSOMTextRun.cs
- PathHelper.cs
- ResourceAttributes.cs
- WindowsButton.cs
- ListView.cs
- RegexCompilationInfo.cs
- SerializationAttributes.cs
- ContentElement.cs
- NullableBoolConverter.cs
- TextRunTypographyProperties.cs
- TryExpression.cs
- AppDomainShutdownMonitor.cs