Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Alberto Cortez <calberto.cortez@gmail.com>2011-06-17 06:37:57 +0400
committerCarlos Alberto Cortez <calberto.cortez@gmail.com>2011-07-04 17:26:23 +0400
commit823ebc1e7fc10debdf1da7c0237751a267a9e008 (patch)
treea0699daad354fb4db41c00e54cb5bd441308fe7d /main/src/addins/WindowsPlatform
parent9cbfca9bd3d1898348ffbb39effdf19e4c9ef64f (diff)
[Windows] Let the extended file dialog use any FileDialog child.
Diffstat (limited to 'main/src/addins/WindowsPlatform')
-rw-r--r--main/src/addins/WindowsPlatform/AddFileDialogHandler.cs8
-rw-r--r--main/src/addins/WindowsPlatform/OpenFileDialogEx.Designer.cs3
-rw-r--r--main/src/addins/WindowsPlatform/OpenFileDialogEx.cs20
3 files changed, 19 insertions, 12 deletions
diff --git a/main/src/addins/WindowsPlatform/AddFileDialogHandler.cs b/main/src/addins/WindowsPlatform/AddFileDialogHandler.cs
index a1c205361c..6c43872baf 100644
--- a/main/src/addins/WindowsPlatform/AddFileDialogHandler.cs
+++ b/main/src/addins/WindowsPlatform/AddFileDialogHandler.cs
@@ -19,7 +19,7 @@ namespace MonoDevelop.Platform
WinFormsRunner runner = new WinFormsRunner();
bool result = false;
- SelectFileDialogHandler.SetCommonFormProperties (data, adlg.OpenDialog);
+ SelectFileDialogHandler.SetCommonFormProperties (data, adlg.FileDialog);
Timer t = new Timer();
t.Interval = 20;
@@ -35,9 +35,9 @@ namespace MonoDevelop.Platform
result = false;
else
{
- FilePath[] paths = new FilePath [adlg.OpenDialog.FileNames.Length];
- for (int n=0; n<adlg.OpenDialog.FileNames.Length; n++)
- paths [n] = adlg.OpenDialog.FileNames [n];
+ FilePath[] paths = new FilePath [adlg.FileDialog.FileNames.Length];
+ for (int n=0; n<adlg.FileDialog.FileNames.Length; n++)
+ paths [n] = adlg.FileDialog.FileNames [n];
data.SelectedFiles = paths;
data.OverrideAction = adlg.OverrideAction;
result = true;
diff --git a/main/src/addins/WindowsPlatform/OpenFileDialogEx.Designer.cs b/main/src/addins/WindowsPlatform/OpenFileDialogEx.Designer.cs
index 7dc63b608b..c2ddc1c6e0 100644
--- a/main/src/addins/WindowsPlatform/OpenFileDialogEx.Designer.cs
+++ b/main/src/addins/WindowsPlatform/OpenFileDialogEx.Designer.cs
@@ -28,7 +28,6 @@ namespace CustomControls.Controls
/// </summary>
private void InitializeComponent()
{
- this.dlgOpen = new System.Windows.Forms.OpenFileDialog();
this.SuspendLayout();
//
// OpenFileDialogEx
@@ -41,8 +40,6 @@ namespace CustomControls.Controls
#endregion
- protected System.Windows.Forms.OpenFileDialog dlgOpen;
-
}
} \ No newline at end of file
diff --git a/main/src/addins/WindowsPlatform/OpenFileDialogEx.cs b/main/src/addins/WindowsPlatform/OpenFileDialogEx.cs
index 1e43c5ca25..76ee436043 100644
--- a/main/src/addins/WindowsPlatform/OpenFileDialogEx.cs
+++ b/main/src/addins/WindowsPlatform/OpenFileDialogEx.cs
@@ -57,21 +57,31 @@ namespace CustomControls.Controls
#region Variables Declaration
private AddonWindowLocation mStartLocation = AddonWindowLocation.Right;
private FolderViewMode mDefaultViewMode= FolderViewMode.Default;
+ private FileDialog fileDialog;
#endregion
- #region Constructors
- public OpenFileDialogEx()
+ #region Constructors
+ public OpenFileDialogEx () : this (new OpenFileDialog ())
+ {
+ }
+
+ public OpenFileDialogEx (FileDialog fileDialog)
{
+ if (fileDialog == null)
+ throw new ArgumentNullException ("fileDialog");
+
InitializeComponent();
// dlgOpen.AutoUpgradeEnabled = false;
//SetStyle(ControlStyles.SupportsTransparentBackColor, true);
+
+ this.fileDialog = fileDialog;
}
#endregion
#region Properties
- public OpenFileDialog OpenDialog
+ public FileDialog FileDialog
{
- get {return dlgOpen;}
+ get {return fileDialog;}
}
[DefaultValue(AddonWindowLocation.Right)]
@@ -123,7 +133,7 @@ namespace CustomControls.Controls
form.WatchForActivate = true;
try
{
- return dlgOpen.ShowDialog(form);
+ return fileDialog.ShowDialog(form);
}
catch (Exception ex)
{