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
- SystemFonts.cs
- TemplateKeyConverter.cs
- MediaPlayerState.cs
- AccessControlList.cs
- OracleBoolean.cs
- ReadContentAsBinaryHelper.cs
- Label.cs
- ProfileProvider.cs
- ContextQuery.cs
- WebBrowserNavigatingEventHandler.cs
- ClientScriptManagerWrapper.cs
- ClientSponsor.cs
- Stopwatch.cs
- oledbconnectionstring.cs
- CreatingCookieEventArgs.cs
- MailMessageEventArgs.cs
- BitmapData.cs
- HtmlInputText.cs
- dataobject.cs
- DBDataPermission.cs
- HandlerBase.cs
- SQLBytesStorage.cs
- DataGridViewCellStateChangedEventArgs.cs
- Propagator.JoinPropagator.cs
- PrintPreviewDialog.cs
- JumpItem.cs
- TextAdaptor.cs
- HtmlLink.cs
- AssemblyHash.cs
- SpellerHighlightLayer.cs
- SafeLibraryHandle.cs
- SchemaNamespaceManager.cs
- Helper.cs
- FileDialog.cs
- PlatformCulture.cs
- HostingEnvironment.cs
- EntryPointNotFoundException.cs
- CompareInfo.cs
- Translator.cs
- SafeCryptoKeyHandle.cs
- XmlTypeAttribute.cs
- ConnectionsZone.cs
- RenderData.cs
- _HTTPDateParse.cs
- NavigationPropertyAccessor.cs
- RuleSetBrowserDialog.cs
- BitmapEffectInput.cs
- TypeConverter.cs
- WebPartCatalogCloseVerb.cs
- FormViewInsertedEventArgs.cs
- Roles.cs
- RoleManagerEventArgs.cs
- ScrollChangedEventArgs.cs
- NullableBoolConverter.cs
- ObsoleteAttribute.cs
- DataGridViewColumnTypePicker.cs
- SrgsToken.cs
- BaseTemplateParser.cs
- UpdateProgress.cs
- DataTableMappingCollection.cs
- AssemblySettingAttributes.cs
- SamlSerializer.cs
- Nodes.cs
- WebPartDisplayModeCancelEventArgs.cs
- UnsafeNativeMethodsTablet.cs
- HideDisabledControlAdapter.cs
- RelatedEnd.cs
- ArrayList.cs
- ListChangedEventArgs.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- RTLAwareMessageBox.cs
- CompressStream.cs
- TypeConverterValueSerializer.cs
- Certificate.cs
- ComponentChangedEvent.cs
- X509Utils.cs
- FirewallWrapper.cs
- DataSource.cs
- FormsAuthenticationModule.cs
- HTMLTextWriter.cs
- SlipBehavior.cs
- ServicePointManager.cs
- ReturnValue.cs
- GridViewItemAutomationPeer.cs
- FastPropertyAccessor.cs
- WindowsIdentity.cs
- ToolStripGrip.cs
- SqlReorderer.cs
- DayRenderEvent.cs
- PointConverter.cs
- TextBoxDesigner.cs
- PageAsyncTask.cs
- TextAnchor.cs
- SqlNode.cs
- ImageConverter.cs
- ReadOnlyTernaryTree.cs
- ClrPerspective.cs
- ProfileParameter.cs
- MasterPageCodeDomTreeGenerator.cs
- Publisher.cs