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
- NullableDecimalSumAggregationOperator.cs
- SafeSecurityHandles.cs
- OperationCanceledException.cs
- DbConnectionPoolGroupProviderInfo.cs
- TreeNodeStyleCollection.cs
- DecimalAnimationBase.cs
- xmlNames.cs
- baseshape.cs
- EntityCommand.cs
- ConfigXmlElement.cs
- TemplateNameScope.cs
- OutputCacheProfileCollection.cs
- BitmapPalettes.cs
- RemotingConfiguration.cs
- WindowsFont.cs
- SiteMapSection.cs
- SByte.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- ExeContext.cs
- GenerateHelper.cs
- TemplateBindingExpression.cs
- VisualStates.cs
- CodeTypeDeclaration.cs
- ComplexTypeEmitter.cs
- MutexSecurity.cs
- DBSchemaRow.cs
- WebPartVerbCollection.cs
- ParamArrayAttribute.cs
- ScriptingWebServicesSectionGroup.cs
- GrowingArray.cs
- GeneralTransform.cs
- SimpleApplicationHost.cs
- HttpResponseInternalBase.cs
- DiscoveryCallbackBehavior.cs
- MessageQueuePermissionEntry.cs
- DataGridItemEventArgs.cs
- ClosableStream.cs
- SessionState.cs
- ColumnResizeUndoUnit.cs
- XmlC14NWriter.cs
- X509WindowsSecurityToken.cs
- PkcsUtils.cs
- Misc.cs
- MarshalByValueComponent.cs
- EventSourceCreationData.cs
- DbDataSourceEnumerator.cs
- Application.cs
- TextWriterEngine.cs
- InkCanvasInnerCanvas.cs
- SimpleBitVector32.cs
- ScopelessEnumAttribute.cs
- ObjectNotFoundException.cs
- HtmlAnchor.cs
- PropertyItem.cs
- TreeWalkHelper.cs
- RestClientProxyHandler.cs
- UMPAttributes.cs
- ConstraintConverter.cs
- KnownTypesHelper.cs
- SymmetricCryptoHandle.cs
- CompositionTarget.cs
- NonVisualControlAttribute.cs
- File.cs
- filewebrequest.cs
- TypeConverterValueSerializer.cs
- Validator.cs
- TabItemAutomationPeer.cs
- TimeStampChecker.cs
- HostProtectionException.cs
- MulticastNotSupportedException.cs
- XPathCompiler.cs
- Light.cs
- SessionStateUtil.cs
- StubHelpers.cs
- DES.cs
- CopyOfAction.cs
- XmlResolver.cs
- HttpChannelHelper.cs
- ExpressionBuilder.cs
- RayMeshGeometry3DHitTestResult.cs
- DesignerSelectionListAdapter.cs
- PointConverter.cs
- CompletionBookmark.cs
- PropertyCondition.cs
- ResourceManager.cs
- coordinatorscratchpad.cs
- HierarchicalDataBoundControl.cs
- PolicyStatement.cs
- BezierSegment.cs
- DataRowView.cs
- XslTransformFileEditor.cs
- CompositeCollectionView.cs
- QilExpression.cs
- DetailsViewCommandEventArgs.cs
- SqlTypeConverter.cs
- HttpListenerException.cs
- FrameworkContentElementAutomationPeer.cs
- PrimitiveType.cs
- ActiveXSite.cs
- RequestCachePolicy.cs