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
- MarkerProperties.cs
- VectorAnimation.cs
- TemplateControlBuildProvider.cs
- ThreadPool.cs
- WebConfigurationFileMap.cs
- Keyboard.cs
- Highlights.cs
- MenuItem.cs
- PrivateFontCollection.cs
- StringInfo.cs
- DashStyle.cs
- DeclaredTypeValidatorAttribute.cs
- SqlClientMetaDataCollectionNames.cs
- FlowSwitchLink.cs
- Pens.cs
- SafeNativeMethods.cs
- WpfKnownType.cs
- CharacterHit.cs
- GifBitmapEncoder.cs
- ColumnMapCopier.cs
- XamlSerializerUtil.cs
- Environment.cs
- FileLogRecordHeader.cs
- ObjectCloneHelper.cs
- ScrollPattern.cs
- DataGridViewColumnConverter.cs
- ComAdminWrapper.cs
- DataSourceGroupCollection.cs
- WsdlParser.cs
- PreviewKeyDownEventArgs.cs
- smtpconnection.cs
- EpmHelper.cs
- CatalogZone.cs
- MarkupExtensionParser.cs
- ArraySet.cs
- SQLBinaryStorage.cs
- EmptyStringExpandableObjectConverter.cs
- WindowsFont.cs
- ScriptingWebServicesSectionGroup.cs
- EventProviderClassic.cs
- ProbeDuplex11AsyncResult.cs
- SamlAuthenticationStatement.cs
- DataBoundControlActionList.cs
- KeyConstraint.cs
- DoWorkEventArgs.cs
- AppModelKnownContentFactory.cs
- ConnectionPool.cs
- ProviderUtil.cs
- GenericEnumConverter.cs
- ColumnReorderedEventArgs.cs
- NeutralResourcesLanguageAttribute.cs
- SortQuery.cs
- ParentUndoUnit.cs
- SystemShuttingDownException.cs
- PeerNameRecordCollection.cs
- MultiView.cs
- MarkupCompilePass1.cs
- String.cs
- SharedTcpTransportManager.cs
- HeaderedItemsControl.cs
- EncoderFallback.cs
- DockProviderWrapper.cs
- TreeWalkHelper.cs
- _Semaphore.cs
- CanonicalXml.cs
- AnchoredBlock.cs
- RefreshEventArgs.cs
- CodeLabeledStatement.cs
- InitializationEventAttribute.cs
- ListItemConverter.cs
- hresults.cs
- UntypedNullExpression.cs
- NotifyCollectionChangedEventArgs.cs
- ColumnClickEvent.cs
- SecurityUtils.cs
- EntityContainerEntitySet.cs
- XmlSchemaObjectCollection.cs
- DocumentPageTextView.cs
- RayMeshGeometry3DHitTestResult.cs
- WindowVisualStateTracker.cs
- GrabHandleGlyph.cs
- CodePrimitiveExpression.cs
- IntSecurity.cs
- ColorBlend.cs
- TextTreeExtractElementUndoUnit.cs
- Comparer.cs
- SelectorAutomationPeer.cs
- MembershipAdapter.cs
- StatusBarItem.cs
- GeneralTransformGroup.cs
- KeyPressEvent.cs
- ModuleConfigurationInfo.cs
- CompiledQueryCacheEntry.cs
- SiteMapDataSource.cs
- pingexception.cs
- QilChoice.cs
- InkCanvasFeedbackAdorner.cs
- ViewStateModeByIdAttribute.cs
- Attributes.cs
- SqlSelectStatement.cs