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
- InputDevice.cs
- KeyValuePairs.cs
- Section.cs
- HttpGetProtocolImporter.cs
- ProviderUtil.cs
- XmlSubtreeReader.cs
- ADMembershipUser.cs
- ViewgenGatekeeper.cs
- XmlnsDefinitionAttribute.cs
- XomlCompilerError.cs
- RelativeSource.cs
- LazyTextWriterCreator.cs
- VersionedStreamOwner.cs
- ScrollBarAutomationPeer.cs
- AttributeCollection.cs
- RelOps.cs
- DetailsViewDeletedEventArgs.cs
- QuaternionConverter.cs
- DelimitedListTraceListener.cs
- NodeLabelEditEvent.cs
- RoleExceptions.cs
- InternalControlCollection.cs
- FileDialogCustomPlacesCollection.cs
- ObjectFullSpanRewriter.cs
- Preprocessor.cs
- WebReference.cs
- StylusCaptureWithinProperty.cs
- WMIGenerator.cs
- JournalEntryStack.cs
- AsymmetricKeyExchangeFormatter.cs
- BindingWorker.cs
- CompiledRegexRunnerFactory.cs
- ScriptControlManager.cs
- DefinitionBase.cs
- PassportAuthenticationEventArgs.cs
- XmlObjectSerializer.cs
- ContextInformation.cs
- BamlBinaryReader.cs
- MatcherBuilder.cs
- ValidatingReaderNodeData.cs
- Parser.cs
- TextDecorationCollection.cs
- GregorianCalendar.cs
- MultiPageTextView.cs
- HwndHost.cs
- AuthenticateEventArgs.cs
- Vector3DConverter.cs
- TabletDeviceInfo.cs
- CodeArrayCreateExpression.cs
- CodeExpressionStatement.cs
- Size.cs
- _emptywebproxy.cs
- DeviceFiltersSection.cs
- SafeHandles.cs
- ListControlBuilder.cs
- CommandBindingCollection.cs
- MenuItemStyleCollectionEditor.cs
- LateBoundBitmapDecoder.cs
- FilterRepeater.cs
- EdmProperty.cs
- OdbcEnvironment.cs
- SslStreamSecurityElement.cs
- RenderDataDrawingContext.cs
- DocumentPage.cs
- EntitySet.cs
- TaskbarItemInfo.cs
- ExceptionRoutedEventArgs.cs
- ToolStripDropDownButton.cs
- StatusBarPanelClickEvent.cs
- InvalidPrinterException.cs
- TransformPatternIdentifiers.cs
- GroupQuery.cs
- TransactionInformation.cs
- DataGridItemEventArgs.cs
- TextWriterTraceListener.cs
- ConfigurationLocation.cs
- FileSecurity.cs
- CheckedListBox.cs
- DataPager.cs
- MediaContextNotificationWindow.cs
- ExpressionNormalizer.cs
- XmlUTF8TextWriter.cs
- Viewport3DVisual.cs
- CreateDataSourceDialog.cs
- DelegateSerializationHolder.cs
- TaskCanceledException.cs
- CodeGenerator.cs
- SqlTriggerAttribute.cs
- XPathAxisIterator.cs
- SafeFileHandle.cs
- DynamicMetaObject.cs
- XsdDataContractImporter.cs
- SynchronizationFilter.cs
- EdmToObjectNamespaceMap.cs
- ReadOnlyPropertyMetadata.cs
- OleDbFactory.cs
- WinFormsSpinner.cs
- ApplyTemplatesAction.cs
- FastPropertyAccessor.cs
- URIFormatException.cs