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
- Figure.cs
- HtmlMeta.cs
- SqlCacheDependencySection.cs
- DateTime.cs
- HandlerMappingMemo.cs
- TraceInternal.cs
- MethodInfo.cs
- DetailsView.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- EnvelopedPkcs7.cs
- DoubleCollection.cs
- EnumType.cs
- CreatingCookieEventArgs.cs
- RawStylusInputCustomDataList.cs
- listviewsubitemcollectioneditor.cs
- X509ChainElement.cs
- PropertyDescriptors.cs
- NameService.cs
- IntellisenseTextBox.designer.cs
- EncryptedPackage.cs
- ListenerAdapterBase.cs
- XmlIlVisitor.cs
- SqlBuilder.cs
- TreeViewDesigner.cs
- Journal.cs
- DataColumnMapping.cs
- Zone.cs
- ApplicationDirectoryMembershipCondition.cs
- ListViewPagedDataSource.cs
- TabOrder.cs
- PropertyPathWorker.cs
- Funcletizer.cs
- HelpFileFileNameEditor.cs
- RewritingProcessor.cs
- WorkflowOperationAsyncResult.cs
- DBCommand.cs
- DateTimeOffsetConverter.cs
- PoisonMessageException.cs
- ScaleTransform.cs
- SqlException.cs
- XmlLanguageConverter.cs
- Setter.cs
- DiscoveryClientProtocol.cs
- HostedHttpContext.cs
- IISUnsafeMethods.cs
- CodeLabeledStatement.cs
- PinnedBufferMemoryStream.cs
- TreeNodeBindingCollection.cs
- PageCatalogPart.cs
- BindToObject.cs
- CacheManager.cs
- NetNamedPipeBindingElement.cs
- ScrollableControl.cs
- JobPageOrder.cs
- BamlTreeUpdater.cs
- StrongName.cs
- MetadataCache.cs
- LicFileLicenseProvider.cs
- documentsequencetextpointer.cs
- StrongTypingException.cs
- XmlObjectSerializerContext.cs
- UIElement3DAutomationPeer.cs
- TextTreeTextElementNode.cs
- ParameterRefs.cs
- ServiceDefaults.cs
- HtmlControlAdapter.cs
- PageRanges.cs
- FixedSOMLineCollection.cs
- DataRow.cs
- FontDifferentiator.cs
- TemplatedWizardStep.cs
- Activity.cs
- DrawListViewSubItemEventArgs.cs
- BasicCommandTreeVisitor.cs
- RawKeyboardInputReport.cs
- LateBoundBitmapDecoder.cs
- CompositionAdorner.cs
- BinaryCommonClasses.cs
- ToolStripSeparatorRenderEventArgs.cs
- StickyNote.cs
- MsmqIntegrationElement.cs
- CodeDirectionExpression.cs
- TailCallAnalyzer.cs
- WebPartCatalogCloseVerb.cs
- FacetDescriptionElement.cs
- MarkupExtensionReturnTypeAttribute.cs
- BStrWrapper.cs
- DefaultProxySection.cs
- _ConnectOverlappedAsyncResult.cs
- NullableDoubleMinMaxAggregationOperator.cs
- XmlSerializationGeneratedCode.cs
- COM2PictureConverter.cs
- PropertyConverter.cs
- UserPreferenceChangedEventArgs.cs
- DescriptionAttribute.cs
- SamlAuthorizationDecisionClaimResource.cs
- HtmlTable.cs
- FormViewPagerRow.cs
- SecurityHeaderLayout.cs
- DataFormats.cs