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
- StreamResourceInfo.cs
- Subordinate.cs
- UriParserTemplates.cs
- EventLogPermissionAttribute.cs
- HostedTcpTransportManager.cs
- NullableBoolConverter.cs
- OrderedDictionaryStateHelper.cs
- WebException.cs
- DeploymentSectionCache.cs
- OLEDB_Enum.cs
- ConnectionPoolManager.cs
- ToolTipAutomationPeer.cs
- XmlReaderDelegator.cs
- DrawingContextWalker.cs
- CharacterMetrics.cs
- InputQueue.cs
- ReadingWritingEntityEventArgs.cs
- ContainerVisual.cs
- ProtocolsInstallComponent.cs
- SubclassTypeValidator.cs
- Models.cs
- StreamGeometry.cs
- SoapObjectWriter.cs
- NodeLabelEditEvent.cs
- DataKey.cs
- StringCollection.cs
- MarkupCompilePass1.cs
- SqlLiftIndependentRowExpressions.cs
- FtpCachePolicyElement.cs
- ResolveDuplex11AsyncResult.cs
- EventRoute.cs
- DebugView.cs
- ProfileService.cs
- ExpandoObject.cs
- CacheModeValueSerializer.cs
- Brush.cs
- SharedDp.cs
- RoleServiceManager.cs
- ToolStripRenderEventArgs.cs
- DataRowView.cs
- COAUTHINFO.cs
- MeasureData.cs
- Encoder.cs
- SymLanguageType.cs
- ExtendedPropertyInfo.cs
- TabPageDesigner.cs
- RegisteredScript.cs
- RepeatButton.cs
- TreeViewImageKeyConverter.cs
- ContextBase.cs
- TypeDescriptionProviderAttribute.cs
- TripleDES.cs
- SqlVisitor.cs
- IListConverters.cs
- RoamingStoreFileUtility.cs
- WeakReferenceKey.cs
- PackageRelationship.cs
- PostBackOptions.cs
- LayoutSettings.cs
- EntityExpressionVisitor.cs
- ModuleConfigurationInfo.cs
- DeviceContexts.cs
- AuthenticationService.cs
- AncestorChangedEventArgs.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- TranslateTransform.cs
- LocalizationParserHooks.cs
- InstanceDataCollection.cs
- Matrix3DValueSerializer.cs
- ComEventsSink.cs
- GradientBrush.cs
- SqlClientWrapperSmiStream.cs
- SqlUtils.cs
- DataPagerFieldItem.cs
- ProcessProtocolHandler.cs
- KeyValueConfigurationElement.cs
- ECDiffieHellmanCng.cs
- ServiceModelActivationSectionGroup.cs
- Input.cs
- SendActivity.cs
- Permission.cs
- MenuItemCollection.cs
- _UriSyntax.cs
- ImageSourceConverter.cs
- Nodes.cs
- _AutoWebProxyScriptWrapper.cs
- InternalException.cs
- MembershipPasswordException.cs
- CodeExpressionCollection.cs
- StorageModelBuildProvider.cs
- HostedBindingBehavior.cs
- HexParser.cs
- RawStylusInputCustomData.cs
- NonVisualControlAttribute.cs
- ElementHostPropertyMap.cs
- XmlAtomicValue.cs
- PropertyInformationCollection.cs
- ExceptionUtility.cs
- DomNameTable.cs
- FontFamily.cs