Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / EntityDataSourceEntityTypeFilterConverter.cs / 3 / 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
- CodeThrowExceptionStatement.cs
- COM2PropertyDescriptor.cs
- SqlClientPermission.cs
- SqlUtils.cs
- OutOfProcStateClientManager.cs
- Rule.cs
- ListViewGroup.cs
- ArrayConverter.cs
- Triplet.cs
- ITreeGenerator.cs
- CellConstantDomain.cs
- TableStyle.cs
- RootContext.cs
- CannotUnloadAppDomainException.cs
- PropertyDescriptorCollection.cs
- IntranetCredentialPolicy.cs
- TileModeValidation.cs
- HijriCalendar.cs
- ConstraintStruct.cs
- AttachedPropertiesService.cs
- XmlCustomFormatter.cs
- ToolboxDataAttribute.cs
- SimpleMailWebEventProvider.cs
- TranslateTransform3D.cs
- DependencyObjectType.cs
- XmlSerializerNamespaces.cs
- DynamicPropertyReader.cs
- SafePEFileHandle.cs
- DocumentViewer.cs
- JournalEntryListConverter.cs
- Cloud.cs
- Automation.cs
- Byte.cs
- CallSiteBinder.cs
- AnnotationResource.cs
- HttpCapabilitiesSectionHandler.cs
- AsymmetricSignatureDeformatter.cs
- figurelength.cs
- MetadataSet.cs
- SectionUpdates.cs
- Tokenizer.cs
- DbMetaDataFactory.cs
- WebServiceEnumData.cs
- HashLookup.cs
- XamlBrushSerializer.cs
- SystemTcpConnection.cs
- Propagator.JoinPropagator.cs
- BamlBinaryReader.cs
- ContractCodeDomInfo.cs
- WebProxyScriptElement.cs
- AsmxEndpointPickerExtension.cs
- InputLanguageProfileNotifySink.cs
- RefType.cs
- SpotLight.cs
- Queue.cs
- GroupJoinQueryOperator.cs
- QuaternionIndependentAnimationStorage.cs
- TdsParserStateObject.cs
- SourceLocation.cs
- XmlSchemaSimpleTypeRestriction.cs
- IdentitySection.cs
- NotifyParentPropertyAttribute.cs
- RelationshipDetailsRow.cs
- CriticalHandle.cs
- ModuleBuilderData.cs
- CatalogZone.cs
- RepeaterItemCollection.cs
- TagPrefixAttribute.cs
- FixedBufferAttribute.cs
- TreeViewBindingsEditorForm.cs
- ClockGroup.cs
- Point4D.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- ThreadSafeMessageFilterTable.cs
- PropertyFilterAttribute.cs
- QuaternionKeyFrameCollection.cs
- XmlCharacterData.cs
- BitmapEffectGroup.cs
- RuleRef.cs
- ElementHost.cs
- XmlReflectionImporter.cs
- FileReader.cs
- HostedTcpTransportManager.cs
- BitmapEffectGeneralTransform.cs
- ImpersonateTokenRef.cs
- SessionStateSection.cs
- EllipseGeometry.cs
- WmpBitmapDecoder.cs
- TextBox.cs
- XmlCompatibilityReader.cs
- ObjectNavigationPropertyMapping.cs
- ZipFileInfoCollection.cs
- RawStylusSystemGestureInputReport.cs
- SqlTypeConverter.cs
- UrlMappingsModule.cs
- SiteMapDataSource.cs
- WebServiceClientProxyGenerator.cs
- CookieHandler.cs
- CriticalFinalizerObject.cs
- XmlWhitespace.cs