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
- UnauthorizedWebPart.cs
- PreviewControlDesigner.cs
- IgnoreFileBuildProvider.cs
- EntitySqlQueryBuilder.cs
- TreeViewBindingsEditor.cs
- CounterCreationDataCollection.cs
- ToolboxComponentsCreatedEventArgs.cs
- StorageRoot.cs
- messageonlyhwndwrapper.cs
- LineServicesCallbacks.cs
- ListViewDataItem.cs
- DoubleAverageAggregationOperator.cs
- HttpCachePolicy.cs
- StylusLogic.cs
- XmlLangPropertyAttribute.cs
- DtdParser.cs
- AxImporter.cs
- Socket.cs
- NegatedCellConstant.cs
- WorkItem.cs
- TextElementCollection.cs
- BindingValueChangedEventArgs.cs
- SoapFormatExtensions.cs
- UdpReplyToBehavior.cs
- Permission.cs
- EntityCollection.cs
- ListItem.cs
- DesignerDataView.cs
- ProxyWebPartManagerDesigner.cs
- CommandDevice.cs
- ContainsRowNumberChecker.cs
- ErasingStroke.cs
- FixedSOMFixedBlock.cs
- TextTreePropertyUndoUnit.cs
- X509ServiceCertificateAuthentication.cs
- JpegBitmapDecoder.cs
- DataViewManager.cs
- HandlerBase.cs
- COM2IProvidePropertyBuilderHandler.cs
- PreloadHost.cs
- XmlMemberMapping.cs
- Preprocessor.cs
- MarshalDirectiveException.cs
- SignatureToken.cs
- HttpListenerContext.cs
- Table.cs
- WebPartZoneBaseDesigner.cs
- ObfuscateAssemblyAttribute.cs
- EditorAttribute.cs
- CustomTypeDescriptor.cs
- ScriptServiceAttribute.cs
- NativeRecognizer.cs
- SubpageParagraph.cs
- PartEditor.cs
- FactoryGenerator.cs
- DateTimeStorage.cs
- HtmlFormParameterReader.cs
- Interlocked.cs
- _SslSessionsCache.cs
- PrimitiveType.cs
- TableParaClient.cs
- CapacityStreamGeometryContext.cs
- WpfKnownMemberInvoker.cs
- OverflowException.cs
- RequestQueryParser.cs
- DataListItemEventArgs.cs
- AdapterUtil.cs
- ColorAnimation.cs
- SharedPersonalizationStateInfo.cs
- SynchronizedInputProviderWrapper.cs
- XmlSchemaSimpleContentRestriction.cs
- SpecialFolderEnumConverter.cs
- WebPartCancelEventArgs.cs
- UnmanagedBitmapWrapper.cs
- LocationReference.cs
- iisPickupDirectory.cs
- ProjectedWrapper.cs
- SignatureGenerator.cs
- TextServicesLoader.cs
- InteropAutomationProvider.cs
- WinFormsComponentEditor.cs
- SessionStateItemCollection.cs
- UInt64Storage.cs
- SettingsSavedEventArgs.cs
- XslTransform.cs
- GeneralTransformGroup.cs
- XhtmlBasicTextBoxAdapter.cs
- Point3DCollectionValueSerializer.cs
- CommandConverter.cs
- PrintEvent.cs
- SpecialNameAttribute.cs
- SqlUtils.cs
- MexTcpBindingElement.cs
- ObjectManager.cs
- GuidelineSet.cs
- BitmapDecoder.cs
- DictionaryEntry.cs
- ConfigurationManagerHelper.cs
- QuaternionKeyFrameCollection.cs
- UnmanagedMarshal.cs