WinForms

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class WindowsFormsEditorServiceContainer

    Show / Hide Table of Contents

    Class WindowsFormsEditorServiceContainer

    Provides a basic implementation for the IWindowsFormsEditorService and IServiceProvider interfaces and can be used together with TypeDescriptorContext to launch an Editor directly outside a property grid.

    Inheritance
    System.Object
    WindowsFormsEditorServiceContainer
    Implements
    System.Windows.Forms.Design.IWindowsFormsEditorService
    System.IServiceProvider
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.ComponentModel
    Assembly: Syncfusion.Shared.Base.dll
    Syntax
    public class WindowsFormsEditorServiceContainer : IWindowsFormsEditorService, IServiceProvider
    Examples

    The grid uses this class to display a collection editor.

    public static DialogResult ShowGridBaseStylesMapDialog(object instance, string propertyName)
    {
        GridBaseStyleCollectionEditor ce = new GridBaseStyleCollectionEditor(typeof(ArrayList));
    WindowsFormsEditorServiceContainer esc = new WindowsFormsEditorServiceContainer(null);
        PropertyDescriptor pd = TypeDescriptor.GetProperties(instance)[propertyName];
        TypeDescriptorContext tdc = new TypeDescriptorContext(instance, pd);
        tdc.ServiceProvider = esc;
        object v = ce.EditValue(tdc, esc, ((ICloneable) pd.GetValue(instance)).Clone());
        if (esc.DialogResult == DialogResult.OK)
        {
            pd.SetValue(instance, v);
        }
        return esc.DialogResult;
    }

    Constructors

    WindowsFormsEditorServiceContainer(IServiceProvider)

    Initializes a WindowsFormsEditorServiceContainer with the given IServiceProvider.

    Declaration
    public WindowsFormsEditorServiceContainer(IServiceProvider serviceProvider)
    Parameters
    Type Name Description
    System.IServiceProvider serviceProvider

    An IServiceProvider. Can be NULL.

    Properties

    DialogResult

    Returns the dialog result of the edit operation.

    Declaration
    public DialogResult DialogResult { get; }
    Property Value
    Type Description
    System.Windows.Forms.DialogResult

    ServiceProvider

    Gets / sets the associated IServiceProvider.

    Declaration
    public IServiceProvider ServiceProvider { get; set; }
    Property Value
    Type Description
    System.IServiceProvider

    Events

    ShowingDialog

    Occurs immediately before the Dialog is displayed. The ControlEventArgs.Control the form.

    Declaration
    public event ControlEventHandler ShowingDialog
    Event Type
    Type Description
    System.Windows.Forms.ControlEventHandler

    Explicit Interface Implementations

    IServiceProvider.GetService(Type)

    Declaration
    object IServiceProvider.GetService(Type classService)
    Parameters
    Type Name Description
    System.Type classService
    Returns
    Type Description
    System.Object

    Implements

    System.Windows.Forms.Design.IWindowsFormsEditorService
    System.IServiceProvider

    See Also

    TypeDescriptorContext
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved