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
- ClientBuildManager.cs
- RecordManager.cs
- CompositeControlDesigner.cs
- GacUtil.cs
- InputLangChangeEvent.cs
- ModifierKeysValueSerializer.cs
- ClonableStack.cs
- TimelineGroup.cs
- WmlLiteralTextAdapter.cs
- DbMetaDataFactory.cs
- CodeGotoStatement.cs
- MarkedHighlightComponent.cs
- PagePropertiesChangingEventArgs.cs
- RelatedView.cs
- SessionSymmetricTransportSecurityProtocolFactory.cs
- ScrollItemPattern.cs
- WindowsListViewSubItem.cs
- UnsafeNativeMethodsMilCoreApi.cs
- MouseButtonEventArgs.cs
- InProcStateClientManager.cs
- RawAppCommandInputReport.cs
- DocumentViewerBaseAutomationPeer.cs
- ClientScriptManagerWrapper.cs
- MsmqInputChannelListenerBase.cs
- HttpHeaderCollection.cs
- ImageSourceValueSerializer.cs
- HashHelper.cs
- RuntimeCompatibilityAttribute.cs
- Pens.cs
- ReadWriteObjectLock.cs
- SetterBase.cs
- ThicknessAnimationUsingKeyFrames.cs
- RectangleGeometry.cs
- AxHost.cs
- AttributeCollection.cs
- SqlIdentifier.cs
- DefaultProxySection.cs
- AuthorizationRuleCollection.cs
- FontNamesConverter.cs
- CompilationRelaxations.cs
- QilName.cs
- LineVisual.cs
- CodeIterationStatement.cs
- ExpressionBuilderCollection.cs
- SQLMembershipProvider.cs
- WinEventWrap.cs
- CompiledIdentityConstraint.cs
- SafeCertificateStore.cs
- PenThread.cs
- UserControl.cs
- WebPartEditorCancelVerb.cs
- ListContractAdapter.cs
- OleDbWrapper.cs
- TextCollapsingProperties.cs
- ButtonChrome.cs
- dataprotectionpermission.cs
- Span.cs
- BindingList.cs
- DbConnectionFactory.cs
- PriorityRange.cs
- BindingMemberInfo.cs
- WmlObjectListAdapter.cs
- TypedTableHandler.cs
- SafeFileMappingHandle.cs
- ImageListUtils.cs
- FormViewPagerRow.cs
- TabControlEvent.cs
- DbConnectionStringCommon.cs
- StandardToolWindows.cs
- SerializerProvider.cs
- InterleavedZipPartStream.cs
- GeneralTransformGroup.cs
- EffectiveValueEntry.cs
- PairComparer.cs
- Latin1Encoding.cs
- ProcessHostMapPath.cs
- RetriableClipboard.cs
- ServiceObjectContainer.cs
- RoutedPropertyChangedEventArgs.cs
- WebBrowserContainer.cs
- NotifyInputEventArgs.cs
- CustomCredentialPolicy.cs
- BufferedGraphicsManager.cs
- CapabilitiesPattern.cs
- WaveHeader.cs
- SliderAutomationPeer.cs
- OleDbMetaDataFactory.cs
- ConnectionPoint.cs
- XmlSchemaImport.cs
- StringBuilder.cs
- KeyGestureValueSerializer.cs
- WSHttpSecurityElement.cs
- InstallerTypeAttribute.cs
- PropertyEmitter.cs
- BindingCompleteEventArgs.cs
- BinaryObjectReader.cs
- ValidateNames.cs
- TTSEngineProxy.cs
- MessageBodyMemberAttribute.cs
- WebBrowserEvent.cs