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
- _WinHttpWebProxyDataBuilder.cs
- DeferredReference.cs
- UnsafeNetInfoNativeMethods.cs
- DataGridCell.cs
- XmlSchemaComplexContentRestriction.cs
- XmlSchemaComplexContent.cs
- WebServiceData.cs
- Container.cs
- SmiSettersStream.cs
- XPathAxisIterator.cs
- EmbeddedMailObject.cs
- Byte.cs
- GridViewHeaderRowPresenter.cs
- GlyphInfoList.cs
- MetadataCollection.cs
- XmlMessageFormatter.cs
- FormViewInsertEventArgs.cs
- QuotedPairReader.cs
- CancelEventArgs.cs
- ListItemParagraph.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- CommittableTransaction.cs
- QilReference.cs
- HttpVersion.cs
- PagedDataSource.cs
- SerializerDescriptor.cs
- ClientUtils.cs
- MaskedTextProvider.cs
- TypeConverterBase.cs
- BindingMemberInfo.cs
- COM2TypeInfoProcessor.cs
- PropertyDescriptorCollection.cs
- FixedDocument.cs
- InputLangChangeEvent.cs
- BinaryReader.cs
- HitTestParameters.cs
- ListViewHitTestInfo.cs
- TypeGeneratedEventArgs.cs
- TextPointer.cs
- Rotation3D.cs
- LocatorGroup.cs
- Converter.cs
- ParentUndoUnit.cs
- ImagingCache.cs
- ObjectStateManagerMetadata.cs
- HttpGetProtocolReflector.cs
- DBCommandBuilder.cs
- Operator.cs
- SemanticValue.cs
- RoutingChannelExtension.cs
- DataBinder.cs
- TargetParameterCountException.cs
- ChannelSinkStacks.cs
- TransformerInfo.cs
- NativeRecognizer.cs
- CombinedGeometry.cs
- WorkflowServiceOperationListItem.cs
- NullNotAllowedCollection.cs
- QilSortKey.cs
- SiteMapPathDesigner.cs
- CompoundFileDeflateTransform.cs
- Soap12ServerProtocol.cs
- GlobalizationSection.cs
- LinqDataSourceView.cs
- ProtectedConfiguration.cs
- SchemaHelper.cs
- RangeEnumerable.cs
- CompilerWrapper.cs
- TimelineGroup.cs
- ScrollBar.cs
- ProxyManager.cs
- Splitter.cs
- SplitterPanel.cs
- X509RawDataKeyIdentifierClause.cs
- oledbmetadatacollectionnames.cs
- ComponentEvent.cs
- BookmarkScopeHandle.cs
- UniqueConstraint.cs
- AtomMaterializerLog.cs
- ImageMapEventArgs.cs
- COAUTHINFO.cs
- HttpCacheParams.cs
- ChannelEndpointElement.cs
- MenuItemStyle.cs
- TemplateNodeContextMenu.cs
- InstancePersistenceContext.cs
- WebBrowserUriTypeConverter.cs
- SynchronizedInputProviderWrapper.cs
- DesignerAttribute.cs
- CompatibleComparer.cs
- LicenseProviderAttribute.cs
- FeatureSupport.cs
- SqlBulkCopyColumnMapping.cs
- ListViewUpdatedEventArgs.cs
- OracleInternalConnection.cs
- DataGridViewColumnCollection.cs
- XmlIlGenerator.cs
- NullableConverter.cs
- FormattedTextSymbols.cs
- GeneralTransform2DTo3DTo2D.cs