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
- SQLDecimal.cs
- GridProviderWrapper.cs
- MainMenu.cs
- TabItemAutomationPeer.cs
- _SslSessionsCache.cs
- DropTarget.cs
- XmlDocumentType.cs
- PropertyGrid.cs
- GreenMethods.cs
- XmlUtil.cs
- DesignerSerializationOptionsAttribute.cs
- ErrorItem.cs
- SubordinateTransaction.cs
- DockingAttribute.cs
- MultipleCopiesCollection.cs
- DataGridLinkButton.cs
- XmlHierarchyData.cs
- ErrorHandler.cs
- UniqueEventHelper.cs
- CompositeFontInfo.cs
- selecteditemcollection.cs
- Reference.cs
- BufferModeSettings.cs
- PropertyReferenceSerializer.cs
- XmlDataProvider.cs
- UIElement3D.cs
- OperatorExpressions.cs
- AnnotationStore.cs
- designeractionbehavior.cs
- DataGridViewRowCollection.cs
- SoapReflectionImporter.cs
- DBSchemaRow.cs
- MetadataPropertyvalue.cs
- WindowsListViewItem.cs
- MeshGeometry3D.cs
- Tag.cs
- Context.cs
- KeyNameIdentifierClause.cs
- Expressions.cs
- FlowDocumentReader.cs
- SingleAnimation.cs
- SystemSounds.cs
- EditorAttribute.cs
- GeneralTransformCollection.cs
- RelationshipDetailsRow.cs
- EdmType.cs
- DynamicPropertyHolder.cs
- ClientSideQueueItem.cs
- securitycriticaldataClass.cs
- OdbcConnectionHandle.cs
- DateBoldEvent.cs
- ServiceDescriptionReflector.cs
- IDQuery.cs
- XmlAtomicValue.cs
- DispatchChannelSink.cs
- SubqueryRules.cs
- DataGridViewColumn.cs
- XmlBinaryReader.cs
- TreeNodeBinding.cs
- SafeCoTaskMem.cs
- GridViewDeletedEventArgs.cs
- DeflateEmulationStream.cs
- IItemProperties.cs
- IconBitmapDecoder.cs
- AssemblyName.cs
- ProxyAttribute.cs
- ConstraintEnumerator.cs
- ExpressionBinding.cs
- CallbackValidator.cs
- Number.cs
- NativeCompoundFileAPIs.cs
- CustomErrorsSection.cs
- OrderedHashRepartitionEnumerator.cs
- BooleanAnimationUsingKeyFrames.cs
- BlurBitmapEffect.cs
- RuntimeConfigurationRecord.cs
- remotingproxy.cs
- WindowsUpDown.cs
- StylusSystemGestureEventArgs.cs
- ResourceManagerWrapper.cs
- TextAutomationPeer.cs
- ClientData.cs
- Collection.cs
- AvTraceFormat.cs
- ChildDocumentBlock.cs
- ComPlusInstanceContextInitializer.cs
- DataGridViewDataConnection.cs
- ParallelTimeline.cs
- SafeSecurityHelper.cs
- RoleGroupCollection.cs
- BamlRecordWriter.cs
- WebPartConnectionCollection.cs
- OleTxTransactionInfo.cs
- BooleanAnimationBase.cs
- EndEvent.cs
- ShaperBuffers.cs
- VirtualDirectoryMapping.cs
- CompiledRegexRunner.cs
- HwndHostAutomationPeer.cs
- Encoder.cs