2 // System.Windows.Forms.FolderBrowserDialog.cs
5 // Dennis Hayes (dennish@raytek.com)
7 // Alberto Fernandez (infjaf00@yahoo.es)
9 // (C) 2002 Ximian, Inc
12 using System
.Runtime
.Remoting
;
13 using System
.ComponentModel
;
15 namespace System
.Windows
.Forms
{
23 // Beta specs do not specify what class to defrive from.
24 // Using CommonDialog because
25 public class FolderBrowserDialog
: CommonDialog
{
33 public FolderBrowserDialog() {
34 description
= String
.Empty
;
35 folder
= (Dialog
as Gtk
.FileSelection
).Filename
;
39 public override void Reset(){
44 protected override bool RunDialog(IntPtr hWndOwner
){
46 folder
= (Dialog
as Gtk
.FileSelection
).Filename
;
47 return dialogRetValue
;
51 // --- Public Properties
54 public string Description
{
55 get { return description; }
56 set { description = value; }
60 public Environment
.SpecialFolder RootFolder
{
61 get { return Environment.SpecialFolder.Desktop; }
63 if (! Enum
.IsDefined (typeof (Environment
.SpecialFolder
), value)){
64 throw new InvalidEnumArgumentException();
69 public string SelectedPath
{
70 get { return (this.Dialog as Gtk.FileSelection).Filename; }
71 set { (this.Dialog as Gtk.FileSelection).Filename = value; }
74 public bool ShowNewFolderButton
{
75 get { return (this.Dialog as Gtk.FileSelection).FileopCDir.Visible; }
76 set { (this.Dialog as Gtk.FileSelection).FileopCDir.Visible = value;}
78 public override String
ToString(){
79 return "System.Windows.Forms.FolderBrowserDialog";
83 internal override Gtk
.Dialog
CreateDialog (){
84 Gtk
.FileSelection f
= new Gtk
.FileSelection(String
.Empty
);
85 f
.FileList
.Sensitive
= false;
86 f
.FileopDelFile
.Visible
= false;
87 f
.FileopRenFile
.Visible
= false;
88 f
.SelectionEntry
.Visible
= false;
92 internal override void OnCancel (){
93 (Dialog
as Gtk
.FileSelection
).Filename
= folder
;