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
- HtmlControlPersistable.cs
- SelectionWordBreaker.cs
- PeerTransportListenAddressValidator.cs
- TagPrefixCollection.cs
- Model3D.cs
- ScaleTransform3D.cs
- ShutDownListener.cs
- SqlConnectionPoolProviderInfo.cs
- DispatcherExceptionEventArgs.cs
- DataObject.cs
- GroupItem.cs
- GrammarBuilderBase.cs
- ListControl.cs
- MonthCalendarDesigner.cs
- PersistChildrenAttribute.cs
- MenuAdapter.cs
- SuppressIldasmAttribute.cs
- PathGeometry.cs
- WpfGeneratedKnownProperties.cs
- CancellationScope.cs
- ToolStripPanelRenderEventArgs.cs
- MatrixAnimationUsingKeyFrames.cs
- SQLInt64.cs
- ExecutedRoutedEventArgs.cs
- SharedStatics.cs
- Size.cs
- DoubleAverageAggregationOperator.cs
- SchemaElementLookUpTable.cs
- AsymmetricKeyExchangeDeformatter.cs
- NameValueSectionHandler.cs
- AdRotator.cs
- HtmlWindowCollection.cs
- AssociationSet.cs
- CharacterMetrics.cs
- Guid.cs
- SafeNativeMethods.cs
- DoubleLinkListEnumerator.cs
- SingleStorage.cs
- XmlNodeList.cs
- FontStyles.cs
- ToolStripSeparatorRenderEventArgs.cs
- OutOfMemoryException.cs
- HandledMouseEvent.cs
- BindingCollection.cs
- XmlSchemaSubstitutionGroup.cs
- BasicCommandTreeVisitor.cs
- Pen.cs
- XPathNode.cs
- CompositeFontInfo.cs
- CodeTypeOfExpression.cs
- ProxyFragment.cs
- PointCollection.cs
- InvariantComparer.cs
- RowToFieldTransformer.cs
- HttpCachePolicyElement.cs
- XmlNamespaceDeclarationsAttribute.cs
- RevocationPoint.cs
- nulltextnavigator.cs
- LambdaCompiler.Lambda.cs
- XmlTypeAttribute.cs
- NavigationPropertyEmitter.cs
- ValidatingPropertiesEventArgs.cs
- ProtocolException.cs
- UnitySerializationHolder.cs
- NumericPagerField.cs
- SecurityPermission.cs
- HttpPostLocalhostServerProtocol.cs
- SqlError.cs
- ProjectionPlan.cs
- SRDisplayNameAttribute.cs
- EdmComplexTypeAttribute.cs
- AuthorizationSection.cs
- KeyValuePairs.cs
- RuntimeArgumentHandle.cs
- PreloadedPackages.cs
- SaveFileDialog.cs
- BasePattern.cs
- ListControlConvertEventArgs.cs
- BitmapInitialize.cs
- RoutedEvent.cs
- XhtmlConformanceSection.cs
- ActivityTrace.cs
- BeginStoryboard.cs
- TextBoxAutomationPeer.cs
- XmlAttributeOverrides.cs
- WindowsButton.cs
- TripleDESCryptoServiceProvider.cs
- objectquery_tresulttype.cs
- NotificationContext.cs
- SqlXmlStorage.cs
- TraceSwitch.cs
- StorageComplexPropertyMapping.cs
- EntityDataSourceChangingEventArgs.cs
- HtmlSelectionListAdapter.cs
- ResXResourceSet.cs
- ToolStripDropDownItemDesigner.cs
- UdpConstants.cs
- CodeMemberProperty.cs
- EnvelopedSignatureTransform.cs
- XmlSigningNodeWriter.cs