Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / EntityDataSourceContainerNameConverter.cs / 1305376 / 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
- NumberSubstitution.cs
- IndentedTextWriter.cs
- InputLanguageManager.cs
- RelationshipNavigation.cs
- XmlNodeList.cs
- LicenseException.cs
- SafeFindHandle.cs
- _NegoStream.cs
- XPathBinder.cs
- TemplateGroupCollection.cs
- Int16AnimationUsingKeyFrames.cs
- BindingGroup.cs
- ParentQuery.cs
- dbenumerator.cs
- Size3D.cs
- TreeBuilder.cs
- DesignSurface.cs
- DispatcherHookEventArgs.cs
- WorkItem.cs
- FrameworkElementAutomationPeer.cs
- ResourcesChangeInfo.cs
- ArraySet.cs
- TextBoxView.cs
- ParagraphVisual.cs
- Soap12ProtocolImporter.cs
- DataGridViewColumn.cs
- KeyFrames.cs
- FormsAuthenticationConfiguration.cs
- ForEachAction.cs
- ShapingWorkspace.cs
- OdbcDataReader.cs
- TextEditorCopyPaste.cs
- DbParameterCollectionHelper.cs
- DictionaryGlobals.cs
- MaterialGroup.cs
- DataGridColumn.cs
- ComplexTypeEmitter.cs
- Operators.cs
- XmlComment.cs
- ListViewGroupConverter.cs
- XmlNamespaceManager.cs
- RegexWorker.cs
- LinkTarget.cs
- KeyConstraint.cs
- SimplePropertyEntry.cs
- FolderLevelBuildProviderCollection.cs
- TimeSpanParse.cs
- ZipIOModeEnforcingStream.cs
- SafeCloseHandleCritical.cs
- WindowsFormsHostPropertyMap.cs
- Cell.cs
- ColorContext.cs
- QueuePathEditor.cs
- SynchronizationValidator.cs
- TemplateXamlParser.cs
- RuntimeVariablesExpression.cs
- ConsoleCancelEventArgs.cs
- GrammarBuilderPhrase.cs
- GridView.cs
- SaveRecipientRequest.cs
- DataGridViewUtilities.cs
- XmlArrayItemAttributes.cs
- ContextQuery.cs
- EditorPartChrome.cs
- WebPartsSection.cs
- ObjectDataSourceDisposingEventArgs.cs
- ForwardPositionQuery.cs
- ToolboxComponentsCreatingEventArgs.cs
- MenuBindingsEditorForm.cs
- ModuleBuilder.cs
- HandlerWithFactory.cs
- UntrustedRecipientException.cs
- EntityUtil.cs
- SubtreeProcessor.cs
- MemoryFailPoint.cs
- TouchDevice.cs
- FrameworkTextComposition.cs
- Control.cs
- Evidence.cs
- HScrollProperties.cs
- TextProperties.cs
- Dictionary.cs
- CommentEmitter.cs
- GroupStyle.cs
- nulltextnavigator.cs
- RayHitTestParameters.cs
- TransformProviderWrapper.cs
- BitmapInitialize.cs
- DefaultValueConverter.cs
- ColumnMap.cs
- DriveNotFoundException.cs
- DynamicValidator.cs
- XmlSchemaObject.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- OutgoingWebRequestContext.cs
- ImmutablePropertyDescriptorGridEntry.cs
- DataGridTablesFactory.cs
- SEHException.cs
- SecurityRuntime.cs
- TextAnchor.cs