Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / EntityDataSourceContainerNameConverter.cs / 3 / EntityDataSourceContainerNameConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //----------------------------------------------------------------------------- using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Web.UI.WebControls; namespace System.Web.UI.Design.WebControls { internal class EntityDataSourceContainerNameConverter : StringConverter { public EntityDataSourceContainerNameConverter() : base() { } public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { // We can only get a list of possible DefaultContainerName values if we have: // (1) Connection string so we can load metadata // Even if this value is set, it may not be possible to actually load the metadata, but at least we can try the lookup if requested EntityDataSource entityDataSource = context.Instance as EntityDataSource; if (entityDataSource != null && !String.IsNullOrEmpty(entityDataSource.ConnectionString)) { ListcontainerNameItems = new EntityDataSourceDesignerHelper(entityDataSource, false /*interactiveMode*/).GetContainerNames(true /*sortResults*/); string[] containers = new string[containerNameItems.Count]; for (int i = 0; i < containerNameItems.Count; i++) { containers[i] = containerNameItems[i].ToString(); } return new StandardValuesCollection(containers); } return null; } public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) { return false; } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //----------------------------------------------------------------------------- using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Web.UI.WebControls; namespace System.Web.UI.Design.WebControls { internal class EntityDataSourceContainerNameConverter : StringConverter { public EntityDataSourceContainerNameConverter() : base() { } public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { // We can only get a list of possible DefaultContainerName values if we have: // (1) Connection string so we can load metadata // Even if this value is set, it may not be possible to actually load the metadata, but at least we can try the lookup if requested EntityDataSource entityDataSource = context.Instance as EntityDataSource; if (entityDataSource != null && !String.IsNullOrEmpty(entityDataSource.ConnectionString)) { ListcontainerNameItems = new EntityDataSourceDesignerHelper(entityDataSource, false /*interactiveMode*/).GetContainerNames(true /*sortResults*/); string[] containers = new string[containerNameItems.Count]; for (int i = 0; i < containerNameItems.Count; i++) { containers[i] = containerNameItems[i].ToString(); } return new StandardValuesCollection(containers); } return null; } public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) { return false; } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DefaultAssemblyResolver.cs
- LinkClickEvent.cs
- ObjectDataSourceView.cs
- DbMetaDataColumnNames.cs
- PagedControl.cs
- TypeCollectionPropertyEditor.cs
- DynamicDocumentPaginator.cs
- IdlingCommunicationPool.cs
- HttpClientCertificate.cs
- sortedlist.cs
- Guid.cs
- AssemblyFilter.cs
- DataListAutoFormat.cs
- FamilyCollection.cs
- TimeSpan.cs
- WS2007FederationHttpBinding.cs
- WindowCollection.cs
- DirectoryInfo.cs
- SynchronizationContext.cs
- PerformanceCounterPermission.cs
- HtmlInputRadioButton.cs
- LongCountAggregationOperator.cs
- UIElement.cs
- SBCSCodePageEncoding.cs
- xmlglyphRunInfo.cs
- KnownBoxes.cs
- VSWCFServiceContractGenerator.cs
- CssTextWriter.cs
- HtmlInputSubmit.cs
- XmlHelper.cs
- Internal.cs
- XmlDataCollection.cs
- WindowsStatic.cs
- HtmlInputText.cs
- BindableTemplateBuilder.cs
- ZipIOBlockManager.cs
- TextEditorContextMenu.cs
- DataControlFieldCollection.cs
- TaskExceptionHolder.cs
- SystemFonts.cs
- StateDesigner.LayoutSelectionGlyph.cs
- XXXOnTypeBuilderInstantiation.cs
- Brushes.cs
- WebPartUserCapability.cs
- WebBrowserSiteBase.cs
- OleDbDataAdapter.cs
- TransactionManager.cs
- Logging.cs
- WebBrowserSiteBase.cs
- StandardToolWindows.cs
- QilParameter.cs
- ListBoxAutomationPeer.cs
- LocatorGroup.cs
- HtmlElementEventArgs.cs
- Misc.cs
- TabPanel.cs
- Convert.cs
- BookmarkScopeManager.cs
- MonitoringDescriptionAttribute.cs
- MimeTypeAttribute.cs
- Pen.cs
- RepeatInfo.cs
- SkipStoryboardToFill.cs
- DesignerCapabilities.cs
- Point.cs
- StrongTypingException.cs
- TreeNodeBindingCollection.cs
- SystemIPAddressInformation.cs
- Serializer.cs
- BaseParser.cs
- RotateTransform3D.cs
- MapPathBasedVirtualPathProvider.cs
- DataSourceSelectArguments.cs
- ValidatorCollection.cs
- Grid.cs
- LeaseManager.cs
- TableColumnCollection.cs
- WebErrorHandler.cs
- ProfileServiceManager.cs
- FamilyMapCollection.cs
- SimplePropertyEntry.cs
- LinearQuaternionKeyFrame.cs
- SchemaHelper.cs
- TextElementEnumerator.cs
- DrawToolTipEventArgs.cs
- RemotingException.cs
- RepeatButton.cs
- DeviceContext.cs
- RandomNumberGenerator.cs
- CompressStream.cs
- RTLAwareMessageBox.cs
- RootProjectionNode.cs
- WindowsTokenRoleProvider.cs
- XPathNavigatorReader.cs
- ZoneLinkButton.cs
- SoapExtensionTypeElement.cs
- EventLogLink.cs
- RequestCachePolicy.cs
- SecurityRuntime.cs
- HandlerFactoryWrapper.cs