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
- CompModSwitches.cs
- BitVector32.cs
- CapabilitiesAssignment.cs
- XpsLiterals.cs
- Int32CAMarshaler.cs
- RuntimeResourceSet.cs
- PropertyInfoSet.cs
- unsafenativemethodstextservices.cs
- TextLine.cs
- sqlstateclientmanager.cs
- Root.cs
- MasterPageBuildProvider.cs
- EpmAttributeNameBuilder.cs
- ConstantSlot.cs
- SerTrace.cs
- BrowserCapabilitiesFactory.cs
- ObjectTypeMapping.cs
- ReadOnlyTernaryTree.cs
- MetadataItemSerializer.cs
- UserNameSecurityTokenAuthenticator.cs
- Rectangle.cs
- Part.cs
- CompiledRegexRunner.cs
- Rfc2898DeriveBytes.cs
- SelectionHighlightInfo.cs
- OperationPickerDialog.designer.cs
- MimeMapping.cs
- DSASignatureFormatter.cs
- VirtualPathProvider.cs
- DocumentGrid.cs
- XmlNullResolver.cs
- StringValueConverter.cs
- InfoCardListRequest.cs
- DefaultSerializationProviderAttribute.cs
- CompilerInfo.cs
- ReferenceService.cs
- ScriptResourceHandler.cs
- GraphicsPath.cs
- TransformedBitmap.cs
- LinqDataSourceView.cs
- FontNamesConverter.cs
- AttributeData.cs
- SmiRequestExecutor.cs
- HttpFileCollectionBase.cs
- CodeTypeConstructor.cs
- TableCellCollection.cs
- ContextBase.cs
- UnsafeNativeMethods.cs
- SqlNodeAnnotation.cs
- StylusPlugin.cs
- EndPoint.cs
- SmtpDigestAuthenticationModule.cs
- TreeNodeCollection.cs
- ContentWrapperAttribute.cs
- Attributes.cs
- MoveSizeWinEventHandler.cs
- CompositeActivityValidator.cs
- DataContext.cs
- DataGridViewColumnCollection.cs
- ConfigXmlWhitespace.cs
- WindowManager.cs
- CodeTypeReferenceCollection.cs
- AuthenticateEventArgs.cs
- CacheDependency.cs
- JoinElimination.cs
- ScriptingProfileServiceSection.cs
- FormParameter.cs
- IDReferencePropertyAttribute.cs
- TraceHandlerErrorFormatter.cs
- DesignerEditorPartChrome.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- ObjectListCommand.cs
- FileDialogPermission.cs
- AgileSafeNativeMemoryHandle.cs
- LogRestartAreaEnumerator.cs
- UserValidatedEventArgs.cs
- ScriptBehaviorDescriptor.cs
- BinaryConverter.cs
- ColumnPropertiesGroup.cs
- TextDecoration.cs
- CqlLexer.cs
- Int16.cs
- CompositionTarget.cs
- ChangeTracker.cs
- TextTreeTextNode.cs
- DataGridColumnDropSeparator.cs
- ProcessThread.cs
- FrameworkObject.cs
- XmlWriterDelegator.cs
- GAC.cs
- InputScopeAttribute.cs
- DefaultBinder.cs
- OpCellTreeNode.cs
- EncodingNLS.cs
- PathFigureCollection.cs
- WhileDesigner.cs
- RawStylusInput.cs
- HttpCachePolicyBase.cs
- __ConsoleStream.cs
- WindowsTooltip.cs