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
- TextEvent.cs
- RenderData.cs
- RootBrowserWindowAutomationPeer.cs
- EmptyImpersonationContext.cs
- XmlLoader.cs
- DiscoveryDocumentLinksPattern.cs
- PropertyCollection.cs
- DataGridTablesFactory.cs
- SoapAttributeAttribute.cs
- ProxyGenerationError.cs
- mediaclock.cs
- XmlDocumentType.cs
- WebException.cs
- DataControlImageButton.cs
- invalidudtexception.cs
- TabPanel.cs
- InstanceData.cs
- ExpressionBuilder.cs
- XmlILModule.cs
- UrlMappingCollection.cs
- Base64Encoder.cs
- DataGridViewRowsRemovedEventArgs.cs
- RawUIStateInputReport.cs
- ManifestResourceInfo.cs
- contentDescriptor.cs
- Margins.cs
- WindowsTokenRoleProvider.cs
- Cursors.cs
- MenuItemBindingCollection.cs
- Win32KeyboardDevice.cs
- ObjectDataSource.cs
- TextServicesCompartmentContext.cs
- DateTime.cs
- sqlpipe.cs
- _SingleItemRequestCache.cs
- Point3DAnimationBase.cs
- ContractUtils.cs
- Debugger.cs
- ActivationServices.cs
- InfoCardKeyedHashAlgorithm.cs
- BinaryOperationBinder.cs
- DataRelation.cs
- LightweightCodeGenerator.cs
- DeviceContext2.cs
- TemplateBindingExtension.cs
- Command.cs
- ScriptIgnoreAttribute.cs
- ConditionalDesigner.cs
- ScrollItemProviderWrapper.cs
- MissingSatelliteAssemblyException.cs
- IriParsingElement.cs
- IdleTimeoutMonitor.cs
- Normalization.cs
- FixedSOMGroup.cs
- WebHttpSecurityElement.cs
- PipeConnection.cs
- ConfigurationStrings.cs
- XPathNavigatorReader.cs
- cookiecontainer.cs
- InkCanvasFeedbackAdorner.cs
- hebrewshape.cs
- SqlBooleanMismatchVisitor.cs
- DataServiceRequestException.cs
- DropShadowBitmapEffect.cs
- DataGridViewTopLeftHeaderCell.cs
- MetadataArtifactLoaderResource.cs
- FlowchartStart.xaml.cs
- StoragePropertyMapping.cs
- BmpBitmapDecoder.cs
- EmptyCollection.cs
- FontStyles.cs
- StickyNoteHelper.cs
- ExtractedStateEntry.cs
- CodeAccessSecurityEngine.cs
- UserPreferenceChangedEventArgs.cs
- MaterialGroup.cs
- X509CertificateRecipientClientCredential.cs
- DefaultCommandConverter.cs
- TraceSection.cs
- CodeTypeOfExpression.cs
- ProviderException.cs
- XmlSchemaSequence.cs
- KeyGestureConverter.cs
- Random.cs
- ExpressionBuilder.cs
- DataGridViewColumn.cs
- XmlDataDocument.cs
- BamlReader.cs
- util.cs
- OdbcFactory.cs
- BindableAttribute.cs
- AggregatePushdown.cs
- DictionaryTraceRecord.cs
- CompositeTypefaceMetrics.cs
- CodeIterationStatement.cs
- DataControlPagerLinkButton.cs
- Bezier.cs
- GroupBox.cs
- CounterCreationDataCollection.cs
- DrawItemEvent.cs