Code:
/ 4.0 / 4.0 / untmp / 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))
{
List containerNameItems = 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
- MenuItemCollection.cs
- TableLayoutColumnStyleCollection.cs
- ServicesUtilities.cs
- ZipArchive.cs
- TcpHostedTransportConfiguration.cs
- PeerNameResolver.cs
- EntityViewContainer.cs
- SerialErrors.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- ClientSession.cs
- RootBrowserWindowAutomationPeer.cs
- MonthCalendar.cs
- TextDpi.cs
- GridSplitter.cs
- BamlRecordWriter.cs
- RequestCacheValidator.cs
- BCLDebug.cs
- ImageClickEventArgs.cs
- HeaderPanel.cs
- EntityStoreSchemaFilterEntry.cs
- _SslSessionsCache.cs
- WebDisplayNameAttribute.cs
- SqlConnectionStringBuilder.cs
- ArraySortHelper.cs
- TabletDeviceInfo.cs
- XmlSchemaCompilationSettings.cs
- ConsumerConnectionPoint.cs
- SiteMapHierarchicalDataSourceView.cs
- IDataContractSurrogate.cs
- XslNumber.cs
- HtmlToClrEventProxy.cs
- HijriCalendar.cs
- LocalizedNameDescriptionPair.cs
- ArraySubsetEnumerator.cs
- ZipIOBlockManager.cs
- TextRangeAdaptor.cs
- ChangePasswordAutoFormat.cs
- DynamicValidator.cs
- CfgRule.cs
- FixedElement.cs
- Solver.cs
- DataKey.cs
- CodeExpressionCollection.cs
- ClrProviderManifest.cs
- ConfigXmlDocument.cs
- PropertyGridEditorPart.cs
- TreeNodeStyle.cs
- XmlAnyElementAttribute.cs
- EventSourceCreationData.cs
- FactoryId.cs
- QilStrConcat.cs
- AlgoModule.cs
- EncodingInfo.cs
- ThemeInfoAttribute.cs
- ExtenderProvidedPropertyAttribute.cs
- UriExt.cs
- StylusEditingBehavior.cs
- sqlpipe.cs
- XmlSerializerNamespaces.cs
- IItemContainerGenerator.cs
- FrameworkElementFactory.cs
- VarInfo.cs
- WorkflowOperationFault.cs
- PenLineJoinValidation.cs
- BindingMAnagerBase.cs
- CustomCredentialPolicy.cs
- SafeBitVector32.cs
- _BufferOffsetSize.cs
- BamlTreeUpdater.cs
- TemplateKeyConverter.cs
- RangeValuePattern.cs
- __Filters.cs
- XmlNamespaceMappingCollection.cs
- SimplePropertyEntry.cs
- AuthenticationConfig.cs
- QueryCorrelationInitializer.cs
- MimeXmlImporter.cs
- ConfigXmlComment.cs
- XmlSchemaComplexContentRestriction.cs
- Vector3DIndependentAnimationStorage.cs
- ClientRoleProvider.cs
- ZipIOCentralDirectoryFileHeader.cs
- TextPattern.cs
- LinqDataSourceDisposeEventArgs.cs
- ComponentSerializationService.cs
- basecomparevalidator.cs
- BoolLiteral.cs
- _IPv6Address.cs
- DataSourceSelectArguments.cs
- MimeTypeMapper.cs
- DisplayClaim.cs
- WebServiceEndpoint.cs
- AssociationType.cs
- TypeConverter.cs
- TCEAdapterGenerator.cs
- ObjectQuery.cs
- ResourceDictionary.cs
- ConfigXmlAttribute.cs
- DoubleLinkList.cs
- ObjectAnimationUsingKeyFrames.cs