Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / entitydatasourceentitysetnameconverter.cs / 1305376 / 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
- RoutedEvent.cs
- NetCodeGroup.cs
- WebServiceEnumData.cs
- SafeNativeMemoryHandle.cs
- SlipBehavior.cs
- DataControlButton.cs
- WebBrowsableAttribute.cs
- PassportIdentity.cs
- HttpClientCertificate.cs
- TabPanel.cs
- SimpleColumnProvider.cs
- ConnectionStringsExpressionEditor.cs
- WinFormsComponentEditor.cs
- SynchronizationLockException.cs
- SchemaLookupTable.cs
- RectangleHotSpot.cs
- KeyFrames.cs
- WmpBitmapDecoder.cs
- ClientEventManager.cs
- WebHttpSecurity.cs
- TextRangeBase.cs
- ExpressionNormalizer.cs
- AssemblyCache.cs
- StructuredTypeEmitter.cs
- DocComment.cs
- WSSecurityPolicy12.cs
- ChainedAsyncResult.cs
- ProfessionalColorTable.cs
- OperationPickerDialog.designer.cs
- HTTP_SERVICE_CONFIG_URLACL_PARAM.cs
- SessionEndingCancelEventArgs.cs
- WebZone.cs
- HtmlButton.cs
- OutputCacheProfileCollection.cs
- QueryReaderSettings.cs
- DocumentSequenceHighlightLayer.cs
- ComplusTypeValidator.cs
- AsyncContentLoadedEventArgs.cs
- HandleExceptionArgs.cs
- ACL.cs
- ConnectionManagementElementCollection.cs
- AliasGenerator.cs
- TimeManager.cs
- ReadOnlyPropertyMetadata.cs
- SettingsPropertyCollection.cs
- HttpRequest.cs
- HitTestWithGeometryDrawingContextWalker.cs
- ChannelDispatcherCollection.cs
- SizeLimitedCache.cs
- ValueSerializer.cs
- NumericUpDownAccelerationCollection.cs
- ResourceType.cs
- UriSection.cs
- BatchServiceHost.cs
- TextModifier.cs
- ListBoxChrome.cs
- CaseInsensitiveHashCodeProvider.cs
- CustomAttribute.cs
- ProfileService.cs
- DbUpdateCommandTree.cs
- QilTernary.cs
- VideoDrawing.cs
- CodeDomSerializer.cs
- HTTPNotFoundHandler.cs
- FixedBufferAttribute.cs
- Normalization.cs
- MailSettingsSection.cs
- ACE.cs
- WebControl.cs
- SqlDataSourceCustomCommandEditor.cs
- FontDialog.cs
- MemberInfoSerializationHolder.cs
- OleDbDataAdapter.cs
- SynchronizationContext.cs
- SecurityKeyIdentifierClause.cs
- EntityDataSourceContainerNameItem.cs
- XamlVector3DCollectionSerializer.cs
- DataGridTablesFactory.cs
- DbInsertCommandTree.cs
- DataBoundControlAdapter.cs
- UInt64.cs
- TemplatedMailWebEventProvider.cs
- Clipboard.cs
- SearchForVirtualItemEventArgs.cs
- Variant.cs
- SharedStatics.cs
- Camera.cs
- TextEndOfParagraph.cs
- DBNull.cs
- WsatConfiguration.cs
- ItemsPanelTemplate.cs
- RelationshipEnd.cs
- DesignParameter.cs
- ConfigurationValidatorAttribute.cs
- DbMetaDataColumnNames.cs
- SmtpFailedRecipientsException.cs
- XamlBrushSerializer.cs
- PieceDirectory.cs
- _NetworkingPerfCounters.cs
- DataServiceRequestOfT.cs