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
- HandlerBase.cs
- OptimalTextSource.cs
- CaseCqlBlock.cs
- JsonReaderDelegator.cs
- Menu.cs
- VirtualPath.cs
- StackBuilderSink.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- DataTableTypeConverter.cs
- XPathPatternParser.cs
- TypeInfo.cs
- AppSettingsSection.cs
- ScriptModule.cs
- TraceHandlerErrorFormatter.cs
- TemplateControlCodeDomTreeGenerator.cs
- WindowsSpinner.cs
- WindowsTitleBar.cs
- ObjectDataSourceStatusEventArgs.cs
- RoutedPropertyChangedEventArgs.cs
- StylusDownEventArgs.cs
- followingsibling.cs
- CounterSampleCalculator.cs
- NameSpaceExtractor.cs
- ExceptionUtil.cs
- NoResizeHandleGlyph.cs
- FixedSOMTextRun.cs
- WebServiceParameterData.cs
- AssociationSetMetadata.cs
- ToolBarButton.cs
- ToolboxItemSnapLineBehavior.cs
- Helpers.cs
- SimpleTypeResolver.cs
- ParsedAttributeCollection.cs
- DataGridViewButtonColumn.cs
- InteropBitmapSource.cs
- SQLInt32.cs
- TdsParser.cs
- FixedTextContainer.cs
- SegmentInfo.cs
- Clock.cs
- PermissionListSet.cs
- MissingSatelliteAssemblyException.cs
- DbDeleteCommandTree.cs
- DataGridViewComboBoxColumnDesigner.cs
- XsltContext.cs
- QilScopedVisitor.cs
- KnownIds.cs
- PeerNameRecordCollection.cs
- PropertyIDSet.cs
- Pair.cs
- VectorKeyFrameCollection.cs
- ClipboardProcessor.cs
- UmAlQuraCalendar.cs
- ParserExtension.cs
- StringSource.cs
- LockedBorderGlyph.cs
- ContainerParaClient.cs
- AddInDeploymentState.cs
- NameValuePair.cs
- SqlDependency.cs
- ButtonFieldBase.cs
- FlowDocumentPageViewerAutomationPeer.cs
- GlyphTypeface.cs
- InputMethodStateChangeEventArgs.cs
- IteratorFilter.cs
- Message.cs
- ReplacementText.cs
- EventSchemaTraceListener.cs
- GetPageNumberCompletedEventArgs.cs
- TdsParserStateObject.cs
- TabItemWrapperAutomationPeer.cs
- XmlDataContract.cs
- WithParamAction.cs
- BindingWorker.cs
- ImageListUtils.cs
- SymbolPair.cs
- Positioning.cs
- MetadataHelper.cs
- PaintValueEventArgs.cs
- SqlCacheDependency.cs
- BulletedListEventArgs.cs
- ListDictionary.cs
- XmlParserContext.cs
- ExpressionBuilder.cs
- NestPullup.cs
- GenericUriParser.cs
- LoginView.cs
- XamlSerializer.cs
- ControlFilterExpression.cs
- CustomAttributeFormatException.cs
- WebPermission.cs
- DependencyProperty.cs
- ZoneLinkButton.cs
- MobileControlPersister.cs
- OperationInfo.cs
- SAPIEngineTypes.cs
- OdbcConnectionString.cs
- TransformPatternIdentifiers.cs
- Currency.cs
- XmlTextAttribute.cs