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
- SafeCoTaskMem.cs
- BlurEffect.cs
- CursorConverter.cs
- BitStream.cs
- DataKey.cs
- FileUtil.cs
- ClientSideQueueItem.cs
- Options.cs
- SmiContext.cs
- PrintPreviewDialog.cs
- Utilities.cs
- IncomingWebResponseContext.cs
- NotifyInputEventArgs.cs
- DoubleLink.cs
- commandenforcer.cs
- PasswordTextContainer.cs
- AncestorChangedEventArgs.cs
- ClassImporter.cs
- TdsValueSetter.cs
- WindowsRichEditRange.cs
- Int32Rect.cs
- BezierSegment.cs
- CreateUserErrorEventArgs.cs
- CodeTypeConstructor.cs
- HyperLink.cs
- RepeaterCommandEventArgs.cs
- SQLDecimalStorage.cs
- _NativeSSPI.cs
- MetadataArtifactLoaderCompositeFile.cs
- UserMapPath.cs
- ComponentEvent.cs
- unitconverter.cs
- Module.cs
- HtmlControlPersistable.cs
- MailBnfHelper.cs
- ActivityTypeResolver.xaml.cs
- SoapDocumentMethodAttribute.cs
- SmtpSection.cs
- XamlStyleSerializer.cs
- MemoryRecordBuffer.cs
- MenuRenderer.cs
- GradientBrush.cs
- DesignerVerb.cs
- TemplatePropertyEntry.cs
- SignatureDescription.cs
- fixedPageContentExtractor.cs
- InstanceDataCollection.cs
- DataGridViewCellValueEventArgs.cs
- ObjectParameter.cs
- TogglePattern.cs
- DoubleKeyFrameCollection.cs
- CompensatableTransactionScopeActivity.cs
- ListView.cs
- Int64.cs
- ListControl.cs
- MinMaxParagraphWidth.cs
- CopyAttributesAction.cs
- Panel.cs
- DotExpr.cs
- EarlyBoundInfo.cs
- XmlDictionaryString.cs
- PageCatalogPart.cs
- SafeViewOfFileHandle.cs
- BoolExpressionVisitors.cs
- DecimalAnimation.cs
- ParallelForEach.cs
- CountdownEvent.cs
- ConnectionConsumerAttribute.cs
- HttpCapabilitiesSectionHandler.cs
- JsonServiceDocumentSerializer.cs
- CodeNamespace.cs
- MulticastIPAddressInformationCollection.cs
- CellParaClient.cs
- EncryptedData.cs
- InputProcessorProfiles.cs
- SiteMap.cs
- StatusInfoItem.cs
- DbDeleteCommandTree.cs
- ContextQuery.cs
- TableItemPattern.cs
- XmlElementCollection.cs
- ReadOnlyHierarchicalDataSourceView.cs
- DataBoundControlHelper.cs
- WebBrowserPermission.cs
- DbMetaDataFactory.cs
- ActivityUtilities.cs
- GridViewCancelEditEventArgs.cs
- UriTemplate.cs
- COM2Properties.cs
- Internal.cs
- InkCanvasInnerCanvas.cs
- C14NUtil.cs
- ApplicationProxyInternal.cs
- DataServiceQueryProvider.cs
- XmlWellformedWriter.cs
- NumberFunctions.cs
- HtmlInputText.cs
- ToolStripContentPanel.cs
- UpdateCommand.cs
- CalendarAutomationPeer.cs