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
- JapaneseLunisolarCalendar.cs
- ToolStripMenuItemDesigner.cs
- LayoutEditorPart.cs
- InputLanguageCollection.cs
- RSAPKCS1KeyExchangeFormatter.cs
- WindowsSolidBrush.cs
- EnumUnknown.cs
- CheckBoxDesigner.cs
- OleDbEnumerator.cs
- EventLogPermissionAttribute.cs
- cookie.cs
- ImageInfo.cs
- Point3DConverter.cs
- CodeNamespaceImportCollection.cs
- OuterGlowBitmapEffect.cs
- XmlCharacterData.cs
- WebReference.cs
- Point3DKeyFrameCollection.cs
- PersonalizationStateInfo.cs
- QueueSurrogate.cs
- CodeDirectiveCollection.cs
- SQLBytesStorage.cs
- XmlNavigatorStack.cs
- DependencyPropertyValueSerializer.cs
- Viewport2DVisual3D.cs
- HtmlTableCellCollection.cs
- CommandLibraryHelper.cs
- FloaterParagraph.cs
- ListItemCollection.cs
- ProtocolInformationWriter.cs
- PeerResolver.cs
- BindValidator.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- MemoryRecordBuffer.cs
- ProxyWebPartConnectionCollection.cs
- CompatibleIComparer.cs
- xdrvalidator.cs
- WebRequestModuleElement.cs
- XmlImplementation.cs
- HtmlTableRowCollection.cs
- ResourceWriter.cs
- SubMenuStyleCollection.cs
- WindowsFormsLinkLabel.cs
- TextBoxDesigner.cs
- CTreeGenerator.cs
- MultiDataTrigger.cs
- ParenthesizePropertyNameAttribute.cs
- CollectionBase.cs
- DataGridViewDataErrorEventArgs.cs
- ResourcesBuildProvider.cs
- ObservableCollection.cs
- _SafeNetHandles.cs
- EnumerableCollectionView.cs
- StringUtil.cs
- SearchForVirtualItemEventArgs.cs
- TableRow.cs
- XmlSchemaAll.cs
- HttpListenerResponse.cs
- SelectionWordBreaker.cs
- AuthorizationSection.cs
- PathGeometry.cs
- PipelineModuleStepContainer.cs
- SafeLibraryHandle.cs
- RangeContentEnumerator.cs
- CodeGeneratorOptions.cs
- MetadataPropertyCollection.cs
- HighlightComponent.cs
- StrokeIntersection.cs
- DesignerLoader.cs
- WorkflowDefinitionDispenser.cs
- FixedSchema.cs
- DataGridColumnHeaderCollection.cs
- SecurityKeyIdentifier.cs
- XmlNotation.cs
- Point4D.cs
- KeyMatchBuilder.cs
- SqlRecordBuffer.cs
- StringUtil.cs
- AutoResizedEvent.cs
- ResumeStoryboard.cs
- safelink.cs
- SingleKeyFrameCollection.cs
- SystemIcmpV6Statistics.cs
- EntityDataSourceReferenceGroup.cs
- HttpListenerContext.cs
- FileSecurity.cs
- RankException.cs
- WebPartRestoreVerb.cs
- XmlDownloadManager.cs
- BoolExpressionVisitors.cs
- SimpleApplicationHost.cs
- Mapping.cs
- ButtonField.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- MarshalByRefObject.cs
- DESCryptoServiceProvider.cs
- MessageEnumerator.cs
- ITreeGenerator.cs
- XmlHierarchicalDataSourceView.cs
- DataMisalignedException.cs