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
- WindowAutomationPeer.cs
- BaseTypeViewSchema.cs
- InfoCard.cs
- ToolStripDesigner.cs
- ControlEvent.cs
- BrowserCapabilitiesCodeGenerator.cs
- CultureTable.cs
- InterleavedZipPartStream.cs
- QilIterator.cs
- EntryPointNotFoundException.cs
- SecurityContextSecurityTokenParameters.cs
- BulletedListEventArgs.cs
- NativeMethods.cs
- XmlDataProvider.cs
- ProfileSettings.cs
- DbTypeMap.cs
- XDRSchema.cs
- X509Utils.cs
- ImmComposition.cs
- DbDataSourceEnumerator.cs
- Thread.cs
- SQLSingle.cs
- ObjectSecurity.cs
- TagMapInfo.cs
- Attributes.cs
- WebSysDescriptionAttribute.cs
- SourceElementsCollection.cs
- VectorKeyFrameCollection.cs
- PageRanges.cs
- CodeDomSerializerException.cs
- AdjustableArrowCap.cs
- SplitterCancelEvent.cs
- DesignerDataView.cs
- Size.cs
- TypedReference.cs
- ResXFileRef.cs
- CodeMemberEvent.cs
- XPathItem.cs
- XsltLibrary.cs
- wgx_render.cs
- MethodImplAttribute.cs
- DbDataRecord.cs
- Switch.cs
- TCEAdapterGenerator.cs
- WebServiceErrorEvent.cs
- CodeNamespaceImport.cs
- SingleAnimationUsingKeyFrames.cs
- TextBreakpoint.cs
- XMLUtil.cs
- LOSFormatter.cs
- TemplateXamlTreeBuilder.cs
- ItemsControl.cs
- Regex.cs
- IntegrationExceptionEventArgs.cs
- ColumnBinding.cs
- SqlBulkCopyColumnMapping.cs
- FlowchartSizeFeature.cs
- BitmapFrameDecode.cs
- VScrollProperties.cs
- ObjectItemNoOpAssemblyLoader.cs
- ObjectToken.cs
- ExpanderAutomationPeer.cs
- ISAPIRuntime.cs
- AsyncPostBackTrigger.cs
- DefaultAutoFieldGenerator.cs
- XmlStreamNodeWriter.cs
- SqlXml.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- Latin1Encoding.cs
- OSEnvironmentHelper.cs
- LinqToSqlWrapper.cs
- CellRelation.cs
- ServicePointManagerElement.cs
- FlowDocumentReaderAutomationPeer.cs
- Debug.cs
- UpdateManifestForBrowserApplication.cs
- StringUtil.cs
- XmlNodeChangedEventArgs.cs
- RemoteWebConfigurationHost.cs
- StateRuntime.cs
- loginstatus.cs
- UnsafeNativeMethodsMilCoreApi.cs
- DelegatedStream.cs
- WindowCollection.cs
- DocumentPageViewAutomationPeer.cs
- RemotingServices.cs
- RangeValidator.cs
- StorageConditionPropertyMapping.cs
- TextSpan.cs
- PointValueSerializer.cs
- SqlClientWrapperSmiStreamChars.cs
- DesignerOptionService.cs
- HttpWebResponse.cs
- EntityDesignerDataSourceView.cs
- PropertyGridCommands.cs
- NavigationProgressEventArgs.cs
- ContentType.cs
- CacheHelper.cs
- ObjectDataSourceEventArgs.cs
- WebPartConnectionsCancelEventArgs.cs