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
- DataGridTablesFactory.cs
- TypeConstant.cs
- Cloud.cs
- TemplateControl.cs
- SqlReorderer.cs
- InteropEnvironment.cs
- ImpersonateTokenRef.cs
- XmlSerializer.cs
- FormViewUpdateEventArgs.cs
- SourceChangedEventArgs.cs
- MetaColumn.cs
- ObjectPropertyMapping.cs
- TreeViewItemAutomationPeer.cs
- PageSetupDialog.cs
- ValidatorCollection.cs
- RewritingPass.cs
- TransformConverter.cs
- WmpBitmapEncoder.cs
- UserControl.cs
- ArrangedElementCollection.cs
- CacheOutputQuery.cs
- SourceCollection.cs
- IndexOutOfRangeException.cs
- XmlCodeExporter.cs
- SafeTokenHandle.cs
- CaseInsensitiveOrdinalStringComparer.cs
- DocumentAutomationPeer.cs
- IconBitmapDecoder.cs
- UInt32Storage.cs
- HttpBindingExtension.cs
- SplitterDesigner.cs
- ToolStripSeparator.cs
- OracleDateTime.cs
- MetadataFile.cs
- LinqDataSourceStatusEventArgs.cs
- BamlStream.cs
- ReadOnlyHierarchicalDataSource.cs
- TransformationRules.cs
- DetailsViewRowCollection.cs
- ExpressionList.cs
- HostUtils.cs
- StrongNameMembershipCondition.cs
- basenumberconverter.cs
- MultiBindingExpression.cs
- SqlBulkCopyColumnMapping.cs
- basevalidator.cs
- IntSecurity.cs
- HttpResponseHeader.cs
- RegisteredHiddenField.cs
- ProviderUtil.cs
- PointHitTestParameters.cs
- ClientEventManager.cs
- AnnotationResourceChangedEventArgs.cs
- XmlEncoding.cs
- messageonlyhwndwrapper.cs
- OuterProxyWrapper.cs
- SQLMoney.cs
- CodePageEncoding.cs
- TemplateControl.cs
- _LocalDataStoreMgr.cs
- HtmlSelect.cs
- IntegerValidatorAttribute.cs
- ThemeableAttribute.cs
- ReaderContextStackData.cs
- SecurityException.cs
- CommandField.cs
- Types.cs
- BooleanStorage.cs
- RuleEngine.cs
- Transform.cs
- XmlBaseWriter.cs
- CatchBlock.cs
- MatrixTransform.cs
- Axis.cs
- ClaimComparer.cs
- ProfileGroupSettings.cs
- LocalizationParserHooks.cs
- MailDefinition.cs
- CharStorage.cs
- CheckBoxRenderer.cs
- DataSourceCacheDurationConverter.cs
- BamlVersionHeader.cs
- CommonBehaviorsSection.cs
- SafePointer.cs
- NonPrimarySelectionGlyph.cs
- Claim.cs
- XmlArrayItemAttribute.cs
- ObjectSet.cs
- OleDbWrapper.cs
- ContentPresenter.cs
- Identifier.cs
- PropertyHelper.cs
- BCryptHashAlgorithm.cs
- Convert.cs
- EntityModelSchemaGenerator.cs
- AttributeQuery.cs
- URI.cs
- ObjectTokenCategory.cs
- GAC.cs
- BuildDependencySet.cs