Show / Hide Table of Contents

# Class FileDialog

Base class for the OpenDialog and the SaveDialog

##### Inheritance

System.Object
Responder
View
Toplevel
Window
Dialog
FileDialog
OpenDialog
SaveDialog

##### Implements

System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize

##### Inherited Members

Dialog.AddButton(Button)
Dialog.ProcessKey(KeyEvent)
Window.Title
Window.Add(View)
Window.Remove(View)
Window.RemoveAll()
Window.Redraw(Rect)
Window.MouseEvent(MouseEvent)
Window.Text
Window.TextAlignment
Toplevel.Running
Toplevel.Loaded
Toplevel.Ready
Toplevel.Unloaded
Toplevel.Create()
Toplevel.CanFocus
Toplevel.Modal
Toplevel.MenuBar
Toplevel.StatusBar
Toplevel.OnKeyDown(KeyEvent)
Toplevel.OnKeyUp(KeyEvent)
Toplevel.ProcessColdKey(KeyEvent)
View.Added
View.Removed
View.Enter
View.Leave
View.MouseEnter
View.MouseLeave
View.MouseClick
View.HotKey
View.HotKeySpecifier
View.Shortcut
View.ShortcutTag
View.ShortcutAction
View.Data
View.Driver
View.Subviews
View.TabIndexes
View.TabIndex
View.TabStop
View.Id
View.IsCurrentTop
View.WantMousePositionReports
View.WantContinuousButtonPressed
View.Frame
View.LayoutStyle
View.Bounds
View.X
View.Y
View.Width
View.Height
View.SuperView
View.SetNeedsDisplay()
View.SetNeedsDisplay(Rect)
View.ChildNeedsDisplay()
View.Add(View[])
View.BringSubviewToFront(View)
View.SendSubviewToBack(View)
View.SendSubviewBackwards(View)
View.BringSubviewForward(View)
View.Clear()
View.Clear(Rect)
View.ScreenToView(Int32, Int32)
View.ClipToBounds()
View.SetClip(Rect)
View.DrawFrame(Rect, Int32, Boolean)
View.DrawHotString(ustring, Attribute, Attribute)
View.DrawHotString(ustring, Boolean, ColorScheme)
View.Move(Int32, Int32)
View.PositionCursor()
View.HasFocus
View.OnAdded(View)
View.OnRemoved(View)
View.OnEnter(View)
View.OnLeave(View)
View.Focused
View.MostFocused
View.ColorScheme
View.AddRune(Int32, Int32, Rune)
View.ClearNeedsDisplay()
View.DrawContent
View.OnDrawContent(Rect)
View.SetFocus()
View.KeyPress
View.ProcessHotKey(KeyEvent)
View.KeyDown
View.KeyUp
View.EnsureFocus()
View.FocusFirst()
View.FocusLast()
View.FocusPrev()
View.FocusNext()
View.LayoutStarted
View.LayoutComplete
View.Initialized
View.LayoutSubviews()
View.AutoSize
View.IsInitialized
View.ToString()
View.OnMouseEnter(MouseEvent)
View.OnMouseLeave(MouseEvent)
View.OnMouseEvent(MouseEvent)
View.OnMouseClick(View.MouseEventArgs)
View.Dispose(Boolean)
View.BeginInit()
View.EndInit()
View.Visible
Responder.Dispose()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)

###### Namespace: Terminal.Gui

###### Assembly: Terminal.Gui.dll

##### Syntax

    public class FileDialog : Dialog, IDisposable, ISupportInitializeNotification, ISupportInitialize

### Constructors

#### FileDialog()

Initializes a new FileDialog.

##### Declaration

    public FileDialog()

#### FileDialog(ustring, ustring, ustring, ustring)

Initializes a new instance of FileDialog

##### Declaration

    public FileDialog(ustring title, ustring prompt, ustring nameFieldLabel, ustring message)

##### Parameters

Type | Name | Description
--- | --- | ---
NStack.ustring | title | The title.
NStack.ustring | prompt | The prompt.
NStack.ustring | nameFieldLabel | The name field label.
NStack.ustring | message | The message.

### Properties

#### AllowedFileTypes

The array of filename extensions allowed, or null if all file extensions are allowed.

##### Declaration

    public string[] AllowedFileTypes { get; set; }

##### Property Value

Type | Description
--- | ---
System.String[] | The allowed file types.

#### AllowsOtherFileTypes

Gets or sets a value indicating whether this FileDialog allows the file to be saved with a different extension

##### Declaration

    public bool AllowsOtherFileTypes { get; set; }

##### Property Value

Type | Description
--- | ---
System.Boolean | `true` if allows other file types; otherwise, `false`.

#### Canceled

Check if the dialog was or not canceled.

##### Declaration

    public bool Canceled { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

#### CanCreateDirectories

Gets or sets a value indicating whether this FileDialog can create directories.

##### Declaration

    public bool CanCreateDirectories { get; set; }

##### Property Value

Type | Description
--- | ---
System.Boolean | `true` if can create directories; otherwise, `false`.

#### DirectoryPath

Gets or sets the directory path for this panel

##### Declaration

    public ustring DirectoryPath { get; set; }

##### Property Value

Type | Description
--- | ---
NStack.ustring | The directory path.

#### FilePath

The File path that is currently shown on the panel

##### Declaration

    public ustring FilePath { get; set; }

##### Property Value

Type | Description
--- | ---
NStack.ustring | The absolute file path for the file path entered.

#### IsExtensionHidden

Gets or sets a value indicating whether this FileDialog is extension hidden.

##### Declaration

    public bool IsExtensionHidden { get; set; }

##### Property Value

Type | Description
--- | ---
System.Boolean | `true` if is extension hidden; otherwise, `false`.

#### Message

Gets or sets the message displayed to the user, defaults to nothing

##### Declaration

    public ustring Message { get; set; }

##### Property Value

Type | Description
--- | ---
NStack.ustring | The message.

#### NameFieldLabel

Gets or sets the name field label.

##### Declaration

    public ustring NameFieldLabel { get; set; }

##### Property Value

Type | Description
--- | ---
NStack.ustring | The name field label.

#### Prompt

Gets or sets the prompt label for the Button displayed to the user

##### Declaration

    public ustring Prompt { get; set; }

##### Property Value

Type | Description
--- | ---
NStack.ustring | The prompt.

### Methods

#### WillPresent()

Invoked by Begin(Toplevel) as part of the Run(Toplevel) after the views have been laid out, and before the views are drawn for the first time.

##### Declaration

    public override void WillPresent()

##### Overrides

Toplevel.WillPresent()

### Implements

System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize