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
- NullableConverter.cs
- IfJoinedCondition.cs
- LocalBuilder.cs
- PathFigureCollection.cs
- ImageCodecInfo.cs
- URLAttribute.cs
- Rect.cs
- ValidationError.cs
- FrameSecurityDescriptor.cs
- LZCodec.cs
- AudienceUriMode.cs
- BodyGlyph.cs
- ThrowHelper.cs
- HeaderedContentControl.cs
- CodeStatement.cs
- InputBindingCollection.cs
- GridViewPageEventArgs.cs
- PropertyDescriptorCollection.cs
- NamedObject.cs
- StylusButtonEventArgs.cs
- BlockCollection.cs
- RightNameExpirationInfoPair.cs
- ClientBuildManagerCallback.cs
- PenThreadWorker.cs
- RayHitTestParameters.cs
- ToolboxItemCollection.cs
- XmlSchemaObjectCollection.cs
- UnsafeNativeMethods.cs
- WindowsAuthenticationEventArgs.cs
- ContextProperty.cs
- EmptyElement.cs
- ConstraintStruct.cs
- PropertyEmitter.cs
- BoundsDrawingContextWalker.cs
- ParagraphResult.cs
- SubclassTypeValidatorAttribute.cs
- OutputCacheProviderCollection.cs
- AnonymousIdentificationModule.cs
- DataRowChangeEvent.cs
- SignerInfo.cs
- NonClientArea.cs
- FieldAccessException.cs
- FactoryId.cs
- TextFindEngine.cs
- HMAC.cs
- DynamicExpression.cs
- DateTimeOffset.cs
- OdbcCommandBuilder.cs
- HorizontalAlignConverter.cs
- ProtectedConfiguration.cs
- ObjectSet.cs
- Trace.cs
- LabelAutomationPeer.cs
- Pair.cs
- DocumentPageHost.cs
- CultureTable.cs
- ServiceBehaviorElement.cs
- PngBitmapEncoder.cs
- ErrorWrapper.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- ListViewInsertionMark.cs
- LabelAutomationPeer.cs
- XmlSubtreeReader.cs
- EnvelopedSignatureTransform.cs
- GlyphCache.cs
- PrimitiveSchema.cs
- CompareInfo.cs
- CompilerInfo.cs
- ProviderCollection.cs
- RectangleHotSpot.cs
- BufferAllocator.cs
- Listbox.cs
- HandleTable.cs
- XamlVector3DCollectionSerializer.cs
- Visual3D.cs
- TagMapInfo.cs
- AddInAdapter.cs
- Visual3D.cs
- DesignSurfaceServiceContainer.cs
- XmlDigitalSignatureProcessor.cs
- DataGridColumnHeadersPresenter.cs
- PrintPreviewDialog.cs
- PropertyDescriptorCollection.cs
- CommonDialog.cs
- ChtmlSelectionListAdapter.cs
- ProviderConnectionPointCollection.cs
- ClientRuntimeConfig.cs
- TextEditorCopyPaste.cs
- StoreAnnotationsMap.cs
- SearchForVirtualItemEventArgs.cs
- PropertyBuilder.cs
- Dictionary.cs
- SafeRightsManagementHandle.cs
- WindowsButton.cs
- ECDsa.cs
- Pair.cs
- ObjectFullSpanRewriter.cs
- Int64Converter.cs
- BlurEffect.cs
- DataGridViewLinkColumn.cs