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
- TextRange.cs
- TemplateBindingExpressionConverter.cs
- CodeLabeledStatement.cs
- DataGridViewCellStyleConverter.cs
- UnsafeNativeMethods.cs
- TextOptionsInternal.cs
- DrawingContextDrawingContextWalker.cs
- AssemblyAssociatedContentFileAttribute.cs
- RawStylusInputCustomDataList.cs
- DummyDataSource.cs
- ObjectQueryState.cs
- SelectionGlyph.cs
- formatter.cs
- SiteIdentityPermission.cs
- DrawingBrush.cs
- Stackframe.cs
- OleDbWrapper.cs
- DictionaryCustomTypeDescriptor.cs
- PointValueSerializer.cs
- CommandSet.cs
- StickyNoteAnnotations.cs
- DbLambda.cs
- Queue.cs
- ClassHandlersStore.cs
- ImageFormatConverter.cs
- ImageMetadata.cs
- CryptographicAttribute.cs
- SystemUdpStatistics.cs
- KnownBoxes.cs
- StringStorage.cs
- SqlBulkCopyColumnMappingCollection.cs
- SelectedDatesCollection.cs
- DependencyPropertyKey.cs
- TableCell.cs
- TreeNodeEventArgs.cs
- ContainsRowNumberChecker.cs
- XmlnsCache.cs
- MethodExpr.cs
- XmlBinaryReader.cs
- KnowledgeBase.cs
- TextSearch.cs
- StateDesigner.CommentLayoutGlyph.cs
- Qualifier.cs
- Int64Storage.cs
- BufferedGraphicsManager.cs
- XmlStreamNodeWriter.cs
- EmissiveMaterial.cs
- TextBoxAutoCompleteSourceConverter.cs
- ResizeGrip.cs
- MtomMessageEncoder.cs
- DockingAttribute.cs
- BindToObject.cs
- SchemaTypeEmitter.cs
- ConfigXmlElement.cs
- EnumValAlphaComparer.cs
- DataTemplateSelector.cs
- NetworkAddressChange.cs
- ValueUnavailableException.cs
- Visual3D.cs
- ButtonFlatAdapter.cs
- PropertyDescriptorCollection.cs
- NativeMethodsOther.cs
- TemplateInstanceAttribute.cs
- InputScope.cs
- ResourceContainerWrapper.cs
- ECDsaCng.cs
- QualificationDataAttribute.cs
- ContextQuery.cs
- XmlCharCheckingReader.cs
- PartManifestEntry.cs
- IPCCacheManager.cs
- FastPropertyAccessor.cs
- ResourceSetExpression.cs
- HttpSessionStateBase.cs
- WindowHideOrCloseTracker.cs
- XPathNodeIterator.cs
- ClientFormsIdentity.cs
- TrustSection.cs
- ComponentEvent.cs
- UniqueContractNameValidationBehavior.cs
- ActiveXContainer.cs
- ModelItemImpl.cs
- DocumentSchemaValidator.cs
- WindowsTokenRoleProvider.cs
- StaticFileHandler.cs
- ChtmlTextWriter.cs
- EntityParameter.cs
- XmlDictionaryReaderQuotas.cs
- arabicshape.cs
- XmlAnyElementAttribute.cs
- ModelItemExtensions.cs
- WebPartConnectionsEventArgs.cs
- BaseTemplateParser.cs
- XmlAnyAttributeAttribute.cs
- EpmSyndicationContentSerializer.cs
- HtmlControl.cs
- DataGridViewCellMouseEventArgs.cs
- BuildDependencySet.cs
- FontDialog.cs
- DescendantOverDescendantQuery.cs