C# Class Microsoft.WindowsAPICodePack.Dialogs.CommonFileDialog

Inheritance: IDialogControlHost, IDisposable
Afficher le fichier Open project: godly-devotion/Baka-MPlayer-old Class Usage Examples

Private Properties

Свойство Type Description
ApplyNativeSettings void
CalculateNativeDialogOptionFlags ShellNativeMethods.FileOpenOptions
CleanUpNativeFileDialog void
GenerateNotImplementedException void
GetCustomizedFileDialog void
GetDerivedOptionFlags ShellNativeMethods.FileOpenOptions
GetFileNameFromShellItem string
GetNativeFileDialog IFileDialog
GetShellItemAt IShellItem
InitializeEventSink void
InitializeNativeFileDialog void
PopulateWithFileNames void
PopulateWithIShellItems void
SyncFileTypeComboToDefaultExtension void

Méthodes publiques

Méthode Description
AddPlace ( ShellContainer place, FileDialogAddPlaceLocation location ) : void

Adds a location, such as a folder, library, search connector, or known folder, to the list of places available for a user to open or save items. This method actually adds an item to the Favorite Links or Places section of the Open/Save dialog.

AddPlace ( string path, FileDialogAddPlaceLocation location ) : void

Adds a location (folder, library, search connector, known folder) to the list of places available for the user to open or save items. This method actually adds an item to the Favorite Links or Places section of the Open/Save dialog. Overload method takes in a string for the path.

ApplyCollectionChanged ( ) : void

Applies changes to the collection.

ApplyControlPropertyChange ( string propertyName, Microsoft.WindowsAPICodePack.Dialogs.DialogControl control ) : void

Called when a control currently in the collection has a property changed.

Dispose ( ) : void

Releases the resources used by the current instance of the CommonFileDialog class.

IsCollectionChangeAllowed ( ) : bool

Returns if change to the colleciton is allowed.

IsControlPropertyChangeAllowed ( string propertyName, Microsoft.WindowsAPICodePack.Dialogs.DialogControl control ) : bool

Determines if changes to a specific property are allowed.

ResetUserSelections ( ) : void

Removes the current selection.

ShowDialog ( ) : CommonFileDialogResult

Displays the dialog.

ShowDialog ( IntPtr ownerWindowHandle ) : CommonFileDialogResult

Displays the dialog.

ShowDialog ( Window window ) : CommonFileDialogResult

Displays the dialog.

Méthodes protégées

Méthode Description
CheckFileItemsAvailable ( ) : void

Ensures that the user has selected one or more files.

CheckFileNamesAvailable ( ) : void

Ensures that the user has selected one or more files.

CommonFileDialog ( ) : System

Creates a new instance of this class.

CommonFileDialog ( string title ) : System

Creates a new instance of this class with the specified title.

Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the CommonFileDialog class and optionally releases the managed resources.

OnFileOk ( CancelEventArgs e ) : void

Raises the CommonFileDialog.FileOk event just before the dialog is about to return with a result.

OnFileTypeChanged ( EventArgs e ) : void

Raises the CommonFileDialog.FileTypeChanged event when the dialog is opened to notify the application of the initial chosen filetype.

OnFolderChanged ( EventArgs e ) : void

Raises the CommonFileDialog.FolderChanged event when the user navigates to a new folder.

OnFolderChanging ( Microsoft.WindowsAPICodePack.Dialogs.CommonFileDialogFolderChangeEventArgs e ) : void

Raises the FolderChanging to stop navigation to a particular location.

OnOpening ( EventArgs e ) : void

Raises the CommonFileDialog.DialogOpening event when the dialog is opened.

OnSelectionChanged ( EventArgs e ) : void

Raises the CommonFileDialog.SelectionChanged event when the user changes the selection in the dialog's view.

ThrowIfDialogShowing ( string message ) : void

Throws an exception when the dialog is showing preventing a requested change to a property or the visible set of controls.

Private Methods

Méthode Description
ApplyNativeSettings ( IFileDialog dialog ) : void
CalculateNativeDialogOptionFlags ( ) : ShellNativeMethods.FileOpenOptions
CleanUpNativeFileDialog ( ) : void
GenerateNotImplementedException ( ) : void
GetCustomizedFileDialog ( ) : void

Get the IFileDialogCustomize interface, preparing to add controls.

GetDerivedOptionFlags ( ShellNativeMethods flags ) : ShellNativeMethods.FileOpenOptions
GetFileNameFromShellItem ( IShellItem item ) : string
GetNativeFileDialog ( ) : IFileDialog
GetShellItemAt ( IShellItemArray array, int i ) : IShellItem
InitializeEventSink ( IFileDialog nativeDlg ) : void
InitializeNativeFileDialog ( ) : void
PopulateWithFileNames ( Collection names ) : void
PopulateWithIShellItems ( Collection shellItems ) : void
SyncFileTypeComboToDefaultExtension ( IFileDialog dialog ) : void

Tries to set the File(s) Type Combo to match the value in 'DefaultExtension'. Only doing this if 'this' is a Save dialog as it makes no sense to do this if only Opening a file.

Method Details

AddPlace() public méthode

