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
- WindowsRegion.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- mediapermission.cs
- Separator.cs
- SyndicationDeserializer.cs
- TextTreeRootNode.cs
- CheckBoxAutomationPeer.cs
- StateMachineSubscription.cs
- SmtpDigestAuthenticationModule.cs
- TransactionChannelFaultConverter.cs
- UnmanagedMemoryStream.cs
- DateTimeOffsetStorage.cs
- Splitter.cs
- ScriptingScriptResourceHandlerSection.cs
- ReliabilityContractAttribute.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- BamlLocalizableResourceKey.cs
- ResourceDictionary.cs
- _NTAuthentication.cs
- Activator.cs
- XmlDataSourceView.cs
- ProxyAttribute.cs
- TextDecorationUnitValidation.cs
- AsymmetricSignatureFormatter.cs
- PropertyBuilder.cs
- StringBlob.cs
- ParameterRetriever.cs
- DocumentViewerAutomationPeer.cs
- LogEntrySerializationException.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- FixedLineResult.cs
- XmlElement.cs
- ClientRolePrincipal.cs
- WindowsHyperlink.cs
- ClusterSafeNativeMethods.cs
- ExtendedPropertyCollection.cs
- Matrix3D.cs
- GroupDescription.cs
- ReadOnlyKeyedCollection.cs
- ServiceOperation.cs
- DeflateStream.cs
- ObsoleteAttribute.cs
- ModifierKeysValueSerializer.cs
- ButtonPopupAdapter.cs
- ModuleConfigurationInfo.cs
- TextPointerBase.cs
- WindowsToolbarItemAsMenuItem.cs
- SchemaEntity.cs
- SqlMethods.cs
- OLEDB_Util.cs
- HttpRuntime.cs
- MobileUserControlDesigner.cs
- ConfigPathUtility.cs
- FilterEventArgs.cs
- Function.cs
- DrawingAttributes.cs
- DataSourceView.cs
- DataGridView.cs
- ApplicationHost.cs
- Events.cs
- TraceLevelStore.cs
- EnumValAlphaComparer.cs
- PeerHelpers.cs
- UnsafeNativeMethods.cs
- DeobfuscatingStream.cs
- ExpressionNode.cs
- ThreadStaticAttribute.cs
- LogArchiveSnapshot.cs
- TextEndOfSegment.cs
- ToolboxBitmapAttribute.cs
- InheritanceContextHelper.cs
- UnsafePeerToPeerMethods.cs
- SharedPersonalizationStateInfo.cs
- CacheEntry.cs
- PropertyGridEditorPart.cs
- InlinedAggregationOperatorEnumerator.cs
- HeaderCollection.cs
- RequestBringIntoViewEventArgs.cs
- FontNameConverter.cs
- RemotingServices.cs
- SmtpNegotiateAuthenticationModule.cs
- MatchingStyle.cs
- EncodingDataItem.cs
- DefaultValidator.cs
- ToolStripDropDownClosedEventArgs.cs
- followingquery.cs
- FileDialogPermission.cs
- RevocationPoint.cs
- DelimitedListTraceListener.cs
- SolidBrush.cs
- FtpCachePolicyElement.cs
- UnsafeNetInfoNativeMethods.cs
- SMSvcHost.cs
- EventToken.cs
- Knowncolors.cs
- XhtmlStyleClass.cs
- HtmlTextArea.cs
- HttpHandler.cs
- FormViewInsertedEventArgs.cs
- VerificationAttribute.cs