Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PointIndependentAnimationStorage.cs
- SoapExtensionTypeElementCollection.cs
- RoleGroup.cs
- VectorCollectionValueSerializer.cs
- FrameworkElementFactory.cs
- ToolStripOverflowButton.cs
- DrawingState.cs
- ErrorTolerantObjectWriter.cs
- sqlser.cs
- TranslateTransform.cs
- DecimalConverter.cs
- StackOverflowException.cs
- TimeSpanStorage.cs
- DataPagerFieldCommandEventArgs.cs
- FixedSOMFixedBlock.cs
- QueryCursorEventArgs.cs
- MediaTimeline.cs
- TemplateControlCodeDomTreeGenerator.cs
- MouseWheelEventArgs.cs
- GridViewSortEventArgs.cs
- NTAccount.cs
- FormViewDeletedEventArgs.cs
- CachedBitmap.cs
- Processor.cs
- SqlMethods.cs
- ItemCheckEvent.cs
- GridViewCellAutomationPeer.cs
- XmlSchemaAnnotated.cs
- IncrementalReadDecoders.cs
- WizardPanelChangingEventArgs.cs
- GlobalEventManager.cs
- indexingfiltermarshaler.cs
- Literal.cs
- AssemblyBuilder.cs
- PolygonHotSpot.cs
- ContextDataSource.cs
- PropertyDescriptor.cs
- Region.cs
- PointF.cs
- SqlRowUpdatedEvent.cs
- ArraySortHelper.cs
- DifferencingCollection.cs
- TableItemPattern.cs
- NetStream.cs
- SimpleRecyclingCache.cs
- DataSourceCacheDurationConverter.cs
- BufferModeSettings.cs
- SafeProcessHandle.cs
- ActivityDesignerHelper.cs
- OnOperation.cs
- PolyLineSegment.cs
- SolidColorBrush.cs
- BindingList.cs
- DataControlPagerLinkButton.cs
- ConfigurationLocation.cs
- ClientData.cs
- DataAdapter.cs
- TransactionTable.cs
- ComPlusTraceRecord.cs
- GlyphingCache.cs
- MultipleViewPattern.cs
- SqlClientWrapperSmiStream.cs
- InkCanvasSelection.cs
- Grant.cs
- ExpressionNormalizer.cs
- Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
- AsymmetricKeyExchangeFormatter.cs
- AlgoModule.cs
- FontSource.cs
- Effect.cs
- TraceSection.cs
- SocketAddress.cs
- TreeNode.cs
- TableRow.cs
- Graphics.cs
- OperationResponse.cs
- SqlDataSource.cs
- XmlBinaryReader.cs
- TextParagraphProperties.cs
- DigitShape.cs
- QueryContinueDragEventArgs.cs
- SqlProfileProvider.cs
- SubqueryTrackingVisitor.cs
- GlobalAllocSafeHandle.cs
- OdbcConnectionPoolProviderInfo.cs
- ScaleTransform.cs
- ComponentCodeDomSerializer.cs
- SspiSafeHandles.cs
- QilStrConcat.cs
- SqlRetyper.cs
- DllNotFoundException.cs
- CodeSnippetExpression.cs
- SafeWaitHandle.cs
- DelayDesigner.cs
- TabPage.cs
- CommandBinding.cs
- ServiceDescriptions.cs
- BuildProvider.cs
- SqlTypeConverter.cs
- TreeNode.cs