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
- ValidationSettings.cs
- ReadOnlyNameValueCollection.cs
- DiscoveryUtility.cs
- CompilerGeneratedAttribute.cs
- URIFormatException.cs
- ListParagraph.cs
- DrawingContextWalker.cs
- DesignerAutoFormatStyle.cs
- GacUtil.cs
- FamilyMap.cs
- CompositeActivityTypeDescriptor.cs
- DataGridCaption.cs
- SelectionRange.cs
- LingerOption.cs
- DoubleCollection.cs
- ArrayHelper.cs
- PermissionSetTriple.cs
- SafeFileMappingHandle.cs
- XamlPointCollectionSerializer.cs
- DataGridSortCommandEventArgs.cs
- WebResourceUtil.cs
- OciEnlistContext.cs
- GenericNameHandler.cs
- MimeImporter.cs
- StatusBarPanelClickEvent.cs
- BindingFormattingDialog.cs
- Scalars.cs
- DbConnectionPool.cs
- XmlSignatureManifest.cs
- HitTestDrawingContextWalker.cs
- UnmanagedMemoryStream.cs
- basevalidator.cs
- AnnotationObservableCollection.cs
- WebPartConnectionsConfigureVerb.cs
- JulianCalendar.cs
- UpdatePanelTrigger.cs
- DefaultAssemblyResolver.cs
- WsatTransactionHeader.cs
- InternalPolicyElement.cs
- BCryptHashAlgorithm.cs
- WpfKnownMemberInvoker.cs
- PrimitiveDataContract.cs
- DefaultEventAttribute.cs
- ScriptControl.cs
- MarkupExtensionParser.cs
- RadioButtonBaseAdapter.cs
- EventHandlerService.cs
- Walker.cs
- MatrixTransform3D.cs
- WebDescriptionAttribute.cs
- SiteMembershipCondition.cs
- SqlTrackingQuery.cs
- RemotingException.cs
- NameValueFileSectionHandler.cs
- SignatureHelper.cs
- PrtCap_Public.cs
- SkipStoryboardToFill.cs
- RelationshipFixer.cs
- WebControlToolBoxItem.cs
- Parameter.cs
- TextElementEnumerator.cs
- Win32.cs
- PriorityItem.cs
- DbProviderServices.cs
- ObjectSecurity.cs
- TypeContext.cs
- CompiledXpathExpr.cs
- GestureRecognitionResult.cs
- MinMaxParagraphWidth.cs
- JoinQueryOperator.cs
- _NtlmClient.cs
- XPathMultyIterator.cs
- UpdateProgress.cs
- GenericUI.cs
- RIPEMD160Managed.cs
- BinaryObjectReader.cs
- NamedPipeHostedTransportConfiguration.cs
- CqlLexerHelpers.cs
- CollectionViewSource.cs
- InfocardClientCredentials.cs
- ReferentialConstraint.cs
- ETagAttribute.cs
- DataGridViewCellFormattingEventArgs.cs
- DesignerSerializationOptionsAttribute.cs
- LingerOption.cs
- UserControlBuildProvider.cs
- RegexTree.cs
- Converter.cs
- sqlstateclientmanager.cs
- LambdaCompiler.cs
- ModifiableIteratorCollection.cs
- RootCodeDomSerializer.cs
- MetabaseServerConfig.cs
- MarkupCompilePass2.cs
- bidPrivateBase.cs
- HealthMonitoringSectionHelper.cs
- VirtualPathData.cs
- InstanceDescriptor.cs
- FloatAverageAggregationOperator.cs
- SystemInfo.cs