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
- ItemChangedEventArgs.cs
- CommandEventArgs.cs
- AttributeUsageAttribute.cs
- ExceptionNotification.cs
- QueryOutputWriterV1.cs
- ContentElement.cs
- ListBoxItemWrapperAutomationPeer.cs
- CollaborationHelperFunctions.cs
- SmtpMail.cs
- HttpModuleActionCollection.cs
- OneOfScalarConst.cs
- SuppressMessageAttribute.cs
- TreeNodeStyle.cs
- DBConcurrencyException.cs
- CultureInfoConverter.cs
- KeyedHashAlgorithm.cs
- LambdaSerializationException.cs
- EraserBehavior.cs
- AppDomainFactory.cs
- DataError.cs
- KnownColorTable.cs
- IgnoreSectionHandler.cs
- ScrollBar.cs
- WinFormsUtils.cs
- IRCollection.cs
- VirtualizedContainerService.cs
- OleDbPermission.cs
- Query.cs
- MediaPlayer.cs
- Normalization.cs
- RelatedCurrencyManager.cs
- Operand.cs
- OuterGlowBitmapEffect.cs
- Error.cs
- ColorBlend.cs
- ValidateNames.cs
- XmlValueConverter.cs
- EntryWrittenEventArgs.cs
- OlePropertyStructs.cs
- ScriptComponentDescriptor.cs
- oledbmetadatacolumnnames.cs
- SessionStateContainer.cs
- PropagatorResult.cs
- DBPropSet.cs
- ToolboxItemCollection.cs
- Model3DGroup.cs
- RewritingSimplifier.cs
- QuadraticEase.cs
- DefaultHttpHandler.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- StickyNoteContentControl.cs
- HttpWebResponse.cs
- EndpointReference.cs
- StrongNameIdentityPermission.cs
- TraceSwitch.cs
- TextEncodedRawTextWriter.cs
- InputGestureCollection.cs
- SubstitutionResponseElement.cs
- MimeXmlImporter.cs
- Validator.cs
- SpoolingTaskBase.cs
- Encoder.cs
- WebPart.cs
- NamedPermissionSet.cs
- MediaElement.cs
- SqlDataSourceFilteringEventArgs.cs
- BindStream.cs
- MessageAction.cs
- EmptyElement.cs
- FileSystemWatcher.cs
- LogExtent.cs
- AppDomainFactory.cs
- Vector3DAnimationUsingKeyFrames.cs
- columnmapkeybuilder.cs
- WebPartDeleteVerb.cs
- DbConnectionPoolIdentity.cs
- PhysicalAddress.cs
- EncryptedHeader.cs
- ContextBase.cs
- WsatTransactionHeader.cs
- SQLDouble.cs
- EdmMember.cs
- TreeWalker.cs
- FontCacheLogic.cs
- DBConcurrencyException.cs
- Separator.cs
- OleDbPropertySetGuid.cs
- TreeWalker.cs
- ReflectionTypeLoadException.cs
- OdbcRowUpdatingEvent.cs
- IMembershipProvider.cs
- XmlNodeChangedEventManager.cs
- UDPClient.cs
- DataGridViewCellStyleConverter.cs
- PathTooLongException.cs
- UnsafeNativeMethods.cs
- SerializationHelper.cs
- DataStreams.cs
- IISMapPath.cs
- ComponentRenameEvent.cs