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
- StringUtil.cs
- SkinIDTypeConverter.cs
- StreamResourceInfo.cs
- SamlSubject.cs
- XmlTextEncoder.cs
- Scalars.cs
- SplitterDesigner.cs
- SchemeSettingElementCollection.cs
- dsa.cs
- SignatureHelper.cs
- DataGridToolTip.cs
- FusionWrap.cs
- SecureEnvironment.cs
- HelloOperation11AsyncResult.cs
- CompositeFontFamily.cs
- HideDisabledControlAdapter.cs
- WriteTimeStream.cs
- WmlControlAdapter.cs
- ScriptManager.cs
- RectIndependentAnimationStorage.cs
- TrackingAnnotationCollection.cs
- ListBox.cs
- AutomationElementIdentifiers.cs
- XpsSerializerWriter.cs
- DtcInterfaces.cs
- AggregatePushdown.cs
- FocusTracker.cs
- ComboBoxItem.cs
- WebPart.cs
- LinqToSqlWrapper.cs
- LinqDataSourceStatusEventArgs.cs
- NamedPipeChannelFactory.cs
- BrowsableAttribute.cs
- EntityDataSourceSelectingEventArgs.cs
- DocumentPageHost.cs
- RemoteWebConfigurationHostStream.cs
- DataGridRowClipboardEventArgs.cs
- PipeException.cs
- DelegatingHeader.cs
- ByteArrayHelperWithString.cs
- EventPropertyMap.cs
- assemblycache.cs
- XNodeValidator.cs
- XMLDiffLoader.cs
- WeakHashtable.cs
- SqlResolver.cs
- NumberSubstitution.cs
- EndpointIdentity.cs
- SecurityProtocolFactory.cs
- EnumUnknown.cs
- KeyValueConfigurationCollection.cs
- ToolStripLabel.cs
- RelationshipEndMember.cs
- ISO2022Encoding.cs
- DefaultShape.cs
- RootCodeDomSerializer.cs
- XmlSchemaSimpleTypeList.cs
- SolidBrush.cs
- CustomPopupPlacement.cs
- CmsUtils.cs
- DataSourceCacheDurationConverter.cs
- Crypto.cs
- ConfigurationConverterBase.cs
- SR.cs
- AdPostCacheSubstitution.cs
- SQLDoubleStorage.cs
- AbstractDataSvcMapFileLoader.cs
- TraceEventCache.cs
- HttpPostClientProtocol.cs
- OutputScopeManager.cs
- ReturnType.cs
- RegexWorker.cs
- BufferedStream2.cs
- VersionedStream.cs
- CodeCompiler.cs
- ViewGenerator.cs
- ColumnTypeConverter.cs
- ContainerControlDesigner.cs
- VisualCollection.cs
- WebZoneDesigner.cs
- WebControl.cs
- ContainerVisual.cs
- RegisteredDisposeScript.cs
- TextEditorSpelling.cs
- ArrayList.cs
- DispatcherProcessingDisabled.cs
- BorderGapMaskConverter.cs
- DataGridViewCellStyleConverter.cs
- ArcSegment.cs
- XmlUrlResolver.cs
- DataGridPagingPage.cs
- BindingExpressionBase.cs
- EnumMember.cs
- DbExpressionBuilder.cs
- IteratorDescriptor.cs
- ClientType.cs
- ReadWriteObjectLock.cs
- WebZone.cs
- DefaultBindingPropertyAttribute.cs
- AssociationSet.cs