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
- HexParser.cs
- SystemResourceKey.cs
- SHA512Managed.cs
- StatusBar.cs
- EntityFrameworkVersions.cs
- BroadcastEventHelper.cs
- CodeCatchClauseCollection.cs
- CompositeDuplexBindingElement.cs
- PersistChildrenAttribute.cs
- GeometryCollection.cs
- Vector3dCollection.cs
- XmlILTrace.cs
- StickyNoteAnnotations.cs
- WebUtil.cs
- GenericsNotImplementedException.cs
- ComPlusServiceLoader.cs
- RsaElement.cs
- AffineTransform3D.cs
- CharConverter.cs
- DmlSqlGenerator.cs
- RegexBoyerMoore.cs
- ContentAlignmentEditor.cs
- CodeDelegateInvokeExpression.cs
- MessageVersionConverter.cs
- WeakReference.cs
- RtType.cs
- Function.cs
- DataReaderContainer.cs
- ObjectRef.cs
- ParameterCollection.cs
- MetadataArtifactLoaderResource.cs
- LicenseProviderAttribute.cs
- TraceHandler.cs
- SID.cs
- EdmPropertyAttribute.cs
- ParameterModifier.cs
- WindowsButton.cs
- DrawingVisual.cs
- VideoDrawing.cs
- SecurityHeaderElementInferenceEngine.cs
- HostProtectionPermission.cs
- DataColumnMappingCollection.cs
- SqlDeflator.cs
- AsyncOperationManager.cs
- ResourceReferenceExpressionConverter.cs
- CssStyleCollection.cs
- DocumentOrderComparer.cs
- GenericEnumerator.cs
- ObjectQueryProvider.cs
- MouseEventArgs.cs
- BamlLocalizer.cs
- HostVisual.cs
- ArgumentValidation.cs
- XmlSchemaComplexType.cs
- QueryCursorEventArgs.cs
- ToolStripDropTargetManager.cs
- PersonalizationProviderCollection.cs
- PrefixHandle.cs
- ToolBarButton.cs
- DBConnectionString.cs
- PropertyInfo.cs
- Model3DCollection.cs
- SqlCacheDependencySection.cs
- TemplateEditingVerb.cs
- NativeWrapper.cs
- SynchronizationValidator.cs
- StateManagedCollection.cs
- BaseParaClient.cs
- TextFormatterHost.cs
- TextEditorCopyPaste.cs
- ClientScriptManager.cs
- _NTAuthentication.cs
- compensatingcollection.cs
- BindingBase.cs
- GroupBox.cs
- WebRequestModulesSection.cs
- LinkArea.cs
- SimpleRecyclingCache.cs
- FacetEnabledSchemaElement.cs
- DataGridToolTip.cs
- DoWorkEventArgs.cs
- RequiredAttributeAttribute.cs
- GenericTextProperties.cs
- StrokeCollection2.cs
- HttpRawResponse.cs
- Expander.cs
- JournalEntryListConverter.cs
- RpcResponse.cs
- DataRelation.cs
- AlphaSortedEnumConverter.cs
- Point.cs
- WizardPanel.cs
- TextTabProperties.cs
- ClientEventManager.cs
- ButtonStandardAdapter.cs
- Listbox.cs
- CellPartitioner.cs
- ExpressionBindings.cs
- DummyDataSource.cs
- UnhandledExceptionEventArgs.cs