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
- SequentialActivityDesigner.cs
- CultureData.cs
- WebPartVerbsEventArgs.cs
- ComplexTypeEmitter.cs
- Msec.cs
- WCFModelStrings.Designer.cs
- ToolBarTray.cs
- CfgParser.cs
- _Rfc2616CacheValidators.cs
- DataSetUtil.cs
- UserInitiatedNavigationPermission.cs
- GeometryValueSerializer.cs
- LinqDataSourceDeleteEventArgs.cs
- TextElementCollectionHelper.cs
- PermissionToken.cs
- NamespaceEmitter.cs
- DetailsViewDeleteEventArgs.cs
- EntityDescriptor.cs
- HostSecurityManager.cs
- QilInvoke.cs
- ReceiveMessageRecord.cs
- BitmapEffectGeneralTransform.cs
- SystemParameters.cs
- UnmanagedMemoryStream.cs
- DESCryptoServiceProvider.cs
- HttpEncoderUtility.cs
- NullEntityWrapper.cs
- ErrorWrapper.cs
- LabelLiteral.cs
- TypeToArgumentTypeConverter.cs
- LabelEditEvent.cs
- GenericIdentity.cs
- DataServiceQueryContinuation.cs
- DataGridCellsPanel.cs
- MailBnfHelper.cs
- CompilerScopeManager.cs
- FeedUtils.cs
- PolicyManager.cs
- FormParameter.cs
- COSERVERINFO.cs
- AlgoModule.cs
- CellIdBoolean.cs
- ObjectStateManager.cs
- TextOutput.cs
- VirtualDirectoryMappingCollection.cs
- ComplexPropertyEntry.cs
- GridViewAutomationPeer.cs
- HtmlControlAdapter.cs
- LeaseManager.cs
- InvokeGenerator.cs
- SafeMILHandle.cs
- CodeGotoStatement.cs
- StringBuilder.cs
- XmlAnyElementAttribute.cs
- TextServicesPropertyRanges.cs
- MenuCommand.cs
- TableLayoutColumnStyleCollection.cs
- OptimalBreakSession.cs
- ControlEvent.cs
- _RequestCacheProtocol.cs
- Image.cs
- XmlTypeMapping.cs
- SelectionGlyphBase.cs
- ResourceDisplayNameAttribute.cs
- AttachedAnnotation.cs
- EventWaitHandleSecurity.cs
- DoubleConverter.cs
- XsltSettings.cs
- MenuCommands.cs
- MemoryMappedViewAccessor.cs
- ScalarOps.cs
- BrowsableAttribute.cs
- ThreadStaticAttribute.cs
- SQLSingleStorage.cs
- Byte.cs
- elementinformation.cs
- _TransmitFileOverlappedAsyncResult.cs
- SelectedPathEditor.cs
- CacheMemory.cs
- TypefaceMetricsCache.cs
- IdleTimeoutMonitor.cs
- DescendantBaseQuery.cs
- Literal.cs
- UpDownEvent.cs
- SapiRecoInterop.cs
- WebErrorHandler.cs
- ExecutionContext.cs
- TraceRecord.cs
- BridgeDataReader.cs
- ListViewInsertedEventArgs.cs
- TextBlock.cs
- OutOfProcStateClientManager.cs
- ComponentManagerBroker.cs
- Faults.cs
- FontDifferentiator.cs
- LocatorPart.cs
- TdsParserHelperClasses.cs
- DrawTreeNodeEventArgs.cs
- MDIWindowDialog.cs
- SafeNativeMethods.cs