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
- DataSet.cs
- TripleDES.cs
- WorkflowViewService.cs
- OutputCacheProviderCollection.cs
- HtmlGenericControl.cs
- ApplicationServicesHostFactory.cs
- StorageRoot.cs
- WeakEventTable.cs
- MissingSatelliteAssemblyException.cs
- LicenseException.cs
- FlowLayoutPanelDesigner.cs
- InternalsVisibleToAttribute.cs
- ReferenceEqualityComparer.cs
- ContentFilePart.cs
- _DisconnectOverlappedAsyncResult.cs
- Exceptions.cs
- GradientBrush.cs
- ObjectIDGenerator.cs
- SimpleHandlerBuildProvider.cs
- CustomSignedXml.cs
- TileBrush.cs
- WeakHashtable.cs
- _NTAuthentication.cs
- COM2IPerPropertyBrowsingHandler.cs
- PngBitmapDecoder.cs
- mediaeventshelper.cs
- FacetChecker.cs
- Compiler.cs
- ComponentEvent.cs
- ProtocolsConfiguration.cs
- DataGridViewCellCancelEventArgs.cs
- View.cs
- OpacityConverter.cs
- RichTextBoxAutomationPeer.cs
- CompressionTransform.cs
- ISAPIWorkerRequest.cs
- XslAstAnalyzer.cs
- Color.cs
- XPathBuilder.cs
- SafeNativeMethods.cs
- DataGridColumnEventArgs.cs
- BrowserInteropHelper.cs
- HtmlForm.cs
- Calendar.cs
- ReadOnlyDataSource.cs
- StoreAnnotationsMap.cs
- SoapAttributes.cs
- WebBrowserProgressChangedEventHandler.cs
- MultiTouchSystemGestureLogic.cs
- DataTableReaderListener.cs
- BufferedGraphicsContext.cs
- WebServiceErrorEvent.cs
- TextTreeText.cs
- VBIdentifierTrimConverter.cs
- AuthenticationModuleElementCollection.cs
- PtsContext.cs
- Brush.cs
- EdmSchemaAttribute.cs
- ICollection.cs
- NegationPusher.cs
- EntityDataSourceReferenceGroup.cs
- FontWeightConverter.cs
- RC2.cs
- MessageBox.cs
- TextDecorationLocationValidation.cs
- WebRequestModuleElement.cs
- shaperfactoryquerycacheentry.cs
- TablePattern.cs
- _FtpDataStream.cs
- Color.cs
- SchemaNames.cs
- Model3D.cs
- DataKeyCollection.cs
- Operators.cs
- EdmValidator.cs
- Utility.cs
- TimeSpanMinutesConverter.cs
- RemoteTokenFactory.cs
- Soap.cs
- RuntimeHandles.cs
- PreservationFileWriter.cs
- TriggerAction.cs
- FragmentQueryKB.cs
- DrawingGroup.cs
- EntityType.cs
- SessionIDManager.cs
- MenuItemStyleCollection.cs
- ReferenceSchema.cs
- XmlLangPropertyAttribute.cs
- XmlCharCheckingReader.cs
- Matrix.cs
- EntityContainerEmitter.cs
- SettingsProperty.cs
- LinkButton.cs
- DecoderExceptionFallback.cs
- InputLanguageManager.cs
- OneToOneMappingSerializer.cs
- DBDataPermission.cs
- XPathAncestorQuery.cs
- SocketSettings.cs