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
- ApplicationServicesHostFactory.cs
- XmlReaderSettings.cs
- Image.cs
- WindowsGraphicsWrapper.cs
- XmlCompatibilityReader.cs
- HelpProvider.cs
- SoapMessage.cs
- IdentityReference.cs
- bindurihelper.cs
- BitmapEffectRenderDataResource.cs
- ObjectSecurityT.cs
- PolyLineSegmentFigureLogic.cs
- AssemblyInfo.cs
- UIElementHelper.cs
- RectangleConverter.cs
- CodeTryCatchFinallyStatement.cs
- MsmqOutputChannel.cs
- MultiSelector.cs
- ProtectedConfigurationSection.cs
- COM2TypeInfoProcessor.cs
- Compress.cs
- SendActivityDesignerTheme.cs
- BinHexEncoder.cs
- ClientConfigurationHost.cs
- Cursors.cs
- CacheOutputQuery.cs
- InternalPermissions.cs
- PageThemeBuildProvider.cs
- FrameworkElementFactoryMarkupObject.cs
- DbCommandDefinition.cs
- Matrix3D.cs
- WeakReference.cs
- PortCache.cs
- RandomNumberGenerator.cs
- RelationshipSet.cs
- MeasureData.cs
- Translator.cs
- TagElement.cs
- LabelLiteral.cs
- Hash.cs
- HtmlLink.cs
- DurableInstancingOptions.cs
- HtmlTableCellCollection.cs
- UIElementCollection.cs
- DataBoundControlAdapter.cs
- Ipv6Element.cs
- UriScheme.cs
- MimeReflector.cs
- ImageConverter.cs
- SingleKeyFrameCollection.cs
- Evidence.cs
- ThreadStateException.cs
- ArgIterator.cs
- SQLBytesStorage.cs
- XmlJsonReader.cs
- TextElementEnumerator.cs
- ExpressionConverter.cs
- SqlInternalConnectionSmi.cs
- BasicViewGenerator.cs
- HttpModuleAction.cs
- CapabilitiesPattern.cs
- EncodingTable.cs
- TypeDependencyAttribute.cs
- EdgeModeValidation.cs
- LineProperties.cs
- ColorConvertedBitmapExtension.cs
- DragDrop.cs
- RichTextBoxAutomationPeer.cs
- CommandValueSerializer.cs
- XmlObjectSerializerContext.cs
- ReadOnlyCollection.cs
- EventTask.cs
- TabRenderer.cs
- Operator.cs
- BuilderPropertyEntry.cs
- XmlSchemaComplexContentExtension.cs
- CompatibleIComparer.cs
- DocumentViewerHelper.cs
- SqlNotificationEventArgs.cs
- Journal.cs
- TextRange.cs
- DecoratedNameAttribute.cs
- BindingContext.cs
- ServiceOperationViewControl.cs
- CacheSection.cs
- RotateTransform3D.cs
- PriorityChain.cs
- MediaTimeline.cs
- ScrollChrome.cs
- UrlPath.cs
- ZoneButton.cs
- CroppedBitmap.cs
- TransactionInformation.cs
- QueryOutputWriterV1.cs
- XpsPackagingPolicy.cs
- PropertyChange.cs
- ZipIOExtraFieldZip64Element.cs
- FieldBuilder.cs
- Gdiplus.cs
- wmiprovider.cs