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
- SimpleTypeResolver.cs
- ContentPresenter.cs
- ParameterReplacerVisitor.cs
- AccessedThroughPropertyAttribute.cs
- SqlRewriteScalarSubqueries.cs
- WCFServiceClientProxyGenerator.cs
- CustomWebEventKey.cs
- UnionQueryOperator.cs
- HtmlWindow.cs
- IPHostEntry.cs
- QueryParameter.cs
- DataTableNewRowEvent.cs
- Ref.cs
- _NegoStream.cs
- SqlTrackingWorkflowInstance.cs
- EditorPart.cs
- XmlNodeList.cs
- CompilerScopeManager.cs
- MatrixTransform.cs
- SQLBinaryStorage.cs
- codemethodreferenceexpression.cs
- BinaryObjectWriter.cs
- shaperfactoryquerycacheentry.cs
- RepeaterItemEventArgs.cs
- DbMetaDataColumnNames.cs
- LabelAutomationPeer.cs
- PaperSource.cs
- ParameterToken.cs
- XmlDigitalSignatureProcessor.cs
- CompositeDataBoundControl.cs
- ReadOnlyActivityGlyph.cs
- ToolStripCollectionEditor.cs
- List.cs
- PropertyPathConverter.cs
- RadioButtonFlatAdapter.cs
- RowVisual.cs
- ComponentSerializationService.cs
- ResourceSetExpression.cs
- MenuCommand.cs
- ClientCultureInfo.cs
- ReferencedCategoriesDocument.cs
- SqlUserDefinedAggregateAttribute.cs
- RawTextInputReport.cs
- TextWriter.cs
- OneOfTypeConst.cs
- DataGridCell.cs
- OdbcCommand.cs
- PinnedBufferMemoryStream.cs
- SQLDecimalStorage.cs
- localization.cs
- PropagationProtocolsTracing.cs
- XamlTypeMapper.cs
- TranslateTransform.cs
- XmlHierarchicalEnumerable.cs
- LinkedResourceCollection.cs
- SymLanguageType.cs
- JsonGlobals.cs
- FlowDocumentReader.cs
- RawStylusActions.cs
- ImageMapEventArgs.cs
- QilBinary.cs
- GACIdentityPermission.cs
- GridSplitter.cs
- XmlStreamNodeWriter.cs
- Visual3DCollection.cs
- RetriableClipboard.cs
- DiagnosticTraceSource.cs
- ReadOnlyNameValueCollection.cs
- NativeMethods.cs
- TypeUsage.cs
- _NTAuthentication.cs
- CFStream.cs
- Faults.cs
- EnumValidator.cs
- MetadataUtilsSmi.cs
- CookieProtection.cs
- AuthorizationSection.cs
- SchemaReference.cs
- EventlogProvider.cs
- ProviderUtil.cs
- DbConnectionInternal.cs
- CheckBoxList.cs
- TransformedBitmap.cs
- EditorPartDesigner.cs
- OracleParameter.cs
- XPathNodeHelper.cs
- WebBrowserNavigatedEventHandler.cs
- GridViewColumnHeaderAutomationPeer.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- SqlDataSourceView.cs
- TextWriterEngine.cs
- ObjectDataSourceDisposingEventArgs.cs
- MatcherBuilder.cs
- ListViewItem.cs
- CatalogPart.cs
- MdiWindowListItemConverter.cs
- TypedAsyncResult.cs
- ListItem.cs
- AssemblyNameProxy.cs
- ObjectListFieldsPage.cs