Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / DataMemberListEditor.cs / 1 / DataMemberListEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="System.Windows.Forms.Design.DataMemberListEditor..ctor()")] namespace System.Windows.Forms.Design { using System.Design; using System; using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using System.Drawing.Design; internal class DataMemberListEditor : 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 */ true, /* 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
- SeekableReadStream.cs
- _emptywebproxy.cs
- HtmlTableCellCollection.cs
- ComplexTypeEmitter.cs
- AutomationProperty.cs
- XhtmlBasicListAdapter.cs
- EntityDataReader.cs
- RenderingBiasValidation.cs
- OSEnvironmentHelper.cs
- WinFormsSecurity.cs
- EncodingNLS.cs
- ProfilePropertyMetadata.cs
- HostedBindingBehavior.cs
- PropertyChangedEventManager.cs
- BaseResourcesBuildProvider.cs
- ListViewInsertionMark.cs
- CompositeKey.cs
- Bitmap.cs
- SecuritySessionSecurityTokenProvider.cs
- PageHandlerFactory.cs
- DataGridViewRowPrePaintEventArgs.cs
- CallTemplateAction.cs
- HtmlAnchor.cs
- Int16Storage.cs
- ScriptingWebServicesSectionGroup.cs
- SurrogateDataContract.cs
- ScrollPatternIdentifiers.cs
- ObjectStorage.cs
- ExtensionWindowResizeGrip.cs
- ResourceDictionaryCollection.cs
- TimeoutValidationAttribute.cs
- FrameworkElement.cs
- SelectionRange.cs
- SchemaComplexType.cs
- WebPartTransformerAttribute.cs
- hresults.cs
- mactripleDES.cs
- PersonalizationStateQuery.cs
- _SslStream.cs
- ParameterInfo.cs
- BufferedStream.cs
- AliasedExpr.cs
- DefaultWorkflowTransactionService.cs
- InputBuffer.cs
- ProtectedProviderSettings.cs
- JsonWriter.cs
- StickyNoteAnnotations.cs
- ParameterToken.cs
- UnsafeNativeMethods.cs
- ObjectDataSourceSelectingEventArgs.cs
- BaseAutoFormat.cs
- DiagnosticsConfiguration.cs
- WorkflowRuntimeServiceElementCollection.cs
- SqlDataSourceEnumerator.cs
- localization.cs
- SoundPlayerAction.cs
- QilLiteral.cs
- ReadOnlyDictionary.cs
- Decoder.cs
- SyndicationSerializer.cs
- Transform.cs
- PropertyAccessVisitor.cs
- ListViewDeleteEventArgs.cs
- DoubleIndependentAnimationStorage.cs
- IApplicationTrustManager.cs
- Listbox.cs
- COM2PropertyDescriptor.cs
- ExtendedPropertyDescriptor.cs
- DesignerCommandSet.cs
- ToolStripSettings.cs
- QuadraticBezierSegment.cs
- LineGeometry.cs
- XmlSchemaSimpleTypeUnion.cs
- XsdDateTime.cs
- XmlEnumAttribute.cs
- ByteStack.cs
- OleDbConnection.cs
- PeerInvitationResponse.cs
- ExpressionLink.cs
- TextDataBindingHandler.cs
- DocumentSignatureManager.cs
- DataSysAttribute.cs
- MatrixTransform3D.cs
- SystemIcons.cs
- CheckoutException.cs
- ProviderSettingsCollection.cs
- ListViewItem.cs
- RoleManagerEventArgs.cs
- LabelTarget.cs
- QuerySettings.cs
- Scheduler.cs
- ClassHandlersStore.cs
- InvalidComObjectException.cs
- WinEventTracker.cs
- WebPartExportVerb.cs
- WindowsTokenRoleProvider.cs
- TemplateBindingExpression.cs
- TimeSpanSecondsConverter.cs
- LogicalExpr.cs
- DBAsyncResult.cs