Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BamlLocalizableResourceKey.cs
- HttpDebugHandler.cs
- SaveFileDialog.cs
- IssuanceLicense.cs
- InputLanguageProfileNotifySink.cs
- DoubleAnimation.cs
- NavigatorOutput.cs
- DES.cs
- SourceLocation.cs
- HttpHandlerAction.cs
- CreateUserWizard.cs
- DomNameTable.cs
- SplitterEvent.cs
- ListControlDataBindingHandler.cs
- IndexingContentUnit.cs
- DescendantOverDescendantQuery.cs
- DivideByZeroException.cs
- BitmapEffectState.cs
- TcpClientSocketManager.cs
- SessionStateContainer.cs
- DurableInstancingOptions.cs
- StringValueConverter.cs
- Attributes.cs
- InkCanvasFeedbackAdorner.cs
- HttpWebResponse.cs
- SqlConnectionStringBuilder.cs
- DesignTimeType.cs
- MimePart.cs
- List.cs
- DesignerOptionService.cs
- Axis.cs
- IisTraceListener.cs
- ReadOnlyObservableCollection.cs
- HtmlHistory.cs
- AutomationPropertyInfo.cs
- ListViewHitTestInfo.cs
- HasCopySemanticsAttribute.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- TraceContextEventArgs.cs
- CorrelationTokenInvalidatedHandler.cs
- LineInfo.cs
- WebPartHelpVerb.cs
- ChangeProcessor.cs
- ClientConvert.cs
- EndpointConfigContainer.cs
- SrgsElementList.cs
- ContextBase.cs
- SetState.cs
- Merger.cs
- DefaultExpression.cs
- GestureRecognizer.cs
- SharedDp.cs
- Int16KeyFrameCollection.cs
- SettingsPropertyValueCollection.cs
- WebServiceHostFactory.cs
- CodeArgumentReferenceExpression.cs
- References.cs
- XmlSchemaSequence.cs
- WindowsStatic.cs
- TargetControlTypeAttribute.cs
- RegexMatch.cs
- AssemblyCollection.cs
- EntityViewContainer.cs
- ConfigurationElement.cs
- ExpressionServices.cs
- Matrix3D.cs
- ContainerParagraph.cs
- ButtonBase.cs
- ForceCopyBuildProvider.cs
- SoapFormatter.cs
- DataBindingHandlerAttribute.cs
- ConcurrentStack.cs
- CngKeyCreationParameters.cs
- ServiceMetadataPublishingElement.cs
- TextTreeInsertElementUndoUnit.cs
- Registry.cs
- AxParameterData.cs
- TextServicesLoader.cs
- XmlNavigatorFilter.cs
- VerificationAttribute.cs
- TypeReference.cs
- WebScriptEnablingBehavior.cs
- GridViewRowCollection.cs
- FrameworkReadOnlyPropertyMetadata.cs
- ReverseInheritProperty.cs
- DbConnectionPool.cs
- Pair.cs
- SetterBase.cs
- CompileXomlTask.cs
- DataGridViewLinkCell.cs
- TableCell.cs
- ConfigXmlText.cs
- SimpleExpression.cs
- Task.cs
- GridViewDeleteEventArgs.cs
- ListItemCollection.cs
- MarkedHighlightComponent.cs
- AsmxEndpointPickerExtension.cs
- ComponentEditorForm.cs
- FragmentQueryProcessor.cs