Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / entitydatasourceentitysetnameconverter.cs / 3 / entitydatasourceentitysetnameconverter.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 EntityDataSourceEntitySetNameConverter : StringConverter { public EntityDataSourceEntitySetNameConverter() : base() { } public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { // We can only get a list of possible EntitySetName values if we have: // (1) Connection string so we can load metadata // (2) DefaultContainerName to give scope to the lookup // Even if these values are set, it may not be possible to actually find them in metadata, but at least we can try the lookup if requested EntityDataSource entityDataSource = context.Instance as EntityDataSource; if (entityDataSource != null && !String.IsNullOrEmpty(entityDataSource.ConnectionString) && !String.IsNullOrEmpty(entityDataSource.DefaultContainerName)) { ListentitySetNameItems = new EntityDataSourceDesignerHelper(entityDataSource, false /*interactiveMode*/).GetEntitySets(entityDataSource.DefaultContainerName); string[] entitySetNames = new string[entitySetNameItems.Count]; for (int i = 0; i < entitySetNameItems.Count; i++) { entitySetNames[i] = entitySetNameItems[i].EntitySetName; } return new StandardValuesCollection(entitySetNames); } 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 EntityDataSourceEntitySetNameConverter : StringConverter { public EntityDataSourceEntitySetNameConverter() : base() { } public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { // We can only get a list of possible EntitySetName values if we have: // (1) Connection string so we can load metadata // (2) DefaultContainerName to give scope to the lookup // Even if these values are set, it may not be possible to actually find them in metadata, but at least we can try the lookup if requested EntityDataSource entityDataSource = context.Instance as EntityDataSource; if (entityDataSource != null && !String.IsNullOrEmpty(entityDataSource.ConnectionString) && !String.IsNullOrEmpty(entityDataSource.DefaultContainerName)) { ListentitySetNameItems = new EntityDataSourceDesignerHelper(entityDataSource, false /*interactiveMode*/).GetEntitySets(entityDataSource.DefaultContainerName); string[] entitySetNames = new string[entitySetNameItems.Count]; for (int i = 0; i < entitySetNameItems.Count; i++) { entitySetNames[i] = entitySetNameItems[i].EntitySetName; } return new StandardValuesCollection(entitySetNames); } 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
- FileDataSourceCache.cs
- Monitor.cs
- XamlFigureLengthSerializer.cs
- AffineTransform3D.cs
- MinMaxParagraphWidth.cs
- SmtpReplyReaderFactory.cs
- Substitution.cs
- ResourceDescriptionAttribute.cs
- SHA384Managed.cs
- MissingMethodException.cs
- querybuilder.cs
- RenderData.cs
- IODescriptionAttribute.cs
- Font.cs
- SecurityElement.cs
- DeviceFiltersSection.cs
- TextParagraphView.cs
- TransactionCache.cs
- QilInvoke.cs
- Vector3DValueSerializer.cs
- Query.cs
- DesignerDataTableBase.cs
- InvalidEnumArgumentException.cs
- NameValuePermission.cs
- HttpListenerContext.cs
- XmlSerializationWriter.cs
- XsltCompileContext.cs
- arabicshape.cs
- GeometryHitTestParameters.cs
- MonitoringDescriptionAttribute.cs
- WorkflowOperationContext.cs
- DelayedRegex.cs
- DataGridViewAdvancedBorderStyle.cs
- AssociationType.cs
- TypefaceMetricsCache.cs
- ListArgumentProvider.cs
- DetailsView.cs
- MetadataSource.cs
- SqlGatherProducedAliases.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- WindowsTreeView.cs
- StorageComplexPropertyMapping.cs
- SqlClientMetaDataCollectionNames.cs
- TogglePattern.cs
- _UncName.cs
- BuildProvidersCompiler.cs
- VisualTreeUtils.cs
- NavigationExpr.cs
- WebPartMenuStyle.cs
- BuildProviderCollection.cs
- Preprocessor.cs
- AppDomainFactory.cs
- WebPartConnectionsEventArgs.cs
- TableAutomationPeer.cs
- ValidateNames.cs
- WorkflowHostingEndpoint.cs
- regiisutil.cs
- WmlValidatorAdapter.cs
- MediaElementAutomationPeer.cs
- Table.cs
- SQLResource.cs
- TextServicesManager.cs
- XamlBrushSerializer.cs
- GridErrorDlg.cs
- PngBitmapEncoder.cs
- TransactionState.cs
- SQLInt16Storage.cs
- DataExpression.cs
- SettingsBase.cs
- Function.cs
- RenderData.cs
- CounterSample.cs
- GlobalizationAssembly.cs
- EntityAdapter.cs
- PropertyMapper.cs
- ResponseStream.cs
- Formatter.cs
- OdbcConnection.cs
- FillBehavior.cs
- SqlDataSourceTableQuery.cs
- RightsManagementEncryptionTransform.cs
- ActivityValidator.cs
- ContentOperations.cs
- ValueSerializerAttribute.cs
- RijndaelManaged.cs
- UIntPtr.cs
- Solver.cs
- DbConnectionFactory.cs
- LineBreak.cs
- CollectionConverter.cs
- FormsAuthenticationConfiguration.cs
- ScrollPattern.cs
- SqlWebEventProvider.cs
- Pair.cs
- FixedSOMFixedBlock.cs
- TransformPattern.cs
- StrokeNode.cs
- DocumentPageView.cs
- IndexerHelper.cs
- MultiSelector.cs