Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebControls / SiteMapDesignerDataSourceView.cs / 1 / SiteMapDesignerDataSourceView.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.WebControls { using System; using System.Collections; using System.Data; using System.Web.UI.WebControls; ////// SiteMapDesignerDataSourceView is the designer view associated with a SiteMapDataSourceDesigner. /// [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags = System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] public class SiteMapDesignerDataSourceView : DesignerDataSourceView { private static readonly SiteMapDataSourceDesigner.SiteMapDataSourceViewSchema _siteMapViewSchema = new SiteMapDataSourceDesigner.SiteMapDataSourceViewSchema(); private SiteMapDataSourceDesigner _owner; private SiteMapDataSource _siteMapDataSource; public SiteMapDesignerDataSourceView(SiteMapDataSourceDesigner owner, string viewName) : base(owner, viewName) { _owner = owner; _siteMapDataSource = (SiteMapDataSource)_owner.Component; } public override IDataSourceViewSchema Schema { get { return _siteMapViewSchema; } } public override IEnumerable GetDesignTimeData(int minimumRows, out bool isSampleData) { string oldProvider = null; string oldStartingNodeUrl = null; SiteMapNodeCollection data = null; oldProvider = _siteMapDataSource.SiteMapProvider; oldStartingNodeUrl = _siteMapDataSource.StartingNodeUrl; _siteMapDataSource.Provider = _owner.DesignTimeSiteMapProvider; try { _siteMapDataSource.StartingNodeUrl = null; data = ((SiteMapDataSourceView)((IDataSource)_siteMapDataSource).GetView(Name)).Select(DataSourceSelectArguments.Empty) as SiteMapNodeCollection; isSampleData = false; } finally { _siteMapDataSource.StartingNodeUrl = oldStartingNodeUrl; _siteMapDataSource.SiteMapProvider = oldProvider; } if ((data != null) && (data.Count == 0)) { // No design time data could be retrieved, show dummy data isSampleData = true; return DesignTimeData.GetDesignTimeDataSource(DesignTimeData.CreateDummyDataBoundDataTable(), minimumRows); } return data; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HttpServerChannel.cs
- TraceEventCache.cs
- SetStoryboardSpeedRatio.cs
- BitmapEffectDrawingContent.cs
- ScrollItemPatternIdentifiers.cs
- PageCache.cs
- ApplicationActivator.cs
- GregorianCalendarHelper.cs
- RegionData.cs
- UnmanagedBitmapWrapper.cs
- SecurityRuntime.cs
- TextDpi.cs
- DataServiceHost.cs
- CustomExpressionEventArgs.cs
- SchemaEntity.cs
- DiscoveryReferences.cs
- RenderData.cs
- ChannelToken.cs
- DataAdapter.cs
- Substitution.cs
- XslAst.cs
- IPEndPointCollection.cs
- DesignTimeVisibleAttribute.cs
- Literal.cs
- ExtensionDataReader.cs
- SHA512Managed.cs
- DelegateArgument.cs
- TextCompositionManager.cs
- ToolboxDataAttribute.cs
- ReadOnlyHierarchicalDataSource.cs
- ApplicationFileParser.cs
- ListViewGroupCollectionEditor.cs
- RotateTransform3D.cs
- LinkConverter.cs
- AsmxEndpointPickerExtension.cs
- DbParameterCollectionHelper.cs
- MessageQueueInstaller.cs
- WindowsFormsHelpers.cs
- NonPrimarySelectionGlyph.cs
- TrackBarRenderer.cs
- EntitySetBase.cs
- Facet.cs
- FontStretch.cs
- BulletChrome.cs
- WebException.cs
- PropertyItem.cs
- basecomparevalidator.cs
- BevelBitmapEffect.cs
- DataGridState.cs
- SystemNetworkInterface.cs
- TypeInitializationException.cs
- InArgument.cs
- CustomValidator.cs
- PhysicalOps.cs
- WebPart.cs
- CodePageEncoding.cs
- DataStreams.cs
- Parameter.cs
- DataGridViewRowConverter.cs
- FormsAuthenticationModule.cs
- DataTableClearEvent.cs
- ItemAutomationPeer.cs
- ReadOnlyCollection.cs
- HTTPNotFoundHandler.cs
- Camera.cs
- ViewGenResults.cs
- PropertyGroupDescription.cs
- ChtmlSelectionListAdapter.cs
- UIElementIsland.cs
- SinglePageViewer.cs
- FormView.cs
- ConfigurationHelpers.cs
- CategoryGridEntry.cs
- Encoding.cs
- AsyncOperationManager.cs
- EntityDataSourceSelectedEventArgs.cs
- Models.cs
- BaseCodeDomTreeGenerator.cs
- AnnotationAdorner.cs
- Point.cs
- CmsInterop.cs
- RegistryPermission.cs
- Crc32Helper.cs
- DiffuseMaterial.cs
- CodePropertyReferenceExpression.cs
- BeginEvent.cs
- TableLayoutPanelCellPosition.cs
- AnnotationResourceChangedEventArgs.cs
- NotSupportedException.cs
- TextTreeRootNode.cs
- NameObjectCollectionBase.cs
- DataTemplate.cs
- SspiSecurityToken.cs
- UxThemeWrapper.cs
- WebBrowserBase.cs
- PatternMatchRules.cs
- ScriptReference.cs
- Command.cs
- Site.cs
- XPathAncestorIterator.cs