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
- PbrsForward.cs
- Quaternion.cs
- DataGridViewComponentPropertyGridSite.cs
- TreeViewHitTestInfo.cs
- DesignerLoader.cs
- MarkupCompilePass2.cs
- ImageSourceConverter.cs
- TableAutomationPeer.cs
- DocumentPageViewAutomationPeer.cs
- Parser.cs
- ViewStateModeByIdAttribute.cs
- SrgsRuleRef.cs
- InternalCache.cs
- SafeUserTokenHandle.cs
- ProtocolsConfigurationHandler.cs
- DesigntimeLicenseContext.cs
- PlatformNotSupportedException.cs
- ApplyTemplatesAction.cs
- HtmlContainerControl.cs
- XmlSigningNodeWriter.cs
- UnicodeEncoding.cs
- _FtpControlStream.cs
- EmptyStringExpandableObjectConverter.cs
- PrinterUnitConvert.cs
- BitmapEffectGeneralTransform.cs
- CustomAttributeBuilder.cs
- CultureSpecificStringDictionary.cs
- DecoratedNameAttribute.cs
- NamedElement.cs
- DelegateSerializationHolder.cs
- figurelengthconverter.cs
- AdapterUtil.cs
- SiteMapProvider.cs
- TextFormatterHost.cs
- ObjectNotFoundException.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- TextFormatterHost.cs
- Screen.cs
- EventLogEntryCollection.cs
- OperationInfoBase.cs
- TypeElement.cs
- SchemaImporterExtension.cs
- Funcletizer.cs
- AmbientProperties.cs
- ManagementDateTime.cs
- TableColumn.cs
- Rect3D.cs
- XmlUtil.cs
- Unit.cs
- LogStream.cs
- FrameworkElement.cs
- SqlDataSourceRefreshSchemaForm.cs
- ZipIOLocalFileBlock.cs
- SqlProvider.cs
- MonthChangedEventArgs.cs
- SRGSCompiler.cs
- InstanceKey.cs
- SecUtil.cs
- Events.cs
- CornerRadius.cs
- HtmlAnchor.cs
- CodeAccessSecurityEngine.cs
- COM2Enum.cs
- Table.cs
- TablePattern.cs
- QfeChecker.cs
- MouseButton.cs
- PersonalizationProviderHelper.cs
- SurrogateEncoder.cs
- IntegerValidatorAttribute.cs
- KeyboardDevice.cs
- ConfigurationStrings.cs
- BasicHttpSecurityElement.cs
- NamespaceCollection.cs
- SerialPinChanges.cs
- DbModificationClause.cs
- InternalCache.cs
- Freezable.cs
- Membership.cs
- ProviderConnectionPointCollection.cs
- ConfigurationPermission.cs
- ConfigurationLocationCollection.cs
- InstanceView.cs
- XhtmlBasicFormAdapter.cs
- Point.cs
- StoragePropertyMapping.cs
- DataGridViewColumn.cs
- AnonymousIdentificationModule.cs
- LockRenewalTask.cs
- UntrustedRecipientException.cs
- MultipartContentParser.cs
- SerializationStore.cs
- QilSortKey.cs
- DataRelationCollection.cs
- RandomDelayQueuedSendsAsyncResult.cs
- ByteKeyFrameCollection.cs
- FixedSOMPageElement.cs
- CodeNamespaceCollection.cs
- PageAdapter.cs
- StringStorage.cs