Code:
/ FX-1434 / FX-1434 / 1.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
- CatalogPartChrome.cs
- FocusManager.cs
- ListItemsCollectionEditor.cs
- _HeaderInfo.cs
- OleDbSchemaGuid.cs
- SymmetricCryptoHandle.cs
- ShaderEffect.cs
- ClientSettingsProvider.cs
- XmlQualifiedName.cs
- CookieHandler.cs
- UpdatePanel.cs
- RelativeSource.cs
- IndexerNameAttribute.cs
- NextPreviousPagerField.cs
- CqlBlock.cs
- StringConcat.cs
- IntPtr.cs
- LayoutManager.cs
- GridViewRowPresenter.cs
- NamespaceDisplay.xaml.cs
- PropertyGridEditorPart.cs
- StringToken.cs
- SamlAction.cs
- ICspAsymmetricAlgorithm.cs
- IncrementalReadDecoders.cs
- DocumentAutomationPeer.cs
- TrackingLocation.cs
- Condition.cs
- CustomCredentialPolicy.cs
- While.cs
- SQLDoubleStorage.cs
- TextBox.cs
- StateWorkerRequest.cs
- _TimerThread.cs
- JapaneseCalendar.cs
- Metafile.cs
- DbException.cs
- DomainUpDown.cs
- NavigationHelper.cs
- ZipFileInfoCollection.cs
- BaseCollection.cs
- safex509handles.cs
- SapiInterop.cs
- FilteredAttributeCollection.cs
- WorkflowValidationFailedException.cs
- ProtocolProfile.cs
- Int32CAMarshaler.cs
- ArrayConverter.cs
- Propagator.Evaluator.cs
- NativeMethods.cs
- MetaForeignKeyColumn.cs
- PluralizationServiceUtil.cs
- Point3DIndependentAnimationStorage.cs
- TCPListener.cs
- ServerValidateEventArgs.cs
- UmAlQuraCalendar.cs
- Codec.cs
- AddressingProperty.cs
- KeyPullup.cs
- InputScopeAttribute.cs
- DescriptionAttribute.cs
- TaskFileService.cs
- SoapIgnoreAttribute.cs
- XhtmlBasicObjectListAdapter.cs
- VarInfo.cs
- SmtpClient.cs
- WebPartMenu.cs
- OSFeature.cs
- SqlCommandSet.cs
- TrustSection.cs
- SafeFileMappingHandle.cs
- SqlOuterApplyReducer.cs
- SspiNegotiationTokenProvider.cs
- RegexGroup.cs
- HttpRuntimeSection.cs
- CultureMapper.cs
- TreeNode.cs
- SystemException.cs
- ParallelTimeline.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- UserMapPath.cs
- InProcStateClientManager.cs
- Helpers.cs
- comcontractssection.cs
- ContactManager.cs
- DurableEnlistmentState.cs
- MachineKey.cs
- Bold.cs
- LogSwitch.cs
- CoTaskMemHandle.cs
- Matrix3D.cs
- HMACSHA384.cs
- ProgressiveCrcCalculatingStream.cs
- ServiceInfo.cs
- COM2PictureConverter.cs
- CustomLineCap.cs
- SQLMoneyStorage.cs
- NumericPagerField.cs
- SqlConnectionFactory.cs
- Attributes.cs