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
- TreeViewImageIndexConverter.cs
- DiagnosticEventProvider.cs
- WindowsIPAddress.cs
- SamlDelegatingWriter.cs
- PriorityQueue.cs
- _StreamFramer.cs
- RootBrowserWindowProxy.cs
- DynamicDataResources.Designer.cs
- AutoSizeComboBox.cs
- XmlQueryType.cs
- RectangleGeometry.cs
- ProcessManager.cs
- ToolBar.cs
- ConfigXmlAttribute.cs
- AnimationClock.cs
- StoreAnnotationsMap.cs
- EndpointAddressProcessor.cs
- IsolatedStorageException.cs
- UnaryQueryOperator.cs
- ChoiceConverter.cs
- SplashScreenNativeMethods.cs
- RangeValueProviderWrapper.cs
- UpDownBaseDesigner.cs
- NumericUpDown.cs
- Int32Collection.cs
- NumberSubstitution.cs
- SerializationFieldInfo.cs
- FileDialog.cs
- BackgroundFormatInfo.cs
- HttpConfigurationContext.cs
- InlinedAggregationOperatorEnumerator.cs
- ValueTypeFieldReference.cs
- EventLogPermission.cs
- SQLInt32.cs
- FrameworkPropertyMetadata.cs
- SqlBinder.cs
- DesignerAutoFormat.cs
- DataContractSet.cs
- EmptyStringExpandableObjectConverter.cs
- SecurityElement.cs
- safemediahandle.cs
- TaskFactory.cs
- XmlEntity.cs
- CollectionBase.cs
- SqlInternalConnection.cs
- XmlMtomReader.cs
- PageClientProxyGenerator.cs
- WebPartDeleteVerb.cs
- Screen.cs
- AQNBuilder.cs
- ShapeTypeface.cs
- Screen.cs
- ResourcePermissionBaseEntry.cs
- Fault.cs
- ProfileSettingsCollection.cs
- Dump.cs
- ComplexPropertyEntry.cs
- GiveFeedbackEvent.cs
- ConditionalAttribute.cs
- Style.cs
- Wow64ConfigurationLoader.cs
- ConnectionPointCookie.cs
- XmlLanguage.cs
- XmlUTF8TextReader.cs
- InputLanguageProfileNotifySink.cs
- InheritanceAttribute.cs
- MultiByteCodec.cs
- Visual.cs
- WindowPatternIdentifiers.cs
- WebConfigurationManager.cs
- CompModSwitches.cs
- MsmqVerifier.cs
- HttpRequestTraceRecord.cs
- QueryableFilterUserControl.cs
- ClientSideQueueItem.cs
- WebPartConnectionsCancelEventArgs.cs
- BuilderInfo.cs
- CompilerScopeManager.cs
- FontStretch.cs
- AutomationPatternInfo.cs
- Switch.cs
- AppDomainAttributes.cs
- LocationReference.cs
- CacheAxisQuery.cs
- ConversionContext.cs
- ByteStreamGeometryContext.cs
- ReflectTypeDescriptionProvider.cs
- TypeConverterMarkupExtension.cs
- MouseEvent.cs
- XmlQuerySequence.cs
- FaultCode.cs
- QilValidationVisitor.cs
- SiteMapNode.cs
- TypeConverterBase.cs
- TextBreakpoint.cs
- PanelStyle.cs
- ArrangedElement.cs
- ChildChangedEventArgs.cs
- FirewallWrapper.cs
- StandardOleMarshalObject.cs