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
- DocumentXPathNavigator.cs
- Random.cs
- CommandSet.cs
- XPathEmptyIterator.cs
- VisualTarget.cs
- ExtentKey.cs
- SelectionItemPatternIdentifiers.cs
- MULTI_QI.cs
- MachineSettingsSection.cs
- DefaultBinder.cs
- ResourceReferenceKeyNotFoundException.cs
- SqlGatherProducedAliases.cs
- regiisutil.cs
- ValidationService.cs
- XmlIlVisitor.cs
- MemberAssignment.cs
- Misc.cs
- SiteMapNodeItemEventArgs.cs
- DataReaderContainer.cs
- PerspectiveCamera.cs
- updateconfighost.cs
- SequenceFullException.cs
- RemotingSurrogateSelector.cs
- SerializationFieldInfo.cs
- StringResourceManager.cs
- BaseTreeIterator.cs
- WebPartDisplayModeEventArgs.cs
- DynamicPropertyHolder.cs
- TextRunCache.cs
- GridToolTip.cs
- GridViewSortEventArgs.cs
- EFTableProvider.cs
- NameValueConfigurationElement.cs
- PropertyGridView.cs
- _DynamicWinsockMethods.cs
- PolicyValidationException.cs
- XmlCharType.cs
- KnowledgeBase.cs
- ColumnCollection.cs
- SafeCryptoHandles.cs
- GridViewAutomationPeer.cs
- Stylus.cs
- UnauthorizedWebPart.cs
- ZoneLinkButton.cs
- PropertyBuilder.cs
- WizardSideBarListControlItem.cs
- CodeDomConfigurationHandler.cs
- WebZone.cs
- SiteMapDataSourceView.cs
- TextComposition.cs
- ListViewGroupItemCollection.cs
- XmlSerializableServices.cs
- ScopelessEnumAttribute.cs
- TreeNode.cs
- Line.cs
- EncodingDataItem.cs
- XmlHierarchyData.cs
- UTF8Encoding.cs
- FileAuthorizationModule.cs
- CodeCompiler.cs
- DrawingGroup.cs
- MatrixTransform3D.cs
- RecognizedAudio.cs
- BitmapCacheBrush.cs
- Rotation3DAnimationBase.cs
- ByteFacetDescriptionElement.cs
- XmlSchemaImport.cs
- SecurityContextSecurityTokenAuthenticator.cs
- ProfileModule.cs
- XmlName.cs
- Version.cs
- SoapObjectInfo.cs
- DependencyProperty.cs
- CalendarDataBindingHandler.cs
- VisualCollection.cs
- ConnectionManagementElement.cs
- ExtensionSurface.cs
- ToolBarOverflowPanel.cs
- XmlSchemaImport.cs
- SqlDataReaderSmi.cs
- AuthorizationPolicyTypeElementCollection.cs
- SqlNodeTypeOperators.cs
- PrePrepareMethodAttribute.cs
- versioninfo.cs
- InputLanguageEventArgs.cs
- CompilationSection.cs
- ThreadSafeList.cs
- PinnedBufferMemoryStream.cs
- XmlSchemaAnyAttribute.cs
- TextModifier.cs
- SecondaryIndexList.cs
- ExpressionConverter.cs
- ThreadStateException.cs
- ToolboxSnapDragDropEventArgs.cs
- LogicalTreeHelper.cs
- DependencySource.cs
- Calendar.cs
- WeakEventManager.cs
- ToolBarButton.cs
- ConstraintManager.cs