Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ControllableStoryboardAction.cs
- ContextQuery.cs
- TextServicesContext.cs
- IdleTimeoutMonitor.cs
- FontFamilyIdentifier.cs
- IERequestCache.cs
- OracleRowUpdatedEventArgs.cs
- UnsafeNativeMethods.cs
- MultipleViewProviderWrapper.cs
- XmlSubtreeReader.cs
- counter.cs
- PrivateFontCollection.cs
- ResetableIterator.cs
- MailHeaderInfo.cs
- InstancePersistence.cs
- SafeFileMapViewHandle.cs
- DocumentReferenceCollection.cs
- OutputCacheProfile.cs
- TogglePattern.cs
- WindowsSecurityToken.cs
- GlyphElement.cs
- PriorityQueue.cs
- SuppressMessageAttribute.cs
- BaseInfoTable.cs
- DataServiceRequestException.cs
- peernodeimplementation.cs
- BuilderElements.cs
- EventsTab.cs
- SecurityTokenAuthenticator.cs
- ExtendedProperty.cs
- WmlCommandAdapter.cs
- LifetimeServices.cs
- WebPartMenuStyle.cs
- ByteStreamMessageUtility.cs
- BatchWriter.cs
- UndoEngine.cs
- MemberInfoSerializationHolder.cs
- diagnosticsswitches.cs
- DetailsViewCommandEventArgs.cs
- InvariantComparer.cs
- CheckBoxRenderer.cs
- Walker.cs
- Bezier.cs
- XmlAttributeProperties.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- CodePropertyReferenceExpression.cs
- Range.cs
- XmlAtomicValue.cs
- HttpContext.cs
- MimeTextImporter.cs
- TypeBuilder.cs
- ExtensionElement.cs
- ChangeProcessor.cs
- ServiceObjectContainer.cs
- MulticastNotSupportedException.cs
- MessageSmuggler.cs
- Substitution.cs
- RtType.cs
- HtmlTableCellCollection.cs
- PlanCompiler.cs
- CacheDependency.cs
- sqlstateclientmanager.cs
- ErrorFormatter.cs
- ASCIIEncoding.cs
- Debugger.cs
- XComponentModel.cs
- WindowsFormsSectionHandler.cs
- RtfToken.cs
- DropShadowBitmapEffect.cs
- CanonicalFormWriter.cs
- CodeSubDirectoriesCollection.cs
- MediaSystem.cs
- TemplateControlParser.cs
- DataGridViewElement.cs
- WaveHeader.cs
- TextParaLineResult.cs
- DiagnosticStrings.cs
- AutomationPatternInfo.cs
- WebResourceAttribute.cs
- StoreItemCollection.Loader.cs
- TaiwanLunisolarCalendar.cs
- AnnotationService.cs
- XsltException.cs
- HttpServerVarsCollection.cs
- SqlDataSourceEnumerator.cs
- SQLInt32.cs
- ImageClickEventArgs.cs
- FixedBufferAttribute.cs
- AnnotationResource.cs
- CodeMemberEvent.cs
- CompilerScopeManager.cs
- DataBinder.cs
- SoapSchemaImporter.cs
- BitmapSource.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- XmlSchemaObjectCollection.cs
- Canvas.cs
- UrlMappingCollection.cs
- OLEDB_Util.cs
- MemoryFailPoint.cs