Files
mono/mcs/class/System.Windows.Forms/Gtk/FileDialog.cs
T
Joel Basson 802417f479 Thu Jan 16 19:20:00 GMT+2 2003 Joel Basson <[email protected]>
* Applied patch from Alberto Fernandez with the following changes...
	Finished ProgressBar (Events?)
	Finished HScrollBar VScrollBar and ScrollBar
	Finished FolderBrowserDialog
	Base ComboBox
	Added DrawMode.cs
	Added ComboBoxStyle.cs
	Added Appearance.cs
	Added CheckState.cs
	Added TabAlignment
	Added TabAppearance.cs
	Added TabDrawMode.cs
	Added TabSizeMode.cs
	Added Panel.cs
	Added TabPage.cs
	Added TabControl.cs
	Added Cursors.cs
	Added MessageBoxDefaultButton.cs
	Added MessageBoxIcon.cs
	Added MessageBoxOptions.cs
	Changes in MessageBoxButtons.cs (Added values)
	Changes in MessageBox (Completed all functions, added return values).
	"Finished" CheckBox.cs
	"Finished" ComboBox.cs
	"Finished" RadioButton
	"Finished" GroupBox
	"Finished" Panel
	Changes in Form to work with new RadioButton.
	Fix double Click reported on MenuItems.
	"Finished" Application

svn path=/trunk/mcs/; revision=22123
2004-01-15 17:19:30 +00:00

156 lines
3.1 KiB
C#

//
// System.Windows.Forms.FileDialog.cs
//
// Author:
// stubbed out by Daniel Carrera ([email protected])
// Dennis Hayes ([email protected])
// Aleksey Ryabchuk ([email protected])
// (C) 2002 Ximian, Inc
//
using System.ComponentModel;
using System.Runtime.InteropServices;
namespace System.Windows.Forms {
// <summary>
// Displays a dialog window from which the user can select a file.
// </summary>
public abstract class FileDialog : CommonDialog {
private string fileName;
private bool addExtension;
private bool checkFileExists;
private bool checkPathExists;
private string defaultExt;
private bool dereferenceLinks;
int filterIndex;
string filter;
bool showHelp;
string initialDirectory;
bool restoreDirectory;
bool validateNames;
// Don't use, ?
//protected static readonly object EventFileOk;
protected FileDialog ( ):base(){
this.Reset();
}
public bool AddExtension {
get { return addExtension; }
set { addExtension = value; }
}
public virtual bool CheckFileExists {
get { return checkFileExists; }
set { checkFileExists = value; }
}
public bool CheckPathExists {
get { return checkPathExists; }
set { checkPathExists = value; }
}
public string DefaultExt {
get { return defaultExt; }
set {
if ( value.StartsWith ( "." ) )
defaultExt = value.Remove( 0, 1 );
else
defaultExt = value;
}
}
public bool DereferenceLinks {
get { return dereferenceLinks; }
set { dereferenceLinks = value; }
}
public string FileName {
get { return (Dialog as Gtk.FileSelection).Filename;}
set { (Dialog as Gtk.FileSelection).Filename = value;}
}
[MonoTODO]
public string[] FileNames {
get {return new String[]{this.FileName};}
}
public string Filter {
get { return filter; }
set { filter = value;}
}
public int FilterIndex {
get { return filterIndex; }
set { filterIndex = value; }
}
public string InitialDirectory {
get { return initialDirectory; }
set { initialDirectory = value; }
}
public bool RestoreDirectory {
get { return restoreDirectory; }
set { restoreDirectory = value; }
}
public bool ShowHelp {
get { return showHelp; }
set { showHelp = value; }
}
public string Title {
get { return Dialog.Title; }
set { Dialog.Title = value;}
}
public bool ValidateNames {
get { return validateNames; }
set { validateNames = value; }
}
public override void Reset(){
fileName = string.Empty;
checkFileExists = false;
addExtension = true;
defaultExt = string.Empty;
filter = string.Empty;
filterIndex = 1;
checkPathExists = true;
dereferenceLinks = true;
showHelp = false;
initialDirectory = string.Empty;
restoreDirectory = false;
validateNames = true;
}
[MonoTODO]
public override string ToString(){
return base.ToString();
}
public event CancelEventHandler FileOk;
protected void OnFileOk( CancelEventArgs e ){
if ( FileOk != null )
FileOk ( this, e );
}
[MonoTODO]
protected override bool RunDialog( IntPtr hWndOwner ){
Dialog.Run();
return dialogRetValue;
}
}
}