Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / EntityDataSourceContainerNameConverter.cs / 1305376 / 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
- DataGridViewControlCollection.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- oledbconnectionstring.cs
- PointConverter.cs
- InfoCardSymmetricCrypto.cs
- UriTemplateEquivalenceComparer.cs
- HostedAspNetEnvironment.cs
- TableDetailsCollection.cs
- ResourceReader.cs
- Int32RectConverter.cs
- TextureBrush.cs
- TraceUtils.cs
- PnrpPermission.cs
- CodeDomConfigurationHandler.cs
- XmlWellformedWriter.cs
- JulianCalendar.cs
- MetafileEditor.cs
- EventLogger.cs
- ChangeBlockUndoRecord.cs
- MemoryPressure.cs
- TraceLevelHelper.cs
- TriggerBase.cs
- WpfGeneratedKnownTypes.cs
- OdbcConnection.cs
- DocumentGridPage.cs
- MailMessageEventArgs.cs
- XmlSerializationReader.cs
- OdbcConnectionString.cs
- SurrogateEncoder.cs
- BinaryParser.cs
- Comparer.cs
- Keywords.cs
- DataGridViewTextBoxColumn.cs
- HtmlGenericControl.cs
- DocumentSchemaValidator.cs
- IpcPort.cs
- RightsManagementPermission.cs
- SystemKeyConverter.cs
- FormParameter.cs
- RegularExpressionValidator.cs
- SurrogateSelector.cs
- TemplateKey.cs
- PartitionedDataSource.cs
- ProfileEventArgs.cs
- QueryOptionExpression.cs
- CustomMenuItemCollection.cs
- DataListCommandEventArgs.cs
- ConfigXmlElement.cs
- RegexWorker.cs
- File.cs
- TabItem.cs
- AppDomainUnloadedException.cs
- ResourceReader.cs
- KnownTypeAttribute.cs
- GridViewRowCollection.cs
- NonBatchDirectoryCompiler.cs
- RTLAwareMessageBox.cs
- PaperSource.cs
- FilteredDataSetHelper.cs
- BaseConfigurationRecord.cs
- CalendarTable.cs
- EntityStoreSchemaGenerator.cs
- DisplayNameAttribute.cs
- Popup.cs
- LoginAutoFormat.cs
- AuthenticatedStream.cs
- LineServicesRun.cs
- UIElementHelper.cs
- CodePropertyReferenceExpression.cs
- XmlWrappingReader.cs
- BamlTreeMap.cs
- Models.cs
- Attributes.cs
- TypeElement.cs
- bidPrivateBase.cs
- ListBox.cs
- TextBoxRenderer.cs
- ListViewInsertedEventArgs.cs
- NavigationFailedEventArgs.cs
- SystemResourceKey.cs
- StorageEndPropertyMapping.cs
- ColumnHeaderConverter.cs
- RegexFCD.cs
- ZoneMembershipCondition.cs
- ZoomPercentageConverter.cs
- CodeDirectoryCompiler.cs
- ThicknessKeyFrameCollection.cs
- NullableDecimalSumAggregationOperator.cs
- NativeRightsManagementAPIsStructures.cs
- TextAnchor.cs
- ProcessModelSection.cs
- CodeDOMProvider.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- ResourceSet.cs
- XmlElement.cs
- Environment.cs
- AliasedSlot.cs
- OdbcEnvironmentHandle.cs
- DbConnectionHelper.cs
- SystemPens.cs