Code:
/ DotNET / DotNET / 8.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
- ConstraintEnumerator.cs
- TTSEngineTypes.cs
- HttpProfileGroupBase.cs
- EncodingTable.cs
- ContentPosition.cs
- ExpandableObjectConverter.cs
- HttpRequest.cs
- TypeDependencyAttribute.cs
- RelationshipEnd.cs
- ImplicitInputBrush.cs
- NullableBoolConverter.cs
- SettingsAttributes.cs
- FixedDocument.cs
- StructuralObject.cs
- FontResourceCache.cs
- HtmlInputRadioButton.cs
- ExecutionScope.cs
- SettingsProperty.cs
- PropertyPushdownHelper.cs
- EventProviderWriter.cs
- ToolStripKeyboardHandlingService.cs
- Literal.cs
- TempFiles.cs
- OledbConnectionStringbuilder.cs
- HttpProfileGroupBase.cs
- ZipPackagePart.cs
- NonSerializedAttribute.cs
- ResourceCategoryAttribute.cs
- FontFamily.cs
- TextFormatterHost.cs
- ControlPropertyNameConverter.cs
- SqlBulkCopy.cs
- OutputCacheEntry.cs
- OracleColumn.cs
- SqlDataSourceConfigureSelectPanel.cs
- DbModificationCommandTree.cs
- SafeNativeMethods.cs
- MessageProtectionOrder.cs
- PropertyDescriptorGridEntry.cs
- DoubleAnimationBase.cs
- mda.cs
- CodeMethodInvokeExpression.cs
- TabletDeviceInfo.cs
- IdentityHolder.cs
- AutomationPropertyInfo.cs
- SchemaType.cs
- OracleRowUpdatingEventArgs.cs
- TimeStampChecker.cs
- FileLogRecord.cs
- AdRotator.cs
- HwndKeyboardInputProvider.cs
- HMAC.cs
- XmlDocumentFragment.cs
- ConditionCollection.cs
- ConfigurationProviderException.cs
- PathFigureCollectionValueSerializer.cs
- ResourceDictionaryCollection.cs
- DataGridViewCellPaintingEventArgs.cs
- RequestQueryParser.cs
- PrinterSettings.cs
- WeakEventManager.cs
- HatchBrush.cs
- CleanUpVirtualizedItemEventArgs.cs
- StringFunctions.cs
- Transform3D.cs
- SqlServer2KCompatibilityCheck.cs
- Deserializer.cs
- SqlFunctionAttribute.cs
- XmlAttributeProperties.cs
- ServiceObjectContainer.cs
- ImportDesigner.xaml.cs
- FormatException.cs
- TableRowCollection.cs
- LinearKeyFrames.cs
- ExtendedTransformFactory.cs
- LineServices.cs
- BindingCompleteEventArgs.cs
- EntityCollectionChangedParams.cs
- AddInActivator.cs
- GridProviderWrapper.cs
- GregorianCalendarHelper.cs
- ProjectedSlot.cs
- ExceptionWrapper.cs
- CompensationParticipant.cs
- PeerCustomResolverBindingElement.cs
- Parameter.cs
- SchemeSettingElementCollection.cs
- DesignerDataView.cs
- XamlReaderHelper.cs
- PropertyEmitterBase.cs
- _FixedSizeReader.cs
- Propagator.JoinPropagator.cs
- GridLength.cs
- SctClaimSerializer.cs
- SqlTypeSystemProvider.cs
- HtmlContainerControl.cs
- DataColumnMapping.cs
- _ShellExpression.cs
- TabControlEvent.cs
- DocumentPageTextView.cs