Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / EntityDataSourceEntityTypeFilterConverter.cs / 3 / 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
- LayoutEvent.cs
- BaseAddressPrefixFilterElementCollection.cs
- MetadataHelper.cs
- XPathMessageFilterElement.cs
- DetectEofStream.cs
- WebSysDefaultValueAttribute.cs
- FormViewCommandEventArgs.cs
- ResXFileRef.cs
- LabelDesigner.cs
- XNameTypeConverter.cs
- ObjectStateFormatter.cs
- DocumentApplication.cs
- URLMembershipCondition.cs
- DispatcherEventArgs.cs
- DefaultTextStore.cs
- GridView.cs
- EventRouteFactory.cs
- CategoryNameCollection.cs
- DataGridViewComboBoxCell.cs
- WorkflowPersistenceService.cs
- ReflectionHelper.cs
- TextBoxBase.cs
- TextRangeBase.cs
- DateTimeOffsetConverter.cs
- AdobeCFFWrapper.cs
- ContentHostHelper.cs
- QilName.cs
- SafeNativeMethods.cs
- Primitive.cs
- RoutedEventArgs.cs
- WebPartConnectionsDisconnectVerb.cs
- Model3D.cs
- CustomWebEventKey.cs
- DataSourceView.cs
- ListViewSelectEventArgs.cs
- LinkButton.cs
- BitmapDecoder.cs
- DataControlLinkButton.cs
- PowerStatus.cs
- MoveSizeWinEventHandler.cs
- OdbcFactory.cs
- EventLogger.cs
- ByteKeyFrameCollection.cs
- XmlQueryType.cs
- ToolStripOverflow.cs
- DataObject.cs
- XmlSchemaDocumentation.cs
- MouseWheelEventArgs.cs
- TreeNodeCollectionEditor.cs
- XmlSerializableServices.cs
- Privilege.cs
- NavigateEvent.cs
- EventMappingSettings.cs
- PersianCalendar.cs
- SecurityDescriptor.cs
- XmlElementList.cs
- StrokeDescriptor.cs
- WebMethodAttribute.cs
- SafeSecurityHelper.cs
- PreProcessor.cs
- BamlLocalizer.cs
- AssemblyBuilder.cs
- ChildChangedEventArgs.cs
- StorageEntityContainerMapping.cs
- XhtmlMobileTextWriter.cs
- EnumerableValidator.cs
- GlobalizationAssembly.cs
- ElapsedEventArgs.cs
- GeneratedView.cs
- CssClassPropertyAttribute.cs
- ObjectSet.cs
- PreviewControlDesigner.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- SafeTimerHandle.cs
- DrawingAttributes.cs
- RtfFormatStack.cs
- SqlErrorCollection.cs
- FormsAuthenticationEventArgs.cs
- DataException.cs
- CreateUserWizardStep.cs
- CustomValidator.cs
- ConfigurationSchemaErrors.cs
- BufferAllocator.cs
- TextBlockAutomationPeer.cs
- ObjectHandle.cs
- WebPartConnectionsCancelVerb.cs
- DrawingVisualDrawingContext.cs
- LogArchiveSnapshot.cs
- log.cs
- ConfigXmlAttribute.cs
- BevelBitmapEffect.cs
- EntityAdapter.cs
- XsdCachingReader.cs
- EntityRecordInfo.cs
- EditorPartCollection.cs
- ReadOnlyObservableCollection.cs
- ChtmlImageAdapter.cs
- PermissionToken.cs
- IisTraceListener.cs
- RijndaelCryptoServiceProvider.cs