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
- SchemaTableColumn.cs
- ObjectSecurityT.cs
- RunClient.cs
- Authorization.cs
- HttpHandlerAction.cs
- EmbeddedObject.cs
- EllipseGeometry.cs
- UpdatePanelTriggerCollection.cs
- ACL.cs
- MatrixTransform3D.cs
- TypeDependencyAttribute.cs
- ColumnHeaderConverter.cs
- DataGridViewRowPostPaintEventArgs.cs
- HostingPreferredMapPath.cs
- FlowPanelDesigner.cs
- CriticalHandle.cs
- SqlNotificationEventArgs.cs
- BreakSafeBase.cs
- Invariant.cs
- SQLSingleStorage.cs
- XmlSecureResolver.cs
- NumberFunctions.cs
- WebCategoryAttribute.cs
- NotFiniteNumberException.cs
- BufferModeSettings.cs
- StateMachineWorkflow.cs
- SystemUnicastIPAddressInformation.cs
- UInt16Converter.cs
- tooltip.cs
- VisualProxy.cs
- HttpWebResponse.cs
- CryptoApi.cs
- SystemColors.cs
- X509CertificateClaimSet.cs
- XPathExpr.cs
- NonVisualControlAttribute.cs
- nulltextcontainer.cs
- Rotation3D.cs
- PropertyManager.cs
- QueryStringConverter.cs
- _NativeSSPI.cs
- HMACSHA384.cs
- DetailsView.cs
- WebPartConnectionsConfigureVerb.cs
- XdrBuilder.cs
- Internal.cs
- SpeakCompletedEventArgs.cs
- DispatchOperationRuntime.cs
- BitmapDownload.cs
- ToolStripItemCollection.cs
- ControlPersister.cs
- TextTreePropertyUndoUnit.cs
- ErrorTableItemStyle.cs
- XmlResolver.cs
- BeginEvent.cs
- DataGridViewSelectedRowCollection.cs
- SpecialFolderEnumConverter.cs
- NodeFunctions.cs
- TrustManagerMoreInformation.cs
- CatchDesigner.xaml.cs
- AddingNewEventArgs.cs
- DataRelation.cs
- Application.cs
- DoubleIndependentAnimationStorage.cs
- QuadTree.cs
- MenuBase.cs
- MimeParameter.cs
- DataTableNewRowEvent.cs
- QueryContinueDragEvent.cs
- DependencyPropertyHelper.cs
- StringToken.cs
- LinkedResourceCollection.cs
- PageBuildProvider.cs
- TemplateBindingExtension.cs
- XmlDataCollection.cs
- TemplateContent.cs
- FunctionDefinition.cs
- SyndicationCategory.cs
- invalidudtexception.cs
- UnmanagedMemoryStream.cs
- GuidelineSet.cs
- RefExpr.cs
- CompilerError.cs
- SystemIPv6InterfaceProperties.cs
- ExpressionVisitorHelpers.cs
- NotifyInputEventArgs.cs
- ArraySegment.cs
- StrongNameKeyPair.cs
- COM2Enum.cs
- SymLanguageType.cs
- ScrollItemPattern.cs
- SerializationFieldInfo.cs
- InvokeSchedule.cs
- TypeInfo.cs
- hwndwrapper.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- ReflectionHelper.cs
- ItemDragEvent.cs
- DrawingContextDrawingContextWalker.cs
- Block.cs