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
- StorageAssociationSetMapping.cs
- Preprocessor.cs
- ObsoleteAttribute.cs
- WorkflowCreationContext.cs
- ScriptingScriptResourceHandlerSection.cs
- MimePart.cs
- Animatable.cs
- PrintPreviewGraphics.cs
- PageCodeDomTreeGenerator.cs
- _DigestClient.cs
- EncodingNLS.cs
- CalendarDataBindingHandler.cs
- Internal.cs
- BufferModesCollection.cs
- SequenceQuery.cs
- TablePatternIdentifiers.cs
- EdmItemError.cs
- XmlSchemaAnyAttribute.cs
- ControllableStoryboardAction.cs
- HashCodeCombiner.cs
- ReaderWriterLockWrapper.cs
- XamlRtfConverter.cs
- SoapAttributeAttribute.cs
- ProviderUtil.cs
- IISUnsafeMethods.cs
- RIPEMD160.cs
- PersonalizationAdministration.cs
- OptimalBreakSession.cs
- DelegateSerializationHolder.cs
- SemanticAnalyzer.cs
- TargetFrameworkUtil.cs
- EventEntry.cs
- BindingCollection.cs
- SelectionProviderWrapper.cs
- DrawingContextWalker.cs
- StaticDataManager.cs
- GroupLabel.cs
- ModulesEntry.cs
- MDIWindowDialog.cs
- DataServiceQueryProvider.cs
- PersonalizationStateInfoCollection.cs
- QueryServiceConfigHandle.cs
- CannotUnloadAppDomainException.cs
- EntityCommandCompilationException.cs
- EntityContainer.cs
- ToolStripDropDownClosingEventArgs.cs
- MarshalByValueComponent.cs
- HtmlUtf8RawTextWriter.cs
- PrincipalPermissionMode.cs
- ValidateNames.cs
- AttributeAction.cs
- DataGrid.cs
- SafeCoTaskMem.cs
- DurationConverter.cs
- SqlServices.cs
- SecurityAttributeGenerationHelper.cs
- InvokeBase.cs
- ArraySet.cs
- TailPinnedEventArgs.cs
- TextControl.cs
- AlphabeticalEnumConverter.cs
- GetPageCompletedEventArgs.cs
- SecurityChannelFactory.cs
- NamedObject.cs
- DataContext.cs
- IERequestCache.cs
- LayoutTable.cs
- DeploymentSection.cs
- HierarchicalDataSourceControl.cs
- TextFormatterImp.cs
- ObjectReaderCompiler.cs
- Compiler.cs
- _Rfc2616CacheValidators.cs
- UrlMappingCollection.cs
- TextSyndicationContent.cs
- ValueSerializer.cs
- RegistryKey.cs
- WindowsMenu.cs
- CorruptingExceptionCommon.cs
- PipeStream.cs
- OdbcException.cs
- XmlBinaryReader.cs
- EffectiveValueEntry.cs
- FilterElement.cs
- SourceChangedEventArgs.cs
- EntityDataSourceWrapperCollection.cs
- RawStylusActions.cs
- DispatchWrapper.cs
- UnSafeCharBuffer.cs
- StringUtil.cs
- Token.cs
- ColorAnimation.cs
- StyleXamlParser.cs
- DataSourceHelper.cs
- ComboBoxItem.cs
- BoundPropertyEntry.cs
- ClientViaElement.cs
- UrlUtility.cs
- DateTime.cs
- GenerateTemporaryTargetAssembly.cs