Adds a location, such as a folder, library, search connector, or known folder, to the list of places available for a user to open or save items. This method actually adds an item to the Favorite Links or Places section of the Open/Save dialog.
public AddPlace ( ShellContainer place, FileDialogAddPlaceLocation location ) : void
place ShellContainer The item to add to the places list.
location FileDialogAddPlaceLocation One of the enumeration values that indicates placement of the item in the list.
Résultat void

AddPlace() public méthode

Adds a location (folder, library, search connector, known folder) to the list of places available for the user to open or save items. This method actually adds an item to the Favorite Links or Places section of the Open/Save dialog. Overload method takes in a string for the path.
public AddPlace ( string path, FileDialogAddPlaceLocation location ) : void
path string The item to add to the places list.
location FileDialogAddPlaceLocation One of the enumeration values that indicates placement of the item in the list.
Résultat void

ApplyCollectionChanged() public méthode

Applies changes to the collection.
public ApplyCollectionChanged ( ) : void
Résultat void

ApplyControlPropertyChange() public méthode

Called when a control currently in the collection has a property changed.
public ApplyControlPropertyChange ( string propertyName, Microsoft.WindowsAPICodePack.Dialogs.DialogControl control ) : void
propertyName string The name of the property changed.
control Microsoft.WindowsAPICodePack.Dialogs.DialogControl The control whose property has changed.
Résultat void

CheckFileItemsAvailable() protected méthode

Ensures that the user has selected one or more files.
protected CheckFileItemsAvailable ( ) : void
Résultat void

CheckFileNamesAvailable() protected méthode

Ensures that the user has selected one or more files.
protected CheckFileNamesAvailable ( ) : void
Résultat void

CommonFileDialog() protected méthode

Creates a new instance of this class.
protected CommonFileDialog ( ) : System
Résultat System

CommonFileDialog() protected méthode

Creates a new instance of this class with the specified title.
protected CommonFileDialog ( string title ) : System
title string The title to display in the dialog.
Résultat System

Dispose() public méthode

Releases the resources used by the current instance of the CommonFileDialog class.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

Releases the unmanaged resources used by the CommonFileDialog class and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; /// false to release only unmanaged resources.
Résultat void

IsCollectionChangeAllowed() public méthode

Returns if change to the colleciton is allowed.
public IsCollectionChangeAllowed ( ) : bool
Résultat bool

IsControlPropertyChangeAllowed() public méthode

Determines if changes to a specific property are allowed.
public IsControlPropertyChangeAllowed ( string propertyName, Microsoft.WindowsAPICodePack.Dialogs.DialogControl control ) : bool
propertyName string The name of the property.
control Microsoft.WindowsAPICodePack.Dialogs.DialogControl The control propertyName applies to.
Résultat bool

OnFileOk() protected méthode

Raises the CommonFileDialog.FileOk event just before the dialog is about to return with a result.
protected OnFileOk ( CancelEventArgs e ) : void
e CancelEventArgs The event data.
Résultat void

OnFileTypeChanged() protected méthode

Raises the CommonFileDialog.FileTypeChanged event when the dialog is opened to notify the application of the initial chosen filetype.
protected OnFileTypeChanged ( EventArgs e ) : void
e System.EventArgs The event data.
Résultat void

OnFolderChanged() protected méthode

Raises the CommonFileDialog.FolderChanged event when the user navigates to a new folder.
protected OnFolderChanged ( EventArgs e ) : void
e System.EventArgs The event data.
Résultat void

OnFolderChanging() protected méthode

Raises the FolderChanging to stop navigation to a particular location.
protected OnFolderChanging ( Microsoft.WindowsAPICodePack.Dialogs.CommonFileDialogFolderChangeEventArgs e ) : void
e Microsoft.WindowsAPICodePack.Dialogs.CommonFileDialogFolderChangeEventArgs Cancelable event arguments.
Résultat void

OnOpening() protected méthode

Raises the CommonFileDialog.DialogOpening event when the dialog is opened.
protected OnOpening ( EventArgs e ) : void
e System.EventArgs The event data.
Résultat void

OnSelectionChanged() protected méthode

Raises the CommonFileDialog.SelectionChanged event when the user changes the selection in the dialog's view.
protected OnSelectionChanged ( EventArgs e ) : void
e System.EventArgs The event data.
Résultat void

ResetUserSelections() public méthode

Removes the current selection.
public ResetUserSelections ( ) : void
Résultat void

ShowDialog() public méthode

Displays the dialog.
public ShowDialog ( ) : CommonFileDialogResult
Résultat CommonFileDialogResult

ShowDialog() public méthode

Displays the dialog.
public ShowDialog ( IntPtr ownerWindowHandle ) : CommonFileDialogResult
ownerWindowHandle System.IntPtr Window handle of any top-level window that will own the modal dialog box.
Résultat CommonFileDialogResult

ShowDialog() public méthode

Displays the dialog.
public ShowDialog ( Window window ) : CommonFileDialogResult
window System.Windows.Window Top-level WPF window that will own the modal dialog box.
Résultat CommonFileDialogResult

ThrowIfDialogShowing() protected méthode

Throws an exception when the dialog is showing preventing a requested change to a property or the visible set of controls.
protected ThrowIfDialogShowing ( string message ) : void
message string The message to include in the exception.
Résultat void