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
- Rule.cs
- FormsAuthenticationUser.cs
- Matrix3D.cs
- PathFigure.cs
- DetailsViewPageEventArgs.cs
- CodeThrowExceptionStatement.cs
- RoleGroupCollection.cs
- IconConverter.cs
- NTAccount.cs
- CompilerTypeWithParams.cs
- DataGridViewCellStyleChangedEventArgs.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- GeneralTransform3DCollection.cs
- StreamAsIStream.cs
- AdjustableArrowCap.cs
- PageContentAsyncResult.cs
- FontFamily.cs
- QueueProcessor.cs
- TextContainerHelper.cs
- WCFBuildProvider.cs
- Itemizer.cs
- FontDifferentiator.cs
- CollectionViewGroupInternal.cs
- ImageMap.cs
- BitmapEffectRenderDataResource.cs
- TypeNameConverter.cs
- StreamReader.cs
- ClonableStack.cs
- StringPropertyBuilder.cs
- SchemaSetCompiler.cs
- CorrelationService.cs
- OleDbConnectionFactory.cs
- DrawingAttributesDefaultValueFactory.cs
- HandledEventArgs.cs
- ArraySortHelper.cs
- SystemIcmpV6Statistics.cs
- Number.cs
- ClientBuildManagerCallback.cs
- KeyInterop.cs
- MobileErrorInfo.cs
- EdmMember.cs
- StyleSelector.cs
- _NetworkingPerfCounters.cs
- OleDbRowUpdatingEvent.cs
- MsmqHostedTransportConfiguration.cs
- UnaryNode.cs
- CompilerError.cs
- StringArrayConverter.cs
- DbDataAdapter.cs
- QueryableDataSourceHelper.cs
- DatagridviewDisplayedBandsData.cs
- BamlTreeNode.cs
- MetafileHeader.cs
- TextOutput.cs
- XmlSchemaInclude.cs
- HandlerMappingMemo.cs
- OrderPreservingPipeliningMergeHelper.cs
- ItemAutomationPeer.cs
- AttributeProviderAttribute.cs
- SoapClientProtocol.cs
- XPathSelectionIterator.cs
- _SSPISessionCache.cs
- Base64WriteStateInfo.cs
- AlternateViewCollection.cs
- FlagsAttribute.cs
- MemoryPressure.cs
- ManifestResourceInfo.cs
- HandleCollector.cs
- AnnotationDocumentPaginator.cs
- RowUpdatingEventArgs.cs
- XPathNode.cs
- ValidatorCollection.cs
- sqlnorm.cs
- Directory.cs
- JoinTreeSlot.cs
- SerializationSectionGroup.cs
- entitydatasourceentitysetnameconverter.cs
- SizeAnimationClockResource.cs
- ApplicationBuildProvider.cs
- InvalidWorkflowException.cs
- VersionedStream.cs
- IxmlLineInfo.cs
- DbProviderFactoriesConfigurationHandler.cs
- CriticalFinalizerObject.cs
- System.Data_BID.cs
- IisTraceListener.cs
- InvokeBinder.cs
- ServiceHttpHandlerFactory.cs
- FileClassifier.cs
- EventSetter.cs
- SafeRegistryKey.cs
- FilterRepeater.cs
- PointHitTestParameters.cs
- MsmqHostedTransportManager.cs
- DataGridViewRow.cs
- KnownBoxes.cs
- ChildrenQuery.cs
- TypedServiceOperationListItem.cs
- SubclassTypeValidatorAttribute.cs
- TextEndOfLine.cs