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
- JoinSymbol.cs
- XmlSchemaAppInfo.cs
- SQLBinary.cs
- RenamedEventArgs.cs
- MessageContractMemberAttribute.cs
- RectangleGeometry.cs
- XamlSerializer.cs
- ServiceParser.cs
- SqlDependencyUtils.cs
- MetadataStore.cs
- LinqDataSourceHelper.cs
- KoreanLunisolarCalendar.cs
- PropertyPath.cs
- ProcessManager.cs
- CodeParameterDeclarationExpressionCollection.cs
- ObjectIDGenerator.cs
- DbConnectionHelper.cs
- MetaTableHelper.cs
- CodeTypeMember.cs
- PublishLicense.cs
- WCFModelStrings.Designer.cs
- SvcMapFileLoader.cs
- EntityConnectionStringBuilder.cs
- InvokeHandlers.cs
- StructuralType.cs
- ProcessMessagesAsyncResult.cs
- NumericUpDownAccelerationCollection.cs
- CodeNamespaceImport.cs
- OleDbInfoMessageEvent.cs
- NonSerializedAttribute.cs
- Timer.cs
- HttpApplication.cs
- DependencyPropertyHelper.cs
- AuthenticatingEventArgs.cs
- CanonicalizationDriver.cs
- ByteArrayHelperWithString.cs
- AnnotationComponentManager.cs
- InputProcessorProfilesLoader.cs
- newinstructionaction.cs
- shaperfactoryquerycachekey.cs
- BlurEffect.cs
- SqlCommandBuilder.cs
- Semaphore.cs
- SetStateEventArgs.cs
- CodeIndexerExpression.cs
- ImageListStreamer.cs
- XamlStream.cs
- WindowsFormsHost.cs
- DetailsViewRow.cs
- ServiceOperationUIEditor.cs
- ScriptingSectionGroup.cs
- CodeIterationStatement.cs
- TextShapeableCharacters.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- CompilerGeneratedAttribute.cs
- PassportAuthenticationEventArgs.cs
- SiteMapNode.cs
- WSSecurityOneDotZeroReceiveSecurityHeader.cs
- UserNameServiceElement.cs
- XPathNavigator.cs
- KoreanLunisolarCalendar.cs
- ViewBase.cs
- XsdCachingReader.cs
- WorkflowOperationContext.cs
- GraphicsPath.cs
- ObjectItemAttributeAssemblyLoader.cs
- FileSystemInfo.cs
- XmlNullResolver.cs
- uribuilder.cs
- RuntimeTrackingProfile.cs
- BinaryNode.cs
- AttributeQuery.cs
- HwndKeyboardInputProvider.cs
- TransformProviderWrapper.cs
- StylusPlugin.cs
- PageCodeDomTreeGenerator.cs
- X509InitiatorCertificateServiceElement.cs
- ImportOptions.cs
- HeaderPanel.cs
- ReachBasicContext.cs
- IssuedTokenClientBehaviorsElement.cs
- InteropBitmapSource.cs
- relpropertyhelper.cs
- SR.cs
- MenuScrollingVisibilityConverter.cs
- StyleHelper.cs
- GlobalProxySelection.cs
- SqlProcedureAttribute.cs
- WebResourceUtil.cs
- ExpressionQuoter.cs
- SqlConnection.cs
- DataListItemEventArgs.cs
- EntityCollection.cs
- DataGridViewRowsAddedEventArgs.cs
- XMLSyntaxException.cs
- graph.cs
- HeaderLabel.cs
- BitmapMetadataEnumerator.cs
- DataGridToolTip.cs
- CounterSample.cs