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
- XmlChildNodes.cs
- XmlTextEncoder.cs
- DiagnosticTrace.cs
- ProcessModelInfo.cs
- FilterException.cs
- UnaryQueryOperator.cs
- DecoderExceptionFallback.cs
- XmlUtil.cs
- Line.cs
- RuleSet.cs
- ImageCodecInfo.cs
- TextSelectionHelper.cs
- PropertyPushdownHelper.cs
- StrokeDescriptor.cs
- ExpressionBuilder.cs
- DefaultValueTypeConverter.cs
- EventWaitHandle.cs
- TextTreeTextElementNode.cs
- AuthStoreRoleProvider.cs
- MultiAsyncResult.cs
- DataTemplateSelector.cs
- Fonts.cs
- WebPartsPersonalization.cs
- SystemUdpStatistics.cs
- MemoryStream.cs
- DocumentPageTextView.cs
- TrackingDataItem.cs
- infer.cs
- Size.cs
- GroupBox.cs
- OuterGlowBitmapEffect.cs
- Size3DConverter.cs
- TextMessageEncoder.cs
- DiscoveryDocumentReference.cs
- MasterPageParser.cs
- TabPageDesigner.cs
- processwaithandle.cs
- NativeMethods.cs
- ArgumentOutOfRangeException.cs
- EnvironmentPermission.cs
- BaseValidatorDesigner.cs
- MergeLocalizationDirectives.cs
- StandardOleMarshalObject.cs
- MultiSelectRootGridEntry.cs
- UnSafeCharBuffer.cs
- QueryOperatorEnumerator.cs
- PolicyStatement.cs
- OutputCacheProfile.cs
- CodeNamespaceImport.cs
- SignatureDescription.cs
- CachedTypeface.cs
- sitestring.cs
- FormCollection.cs
- StringUtil.cs
- SelectorAutomationPeer.cs
- DefaultValueTypeConverter.cs
- httpapplicationstate.cs
- CodeIdentifier.cs
- ZoneIdentityPermission.cs
- CreateDataSourceDialog.cs
- ChannelServices.cs
- XsdValidatingReader.cs
- SerializationEventsCache.cs
- CategoryAttribute.cs
- SBCSCodePageEncoding.cs
- CustomServiceCredentials.cs
- ValueProviderWrapper.cs
- EncoderReplacementFallback.cs
- DBConnection.cs
- ColorContext.cs
- WebEventCodes.cs
- DbTransaction.cs
- RelationshipSet.cs
- PageWrapper.cs
- EntityDataSource.cs
- IsolatedStorageFilePermission.cs
- FilterQueryOptionExpression.cs
- MultiTrigger.cs
- UInt64Converter.cs
- ProfessionalColorTable.cs
- DataReceivedEventArgs.cs
- TabOrder.cs
- CapabilitiesPattern.cs
- PropertyPathConverter.cs
- NullableLongMinMaxAggregationOperator.cs
- _AutoWebProxyScriptWrapper.cs
- ApplicationSecurityManager.cs
- WorkBatch.cs
- View.cs
- TraceUtility.cs
- RequestNavigateEventArgs.cs
- TraceSource.cs
- ViewPort3D.cs
- StylusPointDescription.cs
- SessionChannels.cs
- LineServicesRun.cs
- CookielessHelper.cs
- Menu.cs
- COAUTHINFO.cs
- Point3DCollectionValueSerializer.cs