Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / entitydatasourceentitysetnameconverter.cs / 3 / 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. //------------------------------------------------------------------------------ // // 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
- NameTable.cs
- IPHostEntry.cs
- PinnedBufferMemoryStream.cs
- SeekStoryboard.cs
- EditorBrowsableAttribute.cs
- TransformedBitmap.cs
- MarkupExtensionReturnTypeAttribute.cs
- ApplicationManager.cs
- IncomingWebResponseContext.cs
- DESCryptoServiceProvider.cs
- UInt16Converter.cs
- ListSortDescription.cs
- XmlUtil.cs
- BooleanAnimationUsingKeyFrames.cs
- ConfigurationLocationCollection.cs
- CodeGen.cs
- AddressHeader.cs
- DesignSurfaceEvent.cs
- DefaultTextStore.cs
- UnsafeNativeMethods.cs
- DomNameTable.cs
- PostBackTrigger.cs
- FontEditor.cs
- TextRangeSerialization.cs
- WebPartDescriptionCollection.cs
- PathFigureCollection.cs
- ResolveDuplexAsyncResult.cs
- loginstatus.cs
- FilteredDataSetHelper.cs
- SemanticTag.cs
- AssociationSet.cs
- FontWeights.cs
- ViewManager.cs
- WindowsFont.cs
- EnterpriseServicesHelper.cs
- X509InitiatorCertificateServiceElement.cs
- CodeCatchClauseCollection.cs
- baseaxisquery.cs
- HScrollProperties.cs
- EventLogPermission.cs
- AutomationPropertyInfo.cs
- DataSourceDescriptorCollection.cs
- QuaternionAnimation.cs
- TabletDeviceInfo.cs
- CodeCatchClauseCollection.cs
- MenuItemBindingCollection.cs
- SQLBytesStorage.cs
- WindowsContainer.cs
- TransactionException.cs
- ImmutableCollection.cs
- DataGridTablesFactory.cs
- Filter.cs
- Point3DCollection.cs
- WebPartConnection.cs
- SpanIndex.cs
- AdapterUtil.cs
- XmlSerializerNamespaces.cs
- CodeConditionStatement.cs
- XamlReaderHelper.cs
- EllipseGeometry.cs
- AjaxFrameworkAssemblyAttribute.cs
- FontStretchConverter.cs
- AcceleratedTokenProvider.cs
- SignedXml.cs
- HtmlShim.cs
- OuterGlowBitmapEffect.cs
- SQLString.cs
- Timeline.cs
- DataGridViewDataConnection.cs
- SafeCoTaskMem.cs
- ModuleBuilder.cs
- ColumnTypeConverter.cs
- RawStylusInputCustomData.cs
- VerticalAlignConverter.cs
- SyntaxCheck.cs
- InitiatorSessionSymmetricMessageSecurityProtocol.cs
- ToolStripPanelSelectionGlyph.cs
- SemaphoreSecurity.cs
- NetworkAddressChange.cs
- BindStream.cs
- UITypeEditor.cs
- RawStylusInputCustomDataList.cs
- HMACRIPEMD160.cs
- BindingMAnagerBase.cs
- Int32Storage.cs
- NegotiationTokenProvider.cs
- Point3DCollection.cs
- SerializerWriterEventHandlers.cs
- EditorZoneDesigner.cs
- StrokeDescriptor.cs
- ReceiveParametersContent.cs
- CqlErrorHelper.cs
- WorkflowEnvironment.cs
- GlyphElement.cs
- ToolStripStatusLabel.cs
- DBConnection.cs
- ScriptHandlerFactory.cs
- BitFlagsGenerator.cs
- ServiceHttpModule.cs
- ZipPackage.cs