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
- SendingRequestEventArgs.cs
- DbConnectionStringBuilder.cs
- PackageStore.cs
- OneToOneMappingSerializer.cs
- ToolStripOverflowButton.cs
- StyleTypedPropertyAttribute.cs
- HierarchicalDataBoundControl.cs
- WorkflowServiceNamespace.cs
- XmlDataLoader.cs
- SafeFindHandle.cs
- DataServiceBuildProvider.cs
- UmAlQuraCalendar.cs
- FtpRequestCacheValidator.cs
- SystemMulticastIPAddressInformation.cs
- QueryCacheKey.cs
- PropertyGridView.cs
- ProxyWebPartConnectionCollection.cs
- StructuredTypeEmitter.cs
- HttpResponse.cs
- DocumentOrderQuery.cs
- EdmSchemaError.cs
- TextEditorCopyPaste.cs
- Decoder.cs
- SpecialFolderEnumConverter.cs
- GorillaCodec.cs
- StrongNameKeyPair.cs
- IPGlobalProperties.cs
- BrowserCapabilitiesFactory35.cs
- SQLInt64.cs
- DataGridViewRowsRemovedEventArgs.cs
- ConfigurationValidatorBase.cs
- NameService.cs
- EntityParameterCollection.cs
- AutomationPropertyInfo.cs
- MenuAdapter.cs
- HuffModule.cs
- ItemsPresenter.cs
- EUCJPEncoding.cs
- RowSpanVector.cs
- WebScriptMetadataMessageEncoderFactory.cs
- PropertyDescriptorCollection.cs
- HtmlTextArea.cs
- ControlDesignerState.cs
- DomainLiteralReader.cs
- DateTimeAutomationPeer.cs
- TypeExtensions.cs
- XmlSchemaImport.cs
- BaseProcessor.cs
- LightweightCodeGenerator.cs
- NullEntityWrapper.cs
- ParserOptions.cs
- CustomBindingElement.cs
- ListGeneralPage.cs
- SaveFileDialog.cs
- ColumnBinding.cs
- CapiSymmetricAlgorithm.cs
- SequentialWorkflowHeaderFooter.cs
- RoleGroup.cs
- TogglePattern.cs
- DataGridClipboardHelper.cs
- ArgumentException.cs
- XmlMtomReader.cs
- TypeExtensions.cs
- ResourcePool.cs
- AssociationTypeEmitter.cs
- NavigatorOutput.cs
- CodeTryCatchFinallyStatement.cs
- RightNameExpirationInfoPair.cs
- ListDictionaryInternal.cs
- DataGridPageChangedEventArgs.cs
- TemplateColumn.cs
- StringUtil.cs
- ColumnPropertiesGroup.cs
- IIS7WorkerRequest.cs
- LocatorBase.cs
- Rule.cs
- HttpRequestCacheValidator.cs
- PropertyMap.cs
- ClientScriptItemCollection.cs
- PropertyConverter.cs
- AppDomainCompilerProxy.cs
- TaskHelper.cs
- SimpleWorkerRequest.cs
- XmlHelper.cs
- StylusPointPropertyUnit.cs
- ExecutionEngineException.cs
- TextServicesHost.cs
- QueryTreeBuilder.cs
- coordinatorscratchpad.cs
- TreeViewItemAutomationPeer.cs
- SystemMulticastIPAddressInformation.cs
- TextRangeEditTables.cs
- HostedTransportConfigurationBase.cs
- TextBoxBase.cs
- UnSafeCharBuffer.cs
- SerializableAttribute.cs
- XmlSerializerAssemblyAttribute.cs
- ComponentConverter.cs
- DiagnosticSection.cs
- ParsedAttributeCollection.cs