Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / AdvancedBindingEditor.cs / 1 / AdvancedBindingEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms.Design { using System; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Drawing; using System.Drawing.Design; using System.Windows.Forms; ////// /// internal class AdvancedBindingEditor : UITypeEditor { private BindingFormattingDialog bindingFormattingDialog; ///Provides an editor to edit advanced binding objects. ////// /// public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (provider != null) { IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); IDesignerHost host = provider.GetService(typeof(IDesignerHost)) as IDesignerHost; if (edSvc != null && host != null) { if (bindingFormattingDialog == null) { bindingFormattingDialog = new BindingFormattingDialog(); } bindingFormattingDialog.Context = context; bindingFormattingDialog.Bindings = (ControlBindingsCollection) value; bindingFormattingDialog.Host = host; using (DesignerTransaction t = host.CreateTransaction()) { edSvc.ShowDialog(bindingFormattingDialog); if (bindingFormattingDialog.Dirty) { // since the bindings may have changed, the properties listed in the properties window // need to be refreshed System.Diagnostics.Debug.Assert(context.Instance is ControlBindingsCollection); TypeDescriptor.Refresh(((ControlBindingsCollection)context.Instance).BindableComponent); if (t != null) { t.Commit(); } } else { t.Cancel(); } } } } return value; } ///Edits the specified value using the specified provider /// within the specified context. ////// /// public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) { return UITypeEditorEditStyle.Modal; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.Gets the edit style from the current context. ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SelectorAutomationPeer.cs
- ImageConverter.cs
- MimeImporter.cs
- DeviceSpecificChoiceCollection.cs
- XmlSchemaInclude.cs
- TerminatorSinks.cs
- DBParameter.cs
- FlowDecision.cs
- MouseEvent.cs
- HttpClientProtocol.cs
- figurelength.cs
- BaseUriHelper.cs
- SmiMetaDataProperty.cs
- DesignSurface.cs
- StructuredType.cs
- TypeDescriptor.cs
- WebResponse.cs
- CompilerCollection.cs
- ComponentDispatcher.cs
- ClientBuildManager.cs
- IIS7WorkerRequest.cs
- AuthenticationModuleElementCollection.cs
- RenderContext.cs
- columnmapkeybuilder.cs
- SingleKeyFrameCollection.cs
- XmlSchemaType.cs
- SByte.cs
- DataGridViewCellFormattingEventArgs.cs
- handlecollector.cs
- SpnEndpointIdentityExtension.cs
- Parser.cs
- HttpCookiesSection.cs
- XmlDataSource.cs
- TextWriterTraceListener.cs
- SqlDataSource.cs
- UdpTransportSettingsElement.cs
- ThreadInterruptedException.cs
- FormClosingEvent.cs
- WindowsListViewItem.cs
- OleDbSchemaGuid.cs
- dbenumerator.cs
- Mouse.cs
- XmlChoiceIdentifierAttribute.cs
- BrowserCapabilitiesFactory.cs
- HttpModuleCollection.cs
- MessageDescription.cs
- CapabilitiesRule.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- Rectangle.cs
- ObfuscateAssemblyAttribute.cs
- GeometryModel3D.cs
- SqlTriggerAttribute.cs
- StrongNameMembershipCondition.cs
- ErrorStyle.cs
- Repeater.cs
- PropertyIDSet.cs
- RelativeSource.cs
- RegexParser.cs
- CustomAttributeFormatException.cs
- HwndHost.cs
- Misc.cs
- ObjectDataSourceDisposingEventArgs.cs
- ConfigUtil.cs
- SafeWaitHandle.cs
- TileBrush.cs
- PropertyPathConverter.cs
- _ScatterGatherBuffers.cs
- CodeValidator.cs
- MarshalByValueComponent.cs
- PointLight.cs
- DmlSqlGenerator.cs
- ValidationPropertyAttribute.cs
- StaticResourceExtension.cs
- DynamicPropertyHolder.cs
- sqlpipe.cs
- Quaternion.cs
- FactoryMaker.cs
- RootProfilePropertySettingsCollection.cs
- DataContext.cs
- RuleProcessor.cs
- SiteMapDataSourceView.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- XmlWrappingReader.cs
- ClientTargetCollection.cs
- IgnoreSectionHandler.cs
- AutomationPropertyInfo.cs
- GACIdentityPermission.cs
- DropSource.cs
- ObjectStateManager.cs
- EmulateRecognizeCompletedEventArgs.cs
- HttpWebRequestElement.cs
- Pointer.cs
- AsyncOperationLifetimeManager.cs
- DescendentsWalkerBase.cs
- RelatedView.cs
- HatchBrush.cs
- MSG.cs
- ClassData.cs
- Int32.cs
- ParentUndoUnit.cs