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
- ReceiveContent.cs
- Vector3dCollection.cs
- OdbcConnectionHandle.cs
- DateTimeEditor.cs
- ClientSponsor.cs
- DataGridColumnHeader.cs
- XmlWriterTraceListener.cs
- MissingMethodException.cs
- Nullable.cs
- EventLogHandle.cs
- PagedDataSource.cs
- Timer.cs
- ConnectionOrientedTransportChannelFactory.cs
- Int64AnimationBase.cs
- RectangleGeometry.cs
- CompilerErrorCollection.cs
- ImageListStreamer.cs
- DataGridViewDataConnection.cs
- ToolStripHighContrastRenderer.cs
- NativeWindow.cs
- BuildDependencySet.cs
- LambdaCompiler.Generated.cs
- InteropBitmapSource.cs
- M3DUtil.cs
- MediaPlayer.cs
- TableLayoutColumnStyleCollection.cs
- CustomCredentialPolicy.cs
- XmlTextEncoder.cs
- EpmSourceTree.cs
- OleDbWrapper.cs
- Bits.cs
- AlphabeticalEnumConverter.cs
- RectAnimationClockResource.cs
- GridItemPattern.cs
- RijndaelManaged.cs
- EastAsianLunisolarCalendar.cs
- WarningException.cs
- XmlCharType.cs
- Header.cs
- DescendentsWalker.cs
- Main.cs
- AppDomainUnloadedException.cs
- TextServicesHost.cs
- Stacktrace.cs
- SimpleRecyclingCache.cs
- WebHttpDispatchOperationSelector.cs
- DES.cs
- TreeChangeInfo.cs
- StaticTextPointer.cs
- PropertyMap.cs
- TextFormatterHost.cs
- DateTimeFormatInfo.cs
- TextSpanModifier.cs
- ProvidersHelper.cs
- CompiledRegexRunner.cs
- XmlSchemaException.cs
- COM2AboutBoxPropertyDescriptor.cs
- CallContext.cs
- InteropTrackingRecord.cs
- SqlServer2KCompatibilityAnnotation.cs
- XamlWrapperReaders.cs
- SafeArrayRankMismatchException.cs
- SQLBytesStorage.cs
- MergeFilterQuery.cs
- XComponentModel.cs
- ClientConfigPaths.cs
- XPathQueryGenerator.cs
- ValidatorCompatibilityHelper.cs
- sqlnorm.cs
- PropertyGridView.cs
- ValidationSummary.cs
- PropertyAccessVisitor.cs
- SecurityState.cs
- XamlPointCollectionSerializer.cs
- ValidatedControlConverter.cs
- Events.cs
- QueryAsyncResult.cs
- ObjectStateFormatter.cs
- ListCardsInFileRequest.cs
- HitTestWithPointDrawingContextWalker.cs
- GeometryHitTestParameters.cs
- TableCellsCollectionEditor.cs
- SortKey.cs
- WindowsGraphicsWrapper.cs
- XmlBinaryWriter.cs
- ShutDownListener.cs
- DiscriminatorMap.cs
- EtwTrace.cs
- X500Name.cs
- HashRepartitionStream.cs
- DynamicUpdateCommand.cs
- RemoteEndpointMessageProperty.cs
- CultureInfo.cs
- DataGridColumnCollectionEditor.cs
- smtpconnection.cs
- EndPoint.cs
- XmlSchemaAttributeGroup.cs
- ScopelessEnumAttribute.cs
- OracleNumber.cs
- DataSet.cs