Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ // // 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
- HtmlControl.cs
- PolyQuadraticBezierSegment.cs
- TextEditorTables.cs
- SafeHandles.cs
- MeasurementDCInfo.cs
- TimersDescriptionAttribute.cs
- WebPartTransformer.cs
- FontCollection.cs
- XslTransform.cs
- Page.cs
- SchemaTypeEmitter.cs
- EntityDataSourceChangingEventArgs.cs
- MergeFilterQuery.cs
- XmlSchemaProviderAttribute.cs
- ColorAnimationUsingKeyFrames.cs
- DSACryptoServiceProvider.cs
- HtmlTableCell.cs
- ResourcePermissionBaseEntry.cs
- ParserHooks.cs
- WinFormsComponentEditor.cs
- TransactionFilter.cs
- OleDbFactory.cs
- BinaryNode.cs
- MessageQueuePermissionEntryCollection.cs
- EventSetter.cs
- GPStream.cs
- Drawing.cs
- PageStatePersister.cs
- CustomCategoryAttribute.cs
- System.Data_BID.cs
- ByteStreamGeometryContext.cs
- DataRelationCollection.cs
- JavascriptCallbackMessageInspector.cs
- ApplicationServiceHelper.cs
- SupportedAddressingMode.cs
- TypeEnumerableViewSchema.cs
- LocatorManager.cs
- ParserContext.cs
- ValidationErrorCollection.cs
- RSAOAEPKeyExchangeDeformatter.cs
- KeyValueInternalCollection.cs
- ProxyAttribute.cs
- HttpRequestCacheValidator.cs
- Error.cs
- HttpBindingExtension.cs
- UniqueIdentifierService.cs
- ConnectionPoolManager.cs
- TraversalRequest.cs
- MethodExpression.cs
- Comparer.cs
- ValueUnavailableException.cs
- SerializationEventsCache.cs
- RegisteredArrayDeclaration.cs
- SqlNotificationRequest.cs
- ContainerVisual.cs
- PrimitiveXmlSerializers.cs
- Soap.cs
- AlignmentYValidation.cs
- GB18030Encoding.cs
- AssemblyHelper.cs
- OleDbParameter.cs
- DataGridTextBox.cs
- SR.Designer.cs
- ButtonAutomationPeer.cs
- PerspectiveCamera.cs
- ScriptDescriptor.cs
- Property.cs
- RegexInterpreter.cs
- _BaseOverlappedAsyncResult.cs
- AlphabeticalEnumConverter.cs
- DirectoryObjectSecurity.cs
- TypeDescriptorFilterService.cs
- GeneralTransformCollection.cs
- XmlAnyAttributeAttribute.cs
- PackageDigitalSignature.cs
- SmtpException.cs
- CategoryValueConverter.cs
- DecimalMinMaxAggregationOperator.cs
- TreeViewCancelEvent.cs
- EditorPart.cs
- Stylesheet.cs
- CalendarDateRange.cs
- PriorityBinding.cs
- storepermission.cs
- _DigestClient.cs
- ListControlBoundActionList.cs
- path.cs
- _NtlmClient.cs
- XappLauncher.cs
- JsonReader.cs
- ApplicationGesture.cs
- EntityClassGenerator.cs
- CodeSnippetTypeMember.cs
- ItemMap.cs
- TextEndOfParagraph.cs
- StringUtil.cs
- DataGridViewSelectedCellCollection.cs
- DataGridPageChangedEventArgs.cs
- Volatile.cs
- SplitterEvent.cs