Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / EntityDataSourceEntityTypeFilterConverter.cs / 1305376 / EntityDataSourceEntityTypeFilterConverter.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 EntityDataSourceEntityTypeFilterConverter : StringConverter { public EntityDataSourceEntityTypeFilterConverter() : base() { } public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { // We can only get a list of possible EntityTypeFilter values if we have: // (1) Connection string so we can load metadata // (2) DefaultContainerName to give scope to the lookup // (3) EntitySetName that exists in DefaultContainerName so we can get its type and derived types // 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) && !String.IsNullOrEmpty(entityDataSource.EntitySetName)) { ListentityTypeFilterItems = new EntityDataSourceDesignerHelper(entityDataSource, false /*interactiveMode*/).GetEntityTypeFilters( entityDataSource.DefaultContainerName, entityDataSource.EntitySetName); string[] entityTypeFilters = new string[entityTypeFilterItems.Count]; for (int i = 0; i < entityTypeFilterItems.Count; i++) { entityTypeFilters[i] = entityTypeFilterItems[i].EntityTypeName; } return new StandardValuesCollection(entityTypeFilters); } 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 EntityDataSourceEntityTypeFilterConverter : StringConverter { public EntityDataSourceEntityTypeFilterConverter() : base() { } public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { // We can only get a list of possible EntityTypeFilter values if we have: // (1) Connection string so we can load metadata // (2) DefaultContainerName to give scope to the lookup // (3) EntitySetName that exists in DefaultContainerName so we can get its type and derived types // 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) && !String.IsNullOrEmpty(entityDataSource.EntitySetName)) { ListentityTypeFilterItems = new EntityDataSourceDesignerHelper(entityDataSource, false /*interactiveMode*/).GetEntityTypeFilters( entityDataSource.DefaultContainerName, entityDataSource.EntitySetName); string[] entityTypeFilters = new string[entityTypeFilterItems.Count]; for (int i = 0; i < entityTypeFilterItems.Count; i++) { entityTypeFilters[i] = entityTypeFilterItems[i].EntityTypeName; } return new StandardValuesCollection(entityTypeFilters); } 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
- ThousandthOfEmRealPoints.cs
- SimpleFieldTemplateUserControl.cs
- DataTableReaderListener.cs
- TextEffectResolver.cs
- AspNetSynchronizationContext.cs
- SiteMapNodeCollection.cs
- XmlRawWriter.cs
- MessageLoggingFilterTraceRecord.cs
- FormViewPagerRow.cs
- DataKey.cs
- WebHttpDispatchOperationSelector.cs
- Decimal.cs
- FactoryGenerator.cs
- StringValidatorAttribute.cs
- XmlCodeExporter.cs
- XpsDocument.cs
- Menu.cs
- MediaPlayer.cs
- DataGridViewLinkCell.cs
- SponsorHelper.cs
- HideDisabledControlAdapter.cs
- ScrollBar.cs
- AssociatedControlConverter.cs
- CodeTypeParameter.cs
- XmlSchemaSet.cs
- WpfWebRequestHelper.cs
- MetadataItemCollectionFactory.cs
- TextProperties.cs
- XmlSerializerAssemblyAttribute.cs
- SelectionWordBreaker.cs
- SymbolMethod.cs
- TemplatePropertyEntry.cs
- HierarchicalDataBoundControl.cs
- QilInvokeLateBound.cs
- LoginName.cs
- TypeConverter.cs
- Fonts.cs
- HealthMonitoringSectionHelper.cs
- Message.cs
- LogicalTreeHelper.cs
- StringFormat.cs
- COAUTHIDENTITY.cs
- WebCategoryAttribute.cs
- PersistChildrenAttribute.cs
- MetadataUtilsSmi.cs
- ParseChildrenAsPropertiesAttribute.cs
- Base64Decoder.cs
- WeakReferenceList.cs
- Assert.cs
- RegexWorker.cs
- BigIntegerStorage.cs
- FlagPanel.cs
- EventPrivateKey.cs
- DataSourceProvider.cs
- DuplicateWaitObjectException.cs
- Binding.cs
- Pair.cs
- SerializationEventsCache.cs
- LinqDataSourceDisposeEventArgs.cs
- OrderingExpression.cs
- DLinqDataModelProvider.cs
- updateconfighost.cs
- DbException.cs
- SqlResolver.cs
- ParseNumbers.cs
- StickyNoteAnnotations.cs
- WebBrowser.cs
- HexParser.cs
- ReadingWritingEntityEventArgs.cs
- PathFigureCollectionValueSerializer.cs
- MetadataSource.cs
- RuntimeTrackingProfile.cs
- _LazyAsyncResult.cs
- CodeGeneratorOptions.cs
- ListBindingHelper.cs
- DataGridTablesFactory.cs
- XmlRootAttribute.cs
- BidPrivateBase.cs
- Convert.cs
- FileNotFoundException.cs
- translator.cs
- System.Data_BID.cs
- RegexMatch.cs
- Menu.cs
- TypefaceMap.cs
- ThreadSafeList.cs
- NotifyInputEventArgs.cs
- EventManager.cs
- AccessDataSourceView.cs
- MaskedTextBoxTextEditor.cs
- DropDownButton.cs
- ParameterCollectionEditorForm.cs
- MemberPath.cs
- SchemaMapping.cs
- BidOverLoads.cs
- ReturnEventArgs.cs
- Pointer.cs
- ProviderConnectionPointCollection.cs
- AlignmentXValidation.cs
- InputBinding.cs