DevToys logo DevToys
  • Home
  • Blog
  • Documentation
  • Download
Search Results for

    Show / Hide Table of Contents

    Interface IUIFileSelector

    A component that represents a drop zone and selector for files, folders, images coming from the clipboard.

    Inherited Members
    IUIElement.Id
    IUIElement.IsVisible
    IUIElement.IsEnabled
    IUIElement.HorizontalAlignment
    IUIElement.VerticalAlignment
    IUIElement.IsVisibleChanged
    IUIElement.IsEnabledChanged
    IUIElement.HorizontalAlignmentChanged
    IUIElement.VerticalAlignmentChanged
    Namespace: DevToys.Api
    Assembly: DevToys.Api.dll
    Syntax
    public interface IUIFileSelector : IUIElement

    Properties

    AllowedFileExtensions

    Gets the list of file extensions allowed to be selected. An empty list of file extensions indicates any kind of file.

    Declaration
    string[] AllowedFileExtensions { get; }
    Property Value
    Type Description
    string[]

    CanSelectManyFiles

    Gets whether the user is allowed to select more than one file.

    Declaration
    bool CanSelectManyFiles { get; }
    Property Value
    Type Description
    bool

    OnFilesSelectedAction

    Gets the action to run when the user selected file(s).

    Declaration
    Func<SandboxedFileReader[], ValueTask>? OnFilesSelectedAction { get; }
    Property Value
    Type Description
    Func<SandboxedFileReader[], ValueTask>
    Remarks

    The items contain a stream. It won't be disposed automatically. It is important to dispose the stream yourself, when not needed anymore

    SelectedFiles

    Gets the list of absolute path to the file(s) the user selected.

    Declaration
    SandboxedFileReader[] SelectedFiles { get; }
    Property Value
    Type Description
    SandboxedFileReader[]
    Remarks

    The items contain a stream. It won't be disposed automatically. It is important to dispose the stream yourself, when not needed anymore

    Events

    AllowedFileExtensionsChanged

    Raised when AllowedFileExtensions is changed.

    Declaration
    event EventHandler? AllowedFileExtensionsChanged
    Event Type
    Type Description
    EventHandler

    CanSelectManyFilesChanged

    Raised when CanSelectManyFiles is changed.

    Declaration
    event EventHandler? CanSelectManyFilesChanged
    Event Type
    Type Description
    EventHandler

    Extension Methods

    GUI.AlignHorizontally<T>(T, UIHorizontalAlignment)
    GUI.AlignVertically<T>(T, UIVerticalAlignment)
    GUI.CanSelectManyFiles(IUIFileSelector)
    GUI.CanSelectOneFile(IUIFileSelector)
    GUI.Disable<T>(T)
    GUI.Enable<T>(T)
    GUI.Hide<T>(T)
    GUI.LimitFileTypesTo(IUIFileSelector, params string[])
    GUI.LimitFileTypesToImages(IUIFileSelector)
    GUI.OnFilesSelected(IUIFileSelector, Action<SandboxedFileReader[]>?)
    GUI.OnFilesSelected(IUIFileSelector, Func<SandboxedFileReader[], ValueTask>?)
    GUI.Show<T>(T)
    GUI.WithFiles(IUIFileSelector, params SandboxedFileReader[])
    LoggingExtensions.Log<T>(T)
    In this article
    DevToys logo © 2024 DevToys