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
- EndPoint.cs
- DataGridViewRowsRemovedEventArgs.cs
- BuildDependencySet.cs
- FatalException.cs
- LocalizabilityAttribute.cs
- CursorConverter.cs
- SoapElementAttribute.cs
- Win32PrintDialog.cs
- TreeIterator.cs
- DrawListViewColumnHeaderEventArgs.cs
- MetadataLocation.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- XPathItem.cs
- ChangeNode.cs
- TrackBarRenderer.cs
- InstancePersistenceCommand.cs
- SerializationStore.cs
- JulianCalendar.cs
- ConfigurationStrings.cs
- Grammar.cs
- XsdCachingReader.cs
- ExecutionEngineException.cs
- ManagementDateTime.cs
- NameTable.cs
- AnnotationAdorner.cs
- ChangePassword.cs
- NotifyInputEventArgs.cs
- EmissiveMaterial.cs
- ScrollItemPattern.cs
- StringComparer.cs
- EncoderExceptionFallback.cs
- ClientSponsor.cs
- ErrorFormatterPage.cs
- Profiler.cs
- LifetimeManager.cs
- KnownTypesHelper.cs
- PropertyGroupDescription.cs
- ImageFormat.cs
- Bitmap.cs
- ArraySegment.cs
- XmlReader.cs
- precedingsibling.cs
- DataGridCellEditEndingEventArgs.cs
- GridViewActionList.cs
- UriSection.cs
- SingleQueryOperator.cs
- ObfuscateAssemblyAttribute.cs
- CurrentChangingEventArgs.cs
- DataColumn.cs
- DataGridState.cs
- ResourceBinder.cs
- BinaryObjectWriter.cs
- ExecutionContext.cs
- KeyMatchBuilder.cs
- SafeNativeMethods.cs
- OdbcRowUpdatingEvent.cs
- ImplicitInputBrush.cs
- FileRecordSequenceCompletedAsyncResult.cs
- XmlSerializationReader.cs
- AuthenticationModeHelper.cs
- PolicyException.cs
- DbConnectionStringBuilder.cs
- AdapterDictionary.cs
- RightsManagementEncryptionTransform.cs
- UrlAuthorizationModule.cs
- CapacityStreamGeometryContext.cs
- PropertyOrder.cs
- LayoutTable.cs
- ReferenceEqualityComparer.cs
- ListItem.cs
- PasswordBoxAutomationPeer.cs
- NumberSubstitution.cs
- jithelpers.cs
- ListSortDescriptionCollection.cs
- StringComparer.cs
- PasswordRecovery.cs
- FamilyMap.cs
- ContentWrapperAttribute.cs
- GlobalizationSection.cs
- AtomContentProperty.cs
- CancelEventArgs.cs
- TimeSpanConverter.cs
- ValidatorUtils.cs
- StringDictionary.cs
- EdmError.cs
- TextBox.cs
- HtmlInputImage.cs
- ListControlDesigner.cs
- BuildProvider.cs
- CompositeControl.cs
- DataTablePropertyDescriptor.cs
- CircleHotSpot.cs
- WebBrowserEvent.cs
- AlignmentXValidation.cs
- Dynamic.cs
- PermissionRequestEvidence.cs
- DiagnosticTrace.cs
- EnumValAlphaComparer.cs
- OleDbException.cs
- HtmlInputControl.cs