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
- OleDbCommandBuilder.cs
- TrustLevelCollection.cs
- IdentityModelDictionary.cs
- FixedSchema.cs
- IPEndPoint.cs
- RangeValueProviderWrapper.cs
- listitem.cs
- LabelAutomationPeer.cs
- ApplicationServiceManager.cs
- SystemWebCachingSectionGroup.cs
- ClientSession.cs
- CheckedListBox.cs
- VersionValidator.cs
- FaultDesigner.cs
- ConfigurationSection.cs
- ProtectedConfigurationSection.cs
- ResolvedKeyFrameEntry.cs
- MetadataException.cs
- SchemaNames.cs
- LinkArea.cs
- CqlBlock.cs
- DoubleSumAggregationOperator.cs
- util.cs
- XmlNode.cs
- RichTextBoxAutomationPeer.cs
- TextBox.cs
- MultipartIdentifier.cs
- WindowsBrush.cs
- StateRuntime.cs
- handlecollector.cs
- ApplicationContext.cs
- MetadataCache.cs
- HtmlInputCheckBox.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- SystemIPAddressInformation.cs
- SQLResource.cs
- ConfigurationElementCollection.cs
- PageMediaSize.cs
- Propagator.Evaluator.cs
- ReliableChannelFactory.cs
- EntityKey.cs
- PageEventArgs.cs
- XmlHierarchyData.cs
- WebScriptClientGenerator.cs
- DataGridViewCellValidatingEventArgs.cs
- EnumerationRangeValidationUtil.cs
- RadioButton.cs
- WindowsAuthenticationEventArgs.cs
- BinaryMethodMessage.cs
- StoragePropertyMapping.cs
- JapaneseLunisolarCalendar.cs
- Point3DValueSerializer.cs
- CollectionDataContract.cs
- CompositeControl.cs
- DynamicExpression.cs
- Set.cs
- ImagingCache.cs
- HitTestFilterBehavior.cs
- Transform.cs
- XmlAttributes.cs
- EntityViewGenerationConstants.cs
- AtlasWeb.Designer.cs
- WeakKeyDictionary.cs
- DetailsViewDeletedEventArgs.cs
- FutureFactory.cs
- CacheSection.cs
- XmlChildNodes.cs
- CustomErrorCollection.cs
- SEHException.cs
- XmlDataCollection.cs
- IndexedEnumerable.cs
- CacheChildrenQuery.cs
- ClipboardProcessor.cs
- WebPartManager.cs
- XPathDocumentNavigator.cs
- StringValidator.cs
- WorkflowTerminatedException.cs
- Validator.cs
- MasterPageBuildProvider.cs
- BuildProvider.cs
- HtmlPhoneCallAdapter.cs
- DataStreamFromComStream.cs
- TableMethodGenerator.cs
- IsolatedStorageFileStream.cs
- PeerEndPoint.cs
- UpdateDelegates.Generated.cs
- BinaryEditor.cs
- UIPropertyMetadata.cs
- DbException.cs
- XmlDesigner.cs
- Lock.cs
- DynamicDocumentPaginator.cs
- FrameworkPropertyMetadata.cs
- AccessText.cs
- DocumentSchemaValidator.cs
- Input.cs
- InputLanguageManager.cs
- DictionaryEditChange.cs
- MissingMethodException.cs
- parserscommon.cs