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
- ApplicationServiceHelper.cs
- DoubleConverter.cs
- ProjectedSlot.cs
- externdll.cs
- TypeToArgumentTypeConverter.cs
- ManualResetEvent.cs
- SelectingProviderEventArgs.cs
- ObjectItemAssemblyLoader.cs
- HtmlString.cs
- XamlToRtfParser.cs
- XmlSiteMapProvider.cs
- ProjectionCamera.cs
- safex509handles.cs
- _RequestCacheProtocol.cs
- WebPartConnectionsCancelVerb.cs
- XPathExpr.cs
- TextMarkerSource.cs
- CompiledQuery.cs
- Update.cs
- EditingCommands.cs
- FlowLayoutPanel.cs
- ObjectItemAssemblyLoader.cs
- GlobalEventManager.cs
- Simplifier.cs
- DeploymentSectionCache.cs
- DrawingGroup.cs
- DurableInstanceManager.cs
- OdbcEnvironmentHandle.cs
- ObsoleteAttribute.cs
- TdsParserSafeHandles.cs
- XmlFormatExtensionAttribute.cs
- TextTabProperties.cs
- SplitterEvent.cs
- RoleManagerModule.cs
- Timer.cs
- Stack.cs
- AssemblyNameProxy.cs
- ReachPageContentSerializerAsync.cs
- ServiceContractGenerationContext.cs
- MouseWheelEventArgs.cs
- PartManifestEntry.cs
- IdentityManager.cs
- FormatSettings.cs
- Geometry.cs
- QilGeneratorEnv.cs
- LayoutExceptionEventArgs.cs
- NamespaceEmitter.cs
- QilReplaceVisitor.cs
- DbParameterHelper.cs
- XamlNamespaceHelper.cs
- WebPartEditorCancelVerb.cs
- XmlIgnoreAttribute.cs
- XmlDocument.cs
- DataGridCaption.cs
- AspCompat.cs
- ManagedIStream.cs
- DrawingContext.cs
- Exception.cs
- SymDocumentType.cs
- EventEntry.cs
- PolyQuadraticBezierSegment.cs
- SafeFileMappingHandle.cs
- PagerSettings.cs
- UnmanagedMemoryStreamWrapper.cs
- SourceFileInfo.cs
- Renderer.cs
- CfgRule.cs
- UInt32Converter.cs
- COAUTHIDENTITY.cs
- CodeCatchClause.cs
- AttachedProperty.cs
- WindowsClientCredential.cs
- IResourceProvider.cs
- TransformCollection.cs
- IndexerHelper.cs
- ChangeTracker.cs
- TransformerConfigurationWizardBase.cs
- WebEventCodes.cs
- VSWCFServiceContractGenerator.cs
- EnumerableRowCollection.cs
- SmtpSection.cs
- WmpBitmapDecoder.cs
- TextWriter.cs
- Viewport2DVisual3D.cs
- OracleColumn.cs
- PropertyMetadata.cs
- WindowsListViewGroupSubsetLink.cs
- ConnectionManagementElementCollection.cs
- BitmapEffectrendercontext.cs
- SafeFileHandle.cs
- MemoryPressure.cs
- Facet.cs
- SynchronousChannel.cs
- NullEntityWrapper.cs
- LocalizationComments.cs
- TdsParserSessionPool.cs
- CodeTypeReferenceExpression.cs
- UnsafeNativeMethods.cs
- SortExpressionBuilder.cs
- SqlRowUpdatingEvent.cs