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
- ReferentialConstraint.cs
- VisualTreeHelper.cs
- XmlWriterSettings.cs
- XomlCompiler.cs
- CompilationLock.cs
- RedirectionProxy.cs
- JsonReader.cs
- EncoderReplacementFallback.cs
- IChannel.cs
- SiteOfOriginPart.cs
- _ConnectionGroup.cs
- LinearGradientBrush.cs
- NativeMethods.cs
- SByteStorage.cs
- EventNotify.cs
- PtsHost.cs
- MenuItemCollectionEditor.cs
- ScriptResourceAttribute.cs
- OracleTimeSpan.cs
- XNodeValidator.cs
- PasswordPropertyTextAttribute.cs
- XmlTextWriter.cs
- PreDigestedSignedInfo.cs
- ReadOnlyTernaryTree.cs
- ProfileBuildProvider.cs
- GroupLabel.cs
- BasicCellRelation.cs
- OptionalColumn.cs
- CompilationRelaxations.cs
- XPathAncestorQuery.cs
- XPathNodeList.cs
- SynchronizationLockException.cs
- SharedUtils.cs
- SpanIndex.cs
- ZipQueryOperator.cs
- EtwTrackingParticipant.cs
- UpdatePanel.cs
- DefaultSettingsSection.cs
- PageCatalogPart.cs
- MethodAccessException.cs
- Int32Collection.cs
- ProxyWebPartConnectionCollection.cs
- BatchParser.cs
- StructuralComparisons.cs
- DataGridCommandEventArgs.cs
- WebPartMinimizeVerb.cs
- ContentValidator.cs
- TCEAdapterGenerator.cs
- BaseParser.cs
- WebSysDefaultValueAttribute.cs
- ErrorLog.cs
- ContentElementCollection.cs
- DrawTreeNodeEventArgs.cs
- SqlProvider.cs
- DataRowExtensions.cs
- DrawingState.cs
- DLinqAssociationProvider.cs
- StyleBamlRecordReader.cs
- ItemsChangedEventArgs.cs
- MarkupExtensionParser.cs
- Atom10FormatterFactory.cs
- AppDomain.cs
- RequestNavigateEventArgs.cs
- XmlHelper.cs
- TableLayoutStyleCollection.cs
- Win32MouseDevice.cs
- Button.cs
- MulticastOption.cs
- RadioButtonList.cs
- ObjectListField.cs
- IgnoreFlushAndCloseStream.cs
- FlowDocumentPaginator.cs
- GrammarBuilderDictation.cs
- CustomValidator.cs
- DataTableMappingCollection.cs
- MetafileHeaderWmf.cs
- HttpRuntime.cs
- PreservationFileReader.cs
- BitmapInitialize.cs
- CodePropertyReferenceExpression.cs
- XmlTextWriter.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- ToolStripPanelCell.cs
- COSERVERINFO.cs
- HttpHandlersSection.cs
- ListSortDescription.cs
- StorageScalarPropertyMapping.cs
- WebScriptMetadataFormatter.cs
- Camera.cs
- BigInt.cs
- PeerObject.cs
- VirtualDirectoryMapping.cs
- NetworkInformationException.cs
- FilePrompt.cs
- StopRoutingHandler.cs
- ColumnWidthChangedEvent.cs
- WebConfigurationHost.cs
- ScrollBarRenderer.cs
- IgnoreDeviceFilterElementCollection.cs
- PenCursorManager.cs