Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / EntityDataSourceContainerNameConverter.cs / 3 / EntityDataSourceContainerNameConverter.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 EntityDataSourceContainerNameConverter : StringConverter { public EntityDataSourceContainerNameConverter() : base() { } public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { // We can only get a list of possible DefaultContainerName values if we have: // (1) Connection string so we can load metadata // Even if this value is set, it may not be possible to actually load the metadata, but at least we can try the lookup if requested EntityDataSource entityDataSource = context.Instance as EntityDataSource; if (entityDataSource != null && !String.IsNullOrEmpty(entityDataSource.ConnectionString)) { ListcontainerNameItems = new EntityDataSourceDesignerHelper(entityDataSource, false /*interactiveMode*/).GetContainerNames(true /*sortResults*/); string[] containers = new string[containerNameItems.Count]; for (int i = 0; i < containerNameItems.Count; i++) { containers[i] = containerNameItems[i].ToString(); } return new StandardValuesCollection(containers); } 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 EntityDataSourceContainerNameConverter : StringConverter { public EntityDataSourceContainerNameConverter() : base() { } public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { // We can only get a list of possible DefaultContainerName values if we have: // (1) Connection string so we can load metadata // Even if this value is set, it may not be possible to actually load the metadata, but at least we can try the lookup if requested EntityDataSource entityDataSource = context.Instance as EntityDataSource; if (entityDataSource != null && !String.IsNullOrEmpty(entityDataSource.ConnectionString)) { ListcontainerNameItems = new EntityDataSourceDesignerHelper(entityDataSource, false /*interactiveMode*/).GetContainerNames(true /*sortResults*/); string[] containers = new string[containerNameItems.Count]; for (int i = 0; i < containerNameItems.Count; i++) { containers[i] = containerNameItems[i].ToString(); } return new StandardValuesCollection(containers); } 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
- Literal.cs
- AnonymousIdentificationSection.cs
- StoryFragments.cs
- WithParamAction.cs
- ReceiveDesigner.xaml.cs
- RelatedPropertyManager.cs
- ConnectionManagementSection.cs
- Tile.cs
- EntityParameterCollection.cs
- ExpressionTable.cs
- SimpleType.cs
- Literal.cs
- QilStrConcat.cs
- HttpHeaderCollection.cs
- BinaryFormatter.cs
- CapiNative.cs
- GlyphsSerializer.cs
- HandleExceptionArgs.cs
- _SSPISessionCache.cs
- ArgumentNullException.cs
- XmlSchemaSimpleTypeRestriction.cs
- SpotLight.cs
- TextMetrics.cs
- UnaryExpressionHelper.cs
- SafeMemoryMappedViewHandle.cs
- Composition.cs
- CustomErrorsSectionWrapper.cs
- TabPage.cs
- SendingRequestEventArgs.cs
- DetailsViewPagerRow.cs
- MarkupWriter.cs
- HostAdapter.cs
- MenuItem.cs
- ClientBuildManager.cs
- SqlRowUpdatedEvent.cs
- TcpTransportElement.cs
- ReliableInputConnection.cs
- WebPartEditVerb.cs
- HasCopySemanticsAttribute.cs
- WebPartDescriptionCollection.cs
- SchemaTableColumn.cs
- AppDomainUnloadedException.cs
- DBConnectionString.cs
- XmlQualifiedName.cs
- CellParaClient.cs
- ToolStripSeparator.cs
- DataComponentNameHandler.cs
- InertiaExpansionBehavior.cs
- MutexSecurity.cs
- EventLogPermissionAttribute.cs
- Context.cs
- ViewStateException.cs
- MethodExpression.cs
- HitTestDrawingContextWalker.cs
- ClientSession.cs
- StickyNoteContentControl.cs
- PerformanceCounterCategory.cs
- EpmSourceTree.cs
- EventItfInfo.cs
- HttpCapabilitiesEvaluator.cs
- AxParameterData.cs
- ObjectDataSourceView.cs
- MemoryStream.cs
- TrackingExtract.cs
- XmlDocumentFragment.cs
- Axis.cs
- ReaderContextStackData.cs
- HostProtectionException.cs
- DecimalKeyFrameCollection.cs
- FixedFindEngine.cs
- PEFileReader.cs
- SelectedDatesCollection.cs
- AudioLevelUpdatedEventArgs.cs
- DbConnectionStringCommon.cs
- SubstitutionDesigner.cs
- FormClosedEvent.cs
- SqlTriggerAttribute.cs
- UiaCoreApi.cs
- ParseHttpDate.cs
- WebPartConnectionsEventArgs.cs
- SharedStatics.cs
- HighlightComponent.cs
- WebPartTransformerAttribute.cs
- ClientUtils.cs
- DynamicPropertyHolder.cs
- Pair.cs
- BamlBinaryReader.cs
- PriorityChain.cs
- Group.cs
- ComNativeDescriptor.cs
- DiagnosticsConfigurationHandler.cs
- SoapIncludeAttribute.cs
- ALinqExpressionVisitor.cs
- CultureMapper.cs
- FixedDSBuilder.cs
- EmptyImpersonationContext.cs
- FormViewRow.cs
- StylusPointDescription.cs
- DBSqlParserTable.cs
- FrameworkElementFactory.cs