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
- ModelItemDictionaryImpl.cs
- FormsIdentity.cs
- StylusPlugin.cs
- SourceElementsCollection.cs
- TraceHandlerErrorFormatter.cs
- _OverlappedAsyncResult.cs
- TraceHandler.cs
- WebBaseEventKeyComparer.cs
- ACL.cs
- FontStretches.cs
- FontWeight.cs
- RefreshPropertiesAttribute.cs
- CodeGotoStatement.cs
- XmlSchemaDocumentation.cs
- TypeBinaryExpression.cs
- AbstractSvcMapFileLoader.cs
- HtmlEmptyTagControlBuilder.cs
- CodeEntryPointMethod.cs
- OutputCacheProfile.cs
- TraversalRequest.cs
- DataServiceException.cs
- ScriptReferenceEventArgs.cs
- PagesSection.cs
- BinaryObjectInfo.cs
- ChannelServices.cs
- SqlClientPermission.cs
- validationstate.cs
- TransactionProxy.cs
- PropertyDescriptor.cs
- ControlPropertyNameConverter.cs
- CodeCommentStatementCollection.cs
- NavigationPropertyEmitter.cs
- CustomValidator.cs
- UniqueConstraint.cs
- StylusPoint.cs
- TextDocumentView.cs
- NullableLongAverageAggregationOperator.cs
- CompensationDesigner.cs
- _LazyAsyncResult.cs
- ToolStripPanelRenderEventArgs.cs
- FixedSOMPageElement.cs
- ObjectSet.cs
- SqlFormatter.cs
- RegexGroup.cs
- StyleXamlTreeBuilder.cs
- ToolStripSeparator.cs
- RepeatBehavior.cs
- Vector3DConverter.cs
- FieldMetadata.cs
- SelectionItemProviderWrapper.cs
- ListBoxDesigner.cs
- XMLDiffLoader.cs
- exports.cs
- HttpCapabilitiesSectionHandler.cs
- PathBox.cs
- FormsAuthenticationEventArgs.cs
- BookmarkEventArgs.cs
- DbConnectionPool.cs
- AutomationAttributeInfo.cs
- DynamicContractTypeBuilder.cs
- DesignTimeVisibleAttribute.cs
- XmlWellformedWriter.cs
- WorkflowInvoker.cs
- ImageFormatConverter.cs
- ColorTranslator.cs
- BaseTransportHeaders.cs
- ReachVisualSerializer.cs
- RectConverter.cs
- DocumentEventArgs.cs
- _IPv6Address.cs
- SoapAttributes.cs
- EntityDataSourceChangingEventArgs.cs
- WindowsSolidBrush.cs
- CustomBindingElement.cs
- NumericUpDownAccelerationCollection.cs
- QueryInterceptorAttribute.cs
- LinkButton.cs
- EmbeddedMailObject.cs
- PackWebResponse.cs
- ThreadStateException.cs
- EmptyCollection.cs
- ContextInformation.cs
- NullableBoolConverter.cs
- StorageEndPropertyMapping.cs
- AdornerPresentationContext.cs
- UrlMappingsSection.cs
- PrintPreviewDialog.cs
- BatchServiceHost.cs
- HttpFileCollection.cs
- CodeAttachEventStatement.cs
- returneventsaver.cs
- DataGridParentRows.cs
- TabPanel.cs
- mediaeventshelper.cs
- PathSegmentCollection.cs
- TemplateManager.cs
- DirectionalLight.cs
- HtmlMeta.cs
- SetStateDesigner.cs
- Thread.cs