Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / DataBindingCollectionEditor.cs / 1 / DataBindingCollectionEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design { using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Drawing.Design; using System.Windows.Forms; using System.Windows.Forms.Design; using Control = System.Web.UI.Control; ////// /// [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] [Obsolete("Use of this type is not recommended because DataBindings editing is launched via a DesignerActionList instead of the property grid. http://go.microsoft.com/fwlink/?linkid=14202")] public class DataBindingCollectionEditor : UITypeEditor { ////// Provides editing functions for data binding collections. /// ////// /// public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { Debug.Assert(context.Instance is Control, "Expected control"); Control c = (Control)context.Instance; IServiceProvider site = c.Site; if (site == null) { if (c.Page != null) { site = c.Page.Site; } if (site == null) { site = provider; } } if (site == null) { // return value; } IDesignerHost designerHost = (IDesignerHost)site.GetService(typeof(IDesignerHost)); Debug.Assert(designerHost != null, "Must always have access to IDesignerHost service"); DesignerTransaction transaction = designerHost.CreateTransaction("(DataBindings)"); try { IComponentChangeService changeService = (IComponentChangeService)site.GetService(typeof(IComponentChangeService)); if (changeService != null) { try { changeService.OnComponentChanging(c, null); } catch (CheckoutException ce) { if (ce == CheckoutException.Canceled) return value; throw ce; } } DialogResult result = DialogResult.Cancel; try { DataBindingsDialog dbForm = new DataBindingsDialog(site, c); IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); result = edSvc.ShowDialog(dbForm); } finally { if ((result == DialogResult.OK) && (changeService != null)) { try { changeService.OnComponentChanged(c, null, null, null); } catch { } } } } finally { transaction.Commit(); } return value; } ////// Edits a data binding within the design time /// data binding collection. /// ////// /// 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 stytle for use by the editor. /// ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AspProxy.cs
- EditCommandColumn.cs
- RoutedUICommand.cs
- DotExpr.cs
- DateTimeOffsetStorage.cs
- ColumnResizeAdorner.cs
- ImageMapEventArgs.cs
- DllHostInitializer.cs
- MimeParameter.cs
- ResourceSetExpression.cs
- FrugalList.cs
- PropertyMappingExceptionEventArgs.cs
- ForwardPositionQuery.cs
- ColorConvertedBitmap.cs
- BufferBuilder.cs
- _DomainName.cs
- CodeIdentifiers.cs
- XPathAncestorIterator.cs
- OracleCommand.cs
- localization.cs
- _SslState.cs
- SamlSecurityTokenAuthenticator.cs
- XDeferredAxisSource.cs
- ReadContentAsBinaryHelper.cs
- SystemKeyConverter.cs
- WebPartConnectionsDisconnectVerb.cs
- Style.cs
- StatusBar.cs
- TopClause.cs
- ProcessModelInfo.cs
- mediapermission.cs
- PtsPage.cs
- InvalidOperationException.cs
- PropertyBuilder.cs
- SafeFileHandle.cs
- QueryMath.cs
- ScriptRef.cs
- BrowserDefinitionCollection.cs
- DrawListViewSubItemEventArgs.cs
- ApplicationFileCodeDomTreeGenerator.cs
- PenContexts.cs
- XmlSerializationWriter.cs
- LayoutDump.cs
- AssemblyAttributesGoHere.cs
- NativeMethods.cs
- UICuesEvent.cs
- AttributeSetAction.cs
- StreamedWorkflowDefinitionContext.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ReferentialConstraint.cs
- Double.cs
- EffectiveValueEntry.cs
- AssemblyAttributes.cs
- DropTarget.cs
- HttpListenerResponse.cs
- FSWPathEditor.cs
- UIElement.cs
- AsyncOperation.cs
- DBConcurrencyException.cs
- EventTrigger.cs
- DataKeyCollection.cs
- ScriptIgnoreAttribute.cs
- KernelTypeValidation.cs
- DocumentGridPage.cs
- Exception.cs
- PeerResolverBindingElement.cs
- ContainerParagraph.cs
- Misc.cs
- XmlWhitespace.cs
- ClientSponsor.cs
- DatagridviewDisplayedBandsData.cs
- DesignTimeParseData.cs
- PatternMatcher.cs
- UpDownBase.cs
- _SpnDictionary.cs
- StringPropertyBuilder.cs
- CompilerTypeWithParams.cs
- XamlRtfConverter.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- GroupDescription.cs
- PathSegmentCollection.cs
- BrushValueSerializer.cs
- SqlUnionizer.cs
- LabelAutomationPeer.cs
- ErrorWrapper.cs
- LineVisual.cs
- PersonalizationProviderHelper.cs
- BufferBuilder.cs
- CodeCastExpression.cs
- InterleavedZipPartStream.cs
- GroupItem.cs
- XmlAttributeAttribute.cs
- WorkflowRuntimeService.cs
- ForeignConstraint.cs
- StateRuntime.cs
- DefinitionUpdate.cs
- Utility.cs
- WebScriptMetadataInstanceContextProvider.cs
- Parameter.cs
- Keyboard.cs