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
- WmlObjectListAdapter.cs
- MenuBase.cs
- WebPartEventArgs.cs
- DeviceFilterEditorDialog.cs
- SamlAuthorityBinding.cs
- HttpRequest.cs
- DurableOperationAttribute.cs
- XamlInt32CollectionSerializer.cs
- TextWriter.cs
- ItemContainerGenerator.cs
- ScaleTransform3D.cs
- DataSourceIDConverter.cs
- FileResponseElement.cs
- XhtmlBasicImageAdapter.cs
- Cursor.cs
- Camera.cs
- StylusCaptureWithinProperty.cs
- CompositeControlDesigner.cs
- AstNode.cs
- SHA512Managed.cs
- RichTextBoxDesigner.cs
- OracleRowUpdatedEventArgs.cs
- Visual.cs
- MetadataCollection.cs
- Effect.cs
- UpdateCommand.cs
- TraceUtils.cs
- SplineQuaternionKeyFrame.cs
- BitmapCacheBrush.cs
- StackOverflowException.cs
- ByValueEqualityComparer.cs
- DataGridViewButtonCell.cs
- DataServiceProcessingPipelineEventArgs.cs
- XmlDocumentViewSchema.cs
- ReferentialConstraint.cs
- RichTextBox.cs
- NotificationContext.cs
- CursorConverter.cs
- ErrorWrapper.cs
- Freezable.cs
- ByteKeyFrameCollection.cs
- IPPacketInformation.cs
- QilBinary.cs
- FixedPosition.cs
- XmlDictionaryReaderQuotas.cs
- StandardOleMarshalObject.cs
- StructuredProperty.cs
- RadioButtonAutomationPeer.cs
- _OverlappedAsyncResult.cs
- PersonalizationDictionary.cs
- InfoCardSymmetricAlgorithm.cs
- MachineKeySection.cs
- StorageComplexTypeMapping.cs
- odbcmetadatafactory.cs
- DependencyPropertyAttribute.cs
- HandlerMappingMemo.cs
- ArrayTypeMismatchException.cs
- PerformanceCounter.cs
- ControlIdConverter.cs
- ping.cs
- CodeNamespaceCollection.cs
- X509CertificateEndpointIdentity.cs
- RegisteredArrayDeclaration.cs
- basecomparevalidator.cs
- PassportAuthentication.cs
- DesignerUtility.cs
- SystemDropShadowChrome.cs
- BitmapCodecInfo.cs
- DesignerActionList.cs
- TypeLoadException.cs
- DependencyProperty.cs
- PkcsUtils.cs
- StylusPointProperties.cs
- DesignerTextWriter.cs
- OutputScope.cs
- XmlNodeChangedEventManager.cs
- ServiceRouteHandler.cs
- FontStretches.cs
- DataServiceProcessingPipeline.cs
- OleDbParameter.cs
- WebServiceHostFactory.cs
- SqlRewriteScalarSubqueries.cs
- DataRelationCollection.cs
- MexServiceChannelBuilder.cs
- MarshalDirectiveException.cs
- TextCharacters.cs
- TextEditorTyping.cs
- ResourcesBuildProvider.cs
- HandlerFactoryCache.cs
- XmlSchemaNotation.cs
- StrokeFIndices.cs
- PageRouteHandler.cs
- CompoundFileStreamReference.cs
- AssertUtility.cs
- Logging.cs
- AppDomainGrammarProxy.cs
- EpmContentSerializer.cs
- ProcessHost.cs
- CommandHelpers.cs
- MimeFormImporter.cs