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
- SessionEndingEventArgs.cs
- TaskExceptionHolder.cs
- Region.cs
- Highlights.cs
- CultureSpecificStringDictionary.cs
- WindowsStartMenu.cs
- StrokeCollection.cs
- ReadOnlyDataSource.cs
- MetadataSerializer.cs
- UserControl.cs
- KeyBinding.cs
- PerfCounterSection.cs
- PackUriHelper.cs
- MenuRendererClassic.cs
- XmlChoiceIdentifierAttribute.cs
- LoginDesignerUtil.cs
- EncoderFallback.cs
- ObjectQuery_EntitySqlExtensions.cs
- Interfaces.cs
- UserControlDocumentDesigner.cs
- SqlDataSourceCommandEventArgs.cs
- Image.cs
- MessageSecurityOverTcpElement.cs
- ImageList.cs
- PackageStore.cs
- TextLineResult.cs
- OleDbReferenceCollection.cs
- ToolStripContentPanelRenderEventArgs.cs
- RulePatternOps.cs
- Types.cs
- ExplicitDiscriminatorMap.cs
- LogArchiveSnapshot.cs
- AssemblyGen.cs
- XPathMultyIterator.cs
- MetadataExchangeBindings.cs
- ColumnCollection.cs
- Geometry3D.cs
- MsmqActivation.cs
- BindingWorker.cs
- XsdDateTime.cs
- MailBnfHelper.cs
- SchemaCollectionCompiler.cs
- AbsoluteQuery.cs
- CompositeControl.cs
- SpoolingTask.cs
- ContentOperations.cs
- ExceptionRoutedEventArgs.cs
- SimpleFileLog.cs
- SqlBulkCopyColumnMapping.cs
- BrowserPolicyValidator.cs
- EndpointNotFoundException.cs
- OrderByQueryOptionExpression.cs
- WebBrowser.cs
- GPPOINTF.cs
- QueueProcessor.cs
- ClientBuildManagerCallback.cs
- InvokeBase.cs
- ToolStripRenderer.cs
- MsmqIntegrationValidationBehavior.cs
- RequestCachingSection.cs
- MessageQueueException.cs
- Win32Interop.cs
- _emptywebproxy.cs
- TemplateXamlParser.cs
- Point4D.cs
- PaintEvent.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- MenuCommands.cs
- CacheChildrenQuery.cs
- MetadataItemEmitter.cs
- JapaneseLunisolarCalendar.cs
- LayoutDump.cs
- TemplateControlCodeDomTreeGenerator.cs
- EmptyEnumerable.cs
- ToolStripLabel.cs
- NamespaceTable.cs
- PermissionSet.cs
- CodeAccessSecurityEngine.cs
- XNodeNavigator.cs
- DesignTimeTemplateParser.cs
- DetailsViewInsertEventArgs.cs
- HostingEnvironment.cs
- TimeEnumHelper.cs
- UnionCqlBlock.cs
- SmiEventSink_DeferedProcessing.cs
- ImageFormat.cs
- ExtensionSimplifierMarkupObject.cs
- Internal.cs
- Effect.cs
- EncoderExceptionFallback.cs
- SwitchLevelAttribute.cs
- UpdatePanelTriggerCollection.cs
- ImportFileRequest.cs
- TextTreeRootNode.cs
- DummyDataSource.cs
- TypeConverter.cs
- EntityDataSourceWrapperCollection.cs
- TextTabProperties.cs
- Vector3dCollection.cs
- DBCommand.cs