Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / entitydatasourceentitysetnameconverter.cs / 1305376 / entitydatasourceentitysetnameconverter.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 EntityDataSourceEntitySetNameConverter : StringConverter { public EntityDataSourceEntitySetNameConverter() : base() { } public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { // We can only get a list of possible EntitySetName values if we have: // (1) Connection string so we can load metadata // (2) DefaultContainerName to give scope to the lookup // Even if these values are set, it may not be possible to actually find them in metadata, but at least we can try the lookup if requested EntityDataSource entityDataSource = context.Instance as EntityDataSource; if (entityDataSource != null && !String.IsNullOrEmpty(entityDataSource.ConnectionString) && !String.IsNullOrEmpty(entityDataSource.DefaultContainerName)) { ListentitySetNameItems = new EntityDataSourceDesignerHelper(entityDataSource, false /*interactiveMode*/).GetEntitySets(entityDataSource.DefaultContainerName); string[] entitySetNames = new string[entitySetNameItems.Count]; for (int i = 0; i < entitySetNameItems.Count; i++) { entitySetNames[i] = entitySetNameItems[i].EntitySetName; } return new StandardValuesCollection(entitySetNames); } 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
- Container.cs
- ImportedPolicyConversionContext.cs
- HebrewNumber.cs
- SqlRewriteScalarSubqueries.cs
- MatrixTransform.cs
- ProfileBuildProvider.cs
- ScriptControlManager.cs
- httpstaticobjectscollection.cs
- SemaphoreSecurity.cs
- BindingWorker.cs
- XmlTypeMapping.cs
- HttpProfileBase.cs
- NativeMethods.cs
- CompositeScriptReferenceEventArgs.cs
- CodePageEncoding.cs
- CompleteWizardStep.cs
- LiteralText.cs
- FigureParagraph.cs
- Empty.cs
- IssuerInformation.cs
- ImageCodecInfo.cs
- FigureParaClient.cs
- X509Certificate.cs
- NamespaceEmitter.cs
- RequestSecurityToken.cs
- AppDomainEvidenceFactory.cs
- Identity.cs
- XmlSchemaImport.cs
- BaseTemplateParser.cs
- LinkLabel.cs
- ButtonBaseAdapter.cs
- TriState.cs
- AttributeAction.cs
- ImplicitInputBrush.cs
- FrameworkContentElement.cs
- BasicExpandProvider.cs
- ThreadStaticAttribute.cs
- GenerateTemporaryAssemblyTask.cs
- EncoderReplacementFallback.cs
- Win32PrintDialog.cs
- ProtocolViolationException.cs
- basenumberconverter.cs
- ConstructorNeedsTagAttribute.cs
- SimpleExpression.cs
- ManualResetEvent.cs
- ContractAdapter.cs
- SqlReferenceCollection.cs
- GestureRecognitionResult.cs
- RequestUriProcessor.cs
- CreateInstanceBinder.cs
- RIPEMD160Managed.cs
- ViewCellSlot.cs
- MatrixTransform3D.cs
- Setter.cs
- SecureEnvironment.cs
- IntSecurity.cs
- SqlDependency.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- SimpleApplicationHost.cs
- MethodRental.cs
- SqlUdtInfo.cs
- DbSource.cs
- UIElementIsland.cs
- HyperLinkStyle.cs
- MailDefinition.cs
- DataGridHyperlinkColumn.cs
- ByteRangeDownloader.cs
- ArgumentNullException.cs
- DesignerTransaction.cs
- QueryExtender.cs
- LoadWorkflowAsyncResult.cs
- CodeVariableDeclarationStatement.cs
- NewItemsContextMenuStrip.cs
- BamlReader.cs
- BaseDataListPage.cs
- Emitter.cs
- UTF7Encoding.cs
- OleDbWrapper.cs
- MsmqAppDomainProtocolHandler.cs
- SQLString.cs
- StylusButtonCollection.cs
- DelimitedListTraceListener.cs
- FieldTemplateUserControl.cs
- StandardCommands.cs
- ExpressionCopier.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- UnSafeCharBuffer.cs
- IItemContainerGenerator.cs
- XmlQuerySequence.cs
- FixedDocumentPaginator.cs
- HttpResponseBase.cs
- DoubleCollectionValueSerializer.cs
- XmlSchemaSimpleContent.cs
- RandomNumberGenerator.cs
- MeasureItemEvent.cs
- XmlNullResolver.cs
- ComponentConverter.cs
- PackageDigitalSignatureManager.cs
- DetailsViewAutoFormat.cs
- EntityContainerAssociationSetEnd.cs