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
- OleDbTransaction.cs
- PointIndependentAnimationStorage.cs
- SemanticAnalyzer.cs
- MouseWheelEventArgs.cs
- ServicePointManager.cs
- AudioException.cs
- AddInContractAttribute.cs
- SweepDirectionValidation.cs
- StringUtil.cs
- SerializationFieldInfo.cs
- IMembershipProvider.cs
- XamlTypeMapper.cs
- DataGridBoolColumn.cs
- MessagePropertyAttribute.cs
- MasterPageCodeDomTreeGenerator.cs
- DataServiceQueryProvider.cs
- RTLAwareMessageBox.cs
- ConnectionManagementSection.cs
- ExceptionUtil.cs
- TriggerAction.cs
- Executor.cs
- EmbeddedMailObjectsCollection.cs
- ScriptDescriptor.cs
- FileUtil.cs
- GridViewColumnHeader.cs
- CompositeControl.cs
- AssemblyBuilder.cs
- SBCSCodePageEncoding.cs
- ZipIOExtraFieldElement.cs
- WindowsFormsEditorServiceHelper.cs
- SettingsBase.cs
- RangeValidator.cs
- MergeExecutor.cs
- EncodingTable.cs
- EncryptedKeyIdentifierClause.cs
- HtmlInputHidden.cs
- OperationCanceledException.cs
- WebPartEditVerb.cs
- CapacityStreamGeometryContext.cs
- GetPageNumberCompletedEventArgs.cs
- Gdiplus.cs
- ConnectionStringsExpressionEditor.cs
- MouseGestureConverter.cs
- ResourcesBuildProvider.cs
- TaiwanLunisolarCalendar.cs
- SessionParameter.cs
- GeometryGroup.cs
- ByteStream.cs
- ProviderCommandInfoUtils.cs
- Binding.cs
- _KerberosClient.cs
- StrokeCollection2.cs
- DispatchChannelSink.cs
- FontCacheLogic.cs
- DataBinder.cs
- RadioButtonList.cs
- GlobalEventManager.cs
- XPathConvert.cs
- WebPartDisplayModeCancelEventArgs.cs
- DbSetClause.cs
- CodeNamespaceCollection.cs
- BindingCompleteEventArgs.cs
- FacetChecker.cs
- AspCompat.cs
- SqlConnectionHelper.cs
- SizeConverter.cs
- MethodToken.cs
- datacache.cs
- ExpressionBuilder.cs
- WindowsListViewScroll.cs
- ToolStripDropTargetManager.cs
- CreationContext.cs
- DetailsViewDeleteEventArgs.cs
- ObjectHandle.cs
- StylusPointPropertyInfo.cs
- StrokeIntersection.cs
- AppDomainManager.cs
- MenuItemCollectionEditorDialog.cs
- SelectionItemProviderWrapper.cs
- ProbeDuplexAsyncResult.cs
- SchemaNames.cs
- VariableQuery.cs
- RefreshPropertiesAttribute.cs
- MessageBox.cs
- HotSpot.cs
- HttpDictionary.cs
- LineUtil.cs
- DataGridCell.cs
- AsymmetricKeyExchangeDeformatter.cs
- Behavior.cs
- SqlDataSourceCommandEventArgs.cs
- TextMetrics.cs
- RegexParser.cs
- XmlEncApr2001.cs
- SystemBrushes.cs
- Helper.cs
- TreeNodeCollection.cs
- PromptEventArgs.cs
- ClientScriptItemCollection.cs
- MatrixTransform.cs