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
- SizeConverter.cs
- ListenerSessionConnection.cs
- Vector.cs
- HashMembershipCondition.cs
- GridViewCancelEditEventArgs.cs
- control.ime.cs
- WindowsGraphics2.cs
- URLAttribute.cs
- InnerItemCollectionView.cs
- CursorInteropHelper.cs
- DBSqlParserTable.cs
- smtpconnection.cs
- LicFileLicenseProvider.cs
- CodeNamespaceCollection.cs
- RectValueSerializer.cs
- StaticSiteMapProvider.cs
- HttpClientCertificate.cs
- X509ChainPolicy.cs
- DataView.cs
- ObjectPropertyMapping.cs
- ConfigXmlWhitespace.cs
- TableDetailsRow.cs
- TableMethodGenerator.cs
- XmlDataLoader.cs
- HttpContext.cs
- DataReceivedEventArgs.cs
- DesignerOptionService.cs
- ExpressionCopier.cs
- XmlToDatasetMap.cs
- DesigntimeLicenseContext.cs
- BamlRecordHelper.cs
- MdiWindowListStrip.cs
- ScrollContentPresenter.cs
- QueryContinueDragEvent.cs
- Int32.cs
- SourceElementsCollection.cs
- ProfilePropertyNameValidator.cs
- QfeChecker.cs
- DocumentReferenceCollection.cs
- FamilyTypeface.cs
- SqlSelectStatement.cs
- SqlCrossApplyToCrossJoin.cs
- PolygonHotSpot.cs
- SendSecurityHeader.cs
- PostBackTrigger.cs
- AssemblyAttributes.cs
- UnsettableComboBox.cs
- StringReader.cs
- DLinqColumnProvider.cs
- SamlNameIdentifierClaimResource.cs
- FlowPosition.cs
- StandardOleMarshalObject.cs
- VideoDrawing.cs
- _NestedSingleAsyncResult.cs
- AsyncPostBackErrorEventArgs.cs
- SqlDataSourceConnectionPanel.cs
- InternalControlCollection.cs
- XXXInfos.cs
- Panel.cs
- ObjectTag.cs
- DropShadowEffect.cs
- TaskbarItemInfo.cs
- DataServiceClientException.cs
- BitmapSource.cs
- StatusBarAutomationPeer.cs
- BitConverter.cs
- UrlEncodedParameterWriter.cs
- ServiceReference.cs
- PageRequestManager.cs
- Crypto.cs
- CommandEventArgs.cs
- SafeSecurityHandles.cs
- ExtractorMetadata.cs
- Activator.cs
- WebPartDisplayModeCancelEventArgs.cs
- Behavior.cs
- MethodToken.cs
- ScriptResourceInfo.cs
- LoginName.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- SerializationIncompleteException.cs
- IOThreadScheduler.cs
- DoubleConverter.cs
- COSERVERINFO.cs
- RuleInfoComparer.cs
- FontDriver.cs
- HierarchicalDataSourceControl.cs
- TextOptions.cs
- SelectionEditingBehavior.cs
- FunctionDefinition.cs
- GrabHandleGlyph.cs
- ListViewSelectEventArgs.cs
- CheckBox.cs
- NavigationPropertyEmitter.cs
- UIPermission.cs
- SafeFileHandle.cs
- TextLineBreak.cs
- SystemTcpConnection.cs
- IndexedEnumerable.cs
- XamlSerializerUtil.cs