Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / LinkedDataMemberFieldEditor.cs / 1 / LinkedDataMemberFieldEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="System.Windows.Forms.Design.LinkedDataMemberFieldEditor..ctor()")] namespace System.Windows.Forms.Design { using System; using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using System.Drawing.Design; internal class LinkedDataMemberFieldEditor : UITypeEditor { private DesignBindingPicker designBindingPicker; public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (provider != null && context.Instance != null) { PropertyDescriptor dataSourceProperty = TypeDescriptor.GetProperties(context.Instance)["LinkedDataSource"]; if (dataSourceProperty != null) { object dataSource = dataSourceProperty.GetValue(context.Instance); if (dataSource != null) { if (designBindingPicker == null) { designBindingPicker = new DesignBindingPicker(); } DesignBinding oldSelection = new DesignBinding(null, (string) value); DesignBinding newSelection = designBindingPicker.Pick(context, provider, false, /* showDataSources */ true, /* showDataMembers */ false, /* selectListMembers */ dataSource, String.Empty, oldSelection); if (newSelection != null) { value = newSelection.DataMember; } } } } return value; } public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) { return UITypeEditorEditStyle.DropDown; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataMemberListEditor.cs
- DatasetMethodGenerator.cs
- CapabilitiesUse.cs
- ObjectDataSourceChooseMethodsPanel.cs
- Polyline.cs
- IsolatedStorageFileStream.cs
- Point3DCollection.cs
- Directory.cs
- DefaultProxySection.cs
- WindowsUpDown.cs
- ConstraintCollection.cs
- RegistrySecurity.cs
- SQlBooleanStorage.cs
- IndependentAnimationStorage.cs
- DesignBindingConverter.cs
- initElementDictionary.cs
- ToolStripItemRenderEventArgs.cs
- formatter.cs
- ListBox.cs
- IssuanceTokenProviderState.cs
- SiteMembershipCondition.cs
- IsolatedStorage.cs
- InterleavedZipPartStream.cs
- ChannelServices.cs
- AuthStoreRoleProvider.cs
- XmlUtil.cs
- MediaElementAutomationPeer.cs
- AdapterDictionary.cs
- RelationshipEndCollection.cs
- AnnotationStore.cs
- DelimitedListTraceListener.cs
- RemoveStoryboard.cs
- HTTPNotFoundHandler.cs
- OutputCacheModule.cs
- RoleManagerModule.cs
- Point3DValueSerializer.cs
- FragmentQueryKB.cs
- SpeechSeg.cs
- RSAPKCS1SignatureFormatter.cs
- ElementAction.cs
- XNodeValidator.cs
- ViewBox.cs
- RelationshipConverter.cs
- InstanceView.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- OLEDB_Util.cs
- MasterPageCodeDomTreeGenerator.cs
- RemoteWebConfigurationHostServer.cs
- ErrorFormatter.cs
- ReadOnlyDictionary.cs
- XmlImplementation.cs
- DataShape.cs
- StreamReader.cs
- ImageClickEventArgs.cs
- InfoCardKeyedHashAlgorithm.cs
- XmlSchemaSimpleTypeUnion.cs
- ReferenceEqualityComparer.cs
- WebHttpSecurityElement.cs
- ExpressionNode.cs
- TripleDES.cs
- WpfPayload.cs
- SerializationException.cs
- PersonalizationAdministration.cs
- ValidationSummary.cs
- WebPartAddingEventArgs.cs
- QuaternionRotation3D.cs
- StateMachineTimers.cs
- Size3D.cs
- ClientRuntimeConfig.cs
- ComEventsHelper.cs
- SqlMethodCallConverter.cs
- EntityCollectionChangedParams.cs
- XamlTypeWithExplicitNamespace.cs
- QueryCacheEntry.cs
- BuilderInfo.cs
- Light.cs
- DtdParser.cs
- ClientSettingsSection.cs
- recordstate.cs
- Mappings.cs
- DefaultAssemblyResolver.cs
- hwndwrapper.cs
- Trace.cs
- XmlChildNodes.cs
- FormsIdentity.cs
- AssemblyAttributesGoHere.cs
- WindowsUpDown.cs
- fixedPageContentExtractor.cs
- CodeTypeDelegate.cs
- EntityContainerEmitter.cs
- UriWriter.cs
- CompilerErrorCollection.cs
- WorkflowQueue.cs
- LinqDataSourceView.cs
- ToolBarDesigner.cs
- SystemResourceHost.cs
- ConfigurationStrings.cs
- FormatStringEditor.cs
- DataGridViewAutoSizeModeEventArgs.cs
- MethodBuilder.cs