Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / DataMemberFieldEditor.cs / 1 / DataMemberFieldEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="System.Windows.Forms.Design.DataMemberFieldEditor..ctor()")] namespace System.Windows.Forms.Design { using System; using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using System.Drawing.Design; using System.Design; internal class DataMemberFieldEditor : UITypeEditor { private DesignBindingPicker designBindingPicker; public override bool IsDropDownResizable { get { return true; } } public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (provider != null && context.Instance != null) { PropertyDescriptor dataSourceProperty = TypeDescriptor.GetProperties(context.Instance)["DataSource"]; if (dataSourceProperty != null) { object dataSource = dataSourceProperty.GetValue(context.Instance); if (designBindingPicker == null) { designBindingPicker = new DesignBindingPicker(); } DesignBinding oldSelection = new DesignBinding(dataSource, (string) value); DesignBinding newSelection = designBindingPicker.Pick(context, provider, false, /* showDataSources */ true, /* showDataMembers */ false, /* selectListMembers */ dataSource, String.Empty, oldSelection); if (dataSource != null && 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
- SmtpSpecifiedPickupDirectoryElement.cs
- SqlConnectionStringBuilder.cs
- EncryptedType.cs
- DocumentCollection.cs
- SizeChangedInfo.cs
- ReachObjectContext.cs
- DataPagerFieldCollection.cs
- ConditionalAttribute.cs
- DataKey.cs
- AutoCompleteStringCollection.cs
- PageHandlerFactory.cs
- DataGridViewEditingControlShowingEventArgs.cs
- DataGridViewSelectedRowCollection.cs
- CapacityStreamGeometryContext.cs
- Base64Decoder.cs
- StringReader.cs
- AddingNewEventArgs.cs
- PeerService.cs
- Simplifier.cs
- Transform3DGroup.cs
- InputLanguageEventArgs.cs
- GPStream.cs
- InstanceDescriptor.cs
- FloaterBaseParaClient.cs
- KeyEventArgs.cs
- SafeFileMapViewHandle.cs
- HttpDictionary.cs
- WpfKnownMemberInvoker.cs
- UnsafeNativeMethods.cs
- ToolStripDropDownClosingEventArgs.cs
- ServiceDescriptionImporter.cs
- SvcMapFileSerializer.cs
- Transform3DGroup.cs
- CompilerCollection.cs
- BaseValidator.cs
- Polyline.cs
- WindowsListViewGroupHelper.cs
- GenericAuthenticationEventArgs.cs
- VectorAnimationBase.cs
- DateBoldEvent.cs
- ObjectNotFoundException.cs
- MobileCategoryAttribute.cs
- XhtmlBasicLinkAdapter.cs
- ConfigurationPropertyCollection.cs
- QueryOpeningEnumerator.cs
- Facet.cs
- keycontainerpermission.cs
- XmlDocumentSerializer.cs
- InputLangChangeEvent.cs
- FixedSOMPageElement.cs
- RadioButtonPopupAdapter.cs
- FileUpload.cs
- IxmlLineInfo.cs
- FormViewDeleteEventArgs.cs
- CalendarDateRangeChangingEventArgs.cs
- OuterProxyWrapper.cs
- DataServiceQueryOfT.cs
- SecurityTokenAttachmentMode.cs
- ExceptionUtility.cs
- DataProviderNameConverter.cs
- MarkupExtensionSerializer.cs
- HtmlGenericControl.cs
- DecimalSumAggregationOperator.cs
- CodeIndexerExpression.cs
- RegexFCD.cs
- PropertyStore.cs
- XmlEntityReference.cs
- TypeSystemProvider.cs
- ScriptDescriptor.cs
- UmAlQuraCalendar.cs
- IisTraceListener.cs
- EmptyControlCollection.cs
- ConnectionManagementElementCollection.cs
- TemplateApplicationHelper.cs
- PageBuildProvider.cs
- OneOfTypeConst.cs
- RequiredFieldValidator.cs
- EditorZoneBase.cs
- SafeRightsManagementHandle.cs
- TextServicesCompartmentContext.cs
- ExportFileRequest.cs
- XmlSchemaInferenceException.cs
- PeerCollaboration.cs
- VerticalAlignConverter.cs
- SchemaNames.cs
- localization.cs
- DatasetMethodGenerator.cs
- HighlightComponent.cs
- OLEDB_Util.cs
- RtfNavigator.cs
- ListMarkerSourceInfo.cs
- Int32AnimationUsingKeyFrames.cs
- OperationCanceledException.cs
- ScrollViewer.cs
- ToggleButtonAutomationPeer.cs
- ZipIOLocalFileBlock.cs
- DerivedKeySecurityToken.cs
- SectionXmlInfo.cs
- ContainerCodeDomSerializer.cs
- SafeRightsManagementQueryHandle.cs