Code:
/ DotNET / DotNET / 8.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
- xdrvalidator.cs
- ShortcutKeysEditor.cs
- DataObjectFieldAttribute.cs
- ContainerParagraph.cs
- QuaternionRotation3D.cs
- XmlEventCache.cs
- ReverseInheritProperty.cs
- DataControlButton.cs
- RunInstallerAttribute.cs
- OleDbParameter.cs
- IPipelineRuntime.cs
- ProxyAttribute.cs
- XmlSchemaInclude.cs
- GridErrorDlg.cs
- RoleManagerModule.cs
- StreamGeometryContext.cs
- HttpChannelFactory.cs
- Switch.cs
- Validator.cs
- AppDomainManager.cs
- Keywords.cs
- XmlMemberMapping.cs
- TagNameToTypeMapper.cs
- TreeViewTemplateSelector.cs
- WebPermission.cs
- CallbackValidator.cs
- ValueTable.cs
- FragmentQueryProcessor.cs
- AnnotationStore.cs
- ToolBarButton.cs
- NamespaceMapping.cs
- EntityReference.cs
- ConfigurationException.cs
- BitmapEffectOutputConnector.cs
- SafeBitVector32.cs
- ExpressionPrefixAttribute.cs
- PointHitTestParameters.cs
- NativeMethods.cs
- XmlIncludeAttribute.cs
- StreamUpdate.cs
- DropSource.cs
- EntityTypeEmitter.cs
- CngProperty.cs
- RepeatBehavior.cs
- ObjectMemberMapping.cs
- SmtpAuthenticationManager.cs
- SqlVersion.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- PriorityBindingExpression.cs
- SchemaObjectWriter.cs
- ReachPageContentSerializer.cs
- _FtpControlStream.cs
- BrowserCapabilitiesFactory35.cs
- WebPartEditorCancelVerb.cs
- DataSourceCacheDurationConverter.cs
- ThreadAttributes.cs
- DataGridViewLinkCell.cs
- TextDecorations.cs
- SafeNativeMethods.cs
- PenContexts.cs
- DocumentDesigner.cs
- ThreadExceptionDialog.cs
- RijndaelManaged.cs
- ContextMenu.cs
- SoapElementAttribute.cs
- KeyedPriorityQueue.cs
- ListView.cs
- BasicDesignerLoader.cs
- DummyDataSource.cs
- PerfCounters.cs
- ScaleTransform.cs
- ActiveXHost.cs
- SHA512Managed.cs
- TemplateKey.cs
- EDesignUtil.cs
- DesignerView.Commands.cs
- EventManager.cs
- CompilerWrapper.cs
- EventDescriptorCollection.cs
- ClientFormsAuthenticationMembershipProvider.cs
- PointLight.cs
- SettingsContext.cs
- MembershipUser.cs
- HwndKeyboardInputProvider.cs
- EventsTab.cs
- InfoCardArgumentException.cs
- UInt32Converter.cs
- RegisteredScript.cs
- HostedElements.cs
- CreateSequence.cs
- SafeNativeMethods.cs
- LinqDataView.cs
- ResolvedKeyFrameEntry.cs
- ContentDefinition.cs
- VectorAnimation.cs
- Table.cs
- SafeFileMappingHandle.cs
- _NativeSSPI.cs
- ClusterUtils.cs
- SmiRequestExecutor.cs