[Monodevelop-patches-list] r1141 - in trunk/MonoDevelop: . src/AddIns/BackendBindings/CSharpBinding/Gui src/Main/Base/Commands src/Main/Base/Commands/ProjectBrowserCommands src/Main/Base/Gui/Dialogs/OptionPanels/ProjectOptions src/Main/Base/Gui/Dialogs/ReferenceDialog src/Main/Base/Internal/Project/Combine src/Main/Base/Internal/Project/Project
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Wed Mar 10 23:21:10 EST 2004
Author: jluke
Date: 2004-03-10 23:21:09 -0500 (Wed, 10 Mar 2004)
New Revision: 1141
Removed:
trunk/MonoDevelop/FIND_PROBLEMS
Modified:
trunk/MonoDevelop/ChangeLog
trunk/MonoDevelop/TODO
trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Gui/OutputOptionsPanel.cs
trunk/MonoDevelop/src/Main/Base/Commands/FileCommands.cs
trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs
trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/FolderNodeCommands.cs
trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/ResourceFolderNodeCommands.cs
trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/ProjectOptions/DeployFileOptions.cs
trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs
trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs
trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/AbstractProject.cs
Log:
* *.cs: anywhere a FileSelection dialog is used wrap it in using {}, remove some obsolete/leftover stuff from the SD port
Modified: trunk/MonoDevelop/ChangeLog
===================================================================
--- trunk/MonoDevelop/ChangeLog 2004-03-10 21:19:47 UTC (rev 1140)
+++ trunk/MonoDevelop/ChangeLog 2004-03-11 04:21:09 UTC (rev 1141)
@@ -2,6 +2,8 @@
* README: add monodoc and debugger to list of deps
* configure.in: report Gtk#, monodoc, mono debugger results
+ * *.cs: anywhere a FileSelection dialog is used wrap it in
+ using {}, remove some obsolete/leftover stuff from the SD port
2004-03-10 Todd Berman <tberman at sevenl.net>
Deleted: trunk/MonoDevelop/FIND_PROBLEMS
===================================================================
Modified: trunk/MonoDevelop/TODO
===================================================================
--- trunk/MonoDevelop/TODO 2004-03-10 21:19:47 UTC (rev 1140)
+++ trunk/MonoDevelop/TODO 2004-03-11 04:21:09 UTC (rev 1141)
@@ -1,3 +1,6 @@
+NOTE: This file is deprecated please use bugzilla instead.
+http://bugzilla.ximian.com/
+
Editor
------
- Get code-folding working (not implemented in #d).
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Gui/OutputOptionsPanel.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Gui/OutputOptionsPanel.cs 2004-03-10 21:19:47 UTC (rev 1140)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Gui/OutputOptionsPanel.cs 2004-03-11 04:21:09 UTC (rev 1141)
@@ -94,53 +94,56 @@
void SelectFolder(object sender, EventArgs e)
{
- FileSelection fdiag = new FileSelection (
- "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}");
+ using (FileSelection fdiag = new FileSelection (
+ "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}")) {
+ if (fdiag.Run () == (int) ResponseType.Ok) {
+ outputDirectoryEntry.Text = fdiag.Filename;
+ }
- if (fdiag.Run () == (int) ResponseType.Ok) {
- outputDirectoryEntry.Text = fdiag.Filename;
+ fdiag.Hide ();
}
- fdiag.Hide ();
- fdiag.Dispose ();
}
void SelectFile2(object sender, EventArgs e)
{
- FileSelection fdiag = new FileSelection ("");
- //fdiag.Filter = StringParserService.Parse("${res:SharpDevelop.FileFilter.AllFiles}|*.*");
- fdiag.SelectMultiple = false;
+ using (FileSelection fdiag = new FileSelection ("")) {
+ //fdiag.Filter = StringParserService.Parse("${res:SharpDevelop.FileFilter.AllFiles}|*.*");
+ fdiag.SelectMultiple = false;
- if(fdiag.Run () == (int) ResponseType.Ok) {
- executeBeforeEntry.Text = fdiag.Filename;
+ if(fdiag.Run () == (int) ResponseType.Ok) {
+ executeBeforeEntry.Text = fdiag.Filename;
+ }
+
+ fdiag.Hide ();
}
- fdiag.Hide ();
- fdiag.Dispose ();
}
void SelectFile3(object sender, EventArgs e)
{
- FileSelection fdiag = new FileSelection ("");
- //fdiag.Filter = StringParserService.Parse("${res:SharpDevelop.FileFilter.AllFiles}|*.*");
- fdiag.SelectMultiple = false;
+ using (FileSelection fdiag = new FileSelection ("")) {
+ //fdiag.Filter = StringParserService.Parse("${res:SharpDevelop.FileFilter.AllFiles}|*.*");
+ fdiag.SelectMultiple = false;
- if(fdiag.Run () == (int) ResponseType.Ok) {
- executeAfterEntry.Text = fdiag.Filename;
+ if(fdiag.Run () == (int) ResponseType.Ok) {
+ executeAfterEntry.Text = fdiag.Filename;
+ }
+
+ fdiag.Hide ();
}
- fdiag.Hide ();
- fdiag.Dispose ();
}
void SelectFile4(object sender, EventArgs e)
{
- FileSelection fdiag = new FileSelection ("");
- //fdiag.Filter = StringParserService.Parse("${res:SharpDevelop.FileFilter.AllFiles}|*.*");
- fdiag.SelectMultiple = false;
+ using (FileSelection fdiag = new FileSelection ("")) {
+ //fdiag.Filter = StringParserService.Parse("${res:SharpDevelop.FileFilter.AllFiles}|*.*");
+ fdiag.SelectMultiple = false;
- if(fdiag.Run () == (int) ResponseType.Ok) {
- executeScriptEntry.Text = fdiag.Filename;
+ if(fdiag.Run () == (int) ResponseType.Ok) {
+ executeScriptEntry.Text = fdiag.Filename;
+ }
+
+ fdiag.Hide ();
}
- fdiag.Hide ();
- fdiag.Dispose ();
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Commands/FileCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/FileCommands.cs 2004-03-10 21:19:47 UTC (rev 1140)
+++ trunk/MonoDevelop/src/Main/Base/Commands/FileCommands.cs 2004-03-11 04:21:09 UTC (rev 1141)
@@ -7,19 +7,12 @@
using System;
using System.IO;
-using System.Threading;
-using System.Drawing;
-using System.Drawing.Printing;
using System.Collections;
-using System.ComponentModel;
-using System.Diagnostics;
using MonoDevelop.Core.AddIns;
-
using MonoDevelop.Core.Properties;
using MonoDevelop.Core.AddIns.Codons;
using MonoDevelop.Core.Services;
-
using MonoDevelop.Services;
using MonoDevelop.Internal.Project;
using MonoDevelop.Gui;
@@ -43,10 +36,12 @@
{
public override void Run()
{
- NewFileDialog nfd = new NewFileDialog();
- nfd.ShowAll();
- if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow != null) {
- WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.SelectWindow();
+ using (NewFileDialog nfd = new NewFileDialog()) {
+ nfd.ShowAll ();
+ if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow != null)
+ {
+ WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.SelectWindow();
+ }
}
}
}
@@ -150,21 +145,22 @@
}
}*/
- Gtk.FileSelection fdiag = new Gtk.FileSelection ("Save as...");
- fdiag.Filename = window.ViewContent.ContentName;
- int response = fdiag.Run ();
- string filename = fdiag.Filename;
- fdiag.Destroy ();
+ using (Gtk.FileSelection fdiag = new Gtk.FileSelection ("Save as...")) {
+ fdiag.Filename = window.ViewContent.ContentName;
+ int response = fdiag.Run ();
+ string filename = fdiag.Filename;
+ fdiag.Hide ();
- if (response == (int)Gtk.ResponseType.Ok) {
- IFileService fileService = (IFileService)MonoDevelop.Core.Services.ServiceManager.Services.GetService(typeof(IFileService));
- FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
- if (!fileUtilityService.IsValidFileName(filename)) {
- IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
- messageService.ShowMessage("File name " + filename +" is invalid");
- return;
- }
-
+
+ if (response == (int)Gtk.ResponseType.Ok) {
+ IFileService fileService = (IFileService)MonoDevelop.Core.Services.ServiceManager.Services.GetService(typeof(IFileService));
+ FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
+ if (!fileUtilityService.IsValidFileName(filename)) {
+ IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
+ messageService.ShowMessage("File name " + filename +" is invalid");
+ return;
+ }
+
// save backup first
if((bool) PropertyService.GetProperty ("SharpDevelop.CreateBackupCopy", false)) {
fileUtilityService.ObservedSave(new NamedFileOperationDelegate(window.ViewContent.Save), filename + "~");
@@ -177,7 +173,7 @@
messageService.ShowMessage(filename, "File saved");
}
}
- //} USING
+ }
}
}
}
@@ -193,23 +189,33 @@
continue;
}
- if (content.ContentName == null) {
- Gtk.FileSelection fdiag = new Gtk.FileSelection ("Save File As...");
- fdiag.Filename = System.Environment.GetEnvironmentVariable ("HOME");
- if (fdiag.Run () == (int)Gtk.ResponseType.Ok) {
- string fileName = fdiag.Filename;
- // currently useless, because the fdiag.FileName can't
- // handle wildcard extensions :(
- if (Path.GetExtension(fileName).StartsWith("?") || Path.GetExtension(fileName) == "*") {
- fileName = Path.ChangeExtension(fileName, "");
+ if (content.ContentName == null)
+ {
+ using (Gtk.FileSelection fdiag = new Gtk.FileSelection ("Save File As..."))
+ {
+ fdiag.Filename = System.Environment.GetEnvironmentVariable ("HOME");
+ if (fdiag.Run () == (int) Gtk.ResponseType.Ok)
+ {
+ string fileName = fdiag.Filename;
+
+ // currently useless
+ if (Path.GetExtension(fileName).StartsWith("?") || Path.GetExtension(fileName) == "*")
+ {
+ fileName = Path.ChangeExtension(fileName, "");
+ }
+
+ if (fileUtilityService.ObservedSave(new NamedFileOperationDelegate(content.Save), fileName) == FileOperationResult.OK)
+ {
+ IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
+ messageService.ShowMessage(fileName, "File saved");
+ }
}
- if (fileUtilityService.ObservedSave(new NamedFileOperationDelegate(content.Save), fileName) == FileOperationResult.OK) {
- IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
- messageService.ShowMessage(fileName, "File saved");
- }
+
+ fdiag.Hide ();
}
- fdiag.Destroy ();
- } else {
+ }
+ else
+ {
fileUtilityService.ObservedSave(new FileOperationDelegate(content.Save), content.ContentName);
}
}
@@ -222,37 +228,33 @@
public override void Run()
{
- Gtk.FileSelection fs = new Gtk.FileSelection ("File to Open");
- string defaultFolder = PropertyService.GetProperty(
- "MonoDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath",
+ using (Gtk.FileSelection fs = new Gtk.FileSelection ("File to Open")) {
+ string defaultFolder = PropertyService.GetProperty(
+ "MonoDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath",
System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal),
"MonoDevelopProjects")).ToString();
- fs.Complete (defaultFolder);
- int response = fs.Run ();
- string name = fs.Filename;
- fs.Hide ();
- fs.Destroy ();
+ fs.Complete (defaultFolder);
+ int response = fs.Run ();
+ string name = fs.Filename;
+ fs.Hide ();
-// fdiag.AddExtension = true;
-// fdiag.Filter = String.Join("|", (string[])(AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Workbench/Combine/FileFilter").BuildChildItems(this)).ToArray(typeof(string)));
-// fdiag.Multiselect = false;
-// fdiag.CheckFileExists = true;
- if (response == (int)Gtk.ResponseType.Ok) {
- switch (Path.GetExtension(name).ToUpper()) {
- case ".CMBX": // Don't forget the 'recent' projects if you chance something here
- case ".PRJX":
- IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.Services.GetService(typeof(IProjectService));
+ if (response == (int)Gtk.ResponseType.Ok) {
+ switch (Path.GetExtension(name).ToUpper()) {
+ case ".CMBX": // Don't forget the 'recent' projects if you chance something here
+ case ".PRJX":
+ IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.Services.GetService(typeof(IProjectService));
- try {
- projectService.OpenCombine(name);
- } catch (Exception ex) {
- CombineLoadError.HandleError(ex, name);
- }
- break;
- default:
- IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
- messageService.ShowError("Can't open file " + name + "as project");
- break;
+ try {
+ projectService.OpenCombine(name);
+ } catch (Exception ex) {
+ CombineLoadError.HandleError(ex, name);
+ }
+ break;
+ default:
+ IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
+ messageService.ShowError("Can't open file " + name + "as project");
+ break;
+ }
}
}
}
@@ -302,45 +304,26 @@
if (window != null) {
for (int i = 0; i < fileFilters.Length; ++i) {
if (fileFilters[i].IndexOf(Path.GetExtension(window.ViewContent.ContentName == null ? window.ViewContent.UntitledName : window.ViewContent.ContentName)) >= 0) {
-#if !GTK
- fdiag.FilterIndex = i + 1;
-#endif
break;
}
}
}
}
- Gtk.FileSelection fs = new Gtk.FileSelection ("File to Open");
- string defaultFolder = PropertyService.GetProperty(
- "MonoDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath",
- System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal),
- "MonoDevelopProjects")).ToString();
- fs.Complete (defaultFolder);
- int response = fs.Run ();
- string name = fs.Filename;
- fs.Destroy ();
+ using (Gtk.FileSelection fs = new Gtk.FileSelection ("File to Open")) {
+ string defaultFolder = PropertyService.GetProperty(
+ "MonoDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath",
+ System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal),
+ "MonoDevelopProjects")).ToString();
+ fs.Complete (defaultFolder);
+ int response = fs.Run ();
+ string name = fs.Filename;
-#if !GTK
- fdiag.Multiselect = true;
- fdiag.CheckFileExists = true;
-
- if (fdiag.ShowDialog() == DialogResult.OK) {
-#endif
if (response == (int)Gtk.ResponseType.Ok) {
IFileService fileService = (IFileService)MonoDevelop.Core.Services.ServiceManager.Services.GetService(typeof(IFileService));
-#if !GTK
- foreach (string name in fdiag.FileNames) {
-#endif
- Console.WriteLine ("opening: " + name);
fileService.OpenFile(name);
-#if !GTK
- }
-#endif
}
-#if !GTK //} from using
}
-#endif
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs 2004-03-10 21:19:47 UTC (rev 1140)
+++ trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs 2004-03-11 04:21:09 UTC (rev 1141)
@@ -76,12 +76,9 @@
CombineBrowserNode node = browser.SelectedNode as CombineBrowserNode;
if (node != null) {
- Gtk.FileSelection fdiag = new Gtk.FileSelection ("Add a Project");
- //fdiag.AddExtension = true;
+ using (Gtk.FileSelection fdiag = new Gtk.FileSelection ("Add a Project")) {
StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
- //fdiag.Filter = stringParserService.Parse("${res:SharpDevelop.FileFilter.ProjectFiles}|*.prjx|${res:SharpDevelop.FileFilter.AllFiles}|*.*");
fdiag.SelectMultiple = false;
- //fdiag.CheckFileExists = true;
if (fdiag.Run () == (int) Gtk.ResponseType.Ok) {
object obj = node.Combine.AddEntry(fdiag.Filename);
if (obj is IProject) {
@@ -93,6 +90,7 @@
}
fdiag.Hide ();
+ }
}
}
}
@@ -106,12 +104,9 @@
CombineBrowserNode node = browser.SelectedNode as CombineBrowserNode;
if (node != null) {
- Gtk.FileSelection fdiag = new Gtk.FileSelection ("Add a Combine");
- //fdiag.AddExtension = true;
+ using (Gtk.FileSelection fdiag = new Gtk.FileSelection ("Add a Combine")) {
StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
- //fdiag.Filter = stringParserService.Parse("${res:SharpDevelop.FileFilter.CombineFiles}|*.cmbx|${res:SharpDevelop.FileFilter.AllFiles}|*.*");
fdiag.SelectMultiple = false;
- //fdiag.CheckFileExists = true;
if (fdiag.Run () == (int) Gtk.ResponseType.Ok) {
object obj = node.Combine.AddEntry(fdiag.Filename);
if (obj is IProject) {
@@ -121,7 +116,9 @@
}
projectService.SaveCombine();
}
+
fdiag.Hide ();
+ }
}
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/FolderNodeCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/FolderNodeCommands.cs 2004-03-10 21:19:47 UTC (rev 1140)
+++ trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/FolderNodeCommands.cs 2004-03-11 04:21:09 UTC (rev 1141)
@@ -39,21 +39,8 @@
AbstractBrowserNode node = (AbstractBrowserNode)browser.SelectedNode;
- FileSelection fdiag = new FileSelection ("Add a file");
- //fdiag.AddExtension = true;
- //string[] fileFilters = (string[])(AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Workbench/FileFilter").BuildChildItems(this)).ToArray(typeof(string));
-
-// TODO : Set the file filters to the current project
-// for (int i = 0; i < fileFilters.Length; ++i) {
-// if (fileFilters[i].IndexOf(Path.GetExtension(window.ViewContent.ContentName == null ? window.ViewContent.UntitledName : window.ViewContent.ContentName)) >= 0) {
-// fdiag.FilterIndex = i + 1;
-// break;
-// }
-// }
-
- //fdiag.Filter = String.Join("|", fileFilters);
+ using (FileSelection fdiag = new FileSelection ("Add a file")) {
fdiag.SelectMultiple = true;
- //fdiag.CheckFileExists = true;
int result = fdiag.Run ();
try {
@@ -83,8 +70,9 @@
}
}
} finally {
- fdiag.Destroy ();
+ fdiag.Hide ();
}
+ }
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/ResourceFolderNodeCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/ResourceFolderNodeCommands.cs 2004-03-10 21:19:47 UTC (rev 1140)
+++ trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/ResourceFolderNodeCommands.cs 2004-03-11 04:21:09 UTC (rev 1141)
@@ -42,42 +42,42 @@
if (node != null) {
IProject project = ((ProjectBrowserNode) node.Parent).Project;
- show_dialog:
+ show_dialog:
- Gtk.FileSelection fs = new Gtk.FileSelection ("File to Open");
- fs.SelectMultiple = true;
- fs.Filename = project.BaseDirectory;
- int response = fs.Run ();
- string [] files = fs.Selections;
+ using (Gtk.FileSelection fs = new Gtk.FileSelection ("File to Open")) {
+ fs.SelectMultiple = true;
+ fs.Filename = project.BaseDirectory;
+ int response = fs.Run ();
+ string [] files = fs.Selections;
+ fs.Hide ();
+
+ if (response != (int)Gtk.ResponseType.Ok)
+ return;
- fs.Destroy ();
-
- if (response != (int)Gtk.ResponseType.Ok)
- return;
-
- foreach (string file in files) {
- if (! File.Exists (file)) {
- IMessageService messageService = (IMessageService) ServiceManager.Services.GetService (typeof (IMessageService));
- messageService.ShowError (String.Format ("Resource file `{0}' does not exist", file));
- goto show_dialog;
+ foreach (string file in files) {
+ if (! File.Exists (file)) {
+ IMessageService messageService = (IMessageService) ServiceManager.Services.GetService (typeof (IMessageService));
+ messageService.ShowError (String.Format ("Resource file `{0}' does not exist", file));
+ goto show_dialog;
+ }
}
- }
+ IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.Services.GetService(typeof(IProjectService));
+ ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
- IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.Services.GetService(typeof(IProjectService));
- ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
-
- foreach (string fileName in files) {
- ProjectFile fileInformation = projectService.AddFileToProject(project, fileName, BuildAction.EmbedAsResource);
+ foreach (string fileName in files) {
+ ProjectFile fileInformation = projectService.AddFileToProject(project, fileName, BuildAction.EmbedAsResource);
- AbstractBrowserNode newResNode = new FileNode(fileInformation);
- newResNode.Image = Stock.ResourceFileIcon;
- node.Nodes.Add (newResNode);
+ AbstractBrowserNode newResNode = new FileNode(fileInformation);
+ newResNode.Image = Stock.ResourceFileIcon;
+ node.Nodes.Add (newResNode);
+ }
+
+ node.Expand();
+ projectService.SaveCombine();
}
- node.Expand();
- projectService.SaveCombine();
}
}
}
-
}
+
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/ProjectOptions/DeployFileOptions.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/ProjectOptions/DeployFileOptions.cs 2004-03-10 21:19:47 UTC (rev 1140)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/OptionPanels/ProjectOptions/DeployFileOptions.cs 2004-03-11 04:21:09 UTC (rev 1141)
@@ -94,23 +94,23 @@
//FIXME : Finish details in this dialog.
void SelectScriptFileEvent(object sender, EventArgs e)
{
- FileSelection fs = new FileSelection ("Select your File"); // Put correct title
- fs.Complete("*.txt");
-// fs.Complete(StringParserService.Parse("${res:SharpDevelop.FileFilter.ExecutableFiles}|*.exe;*.com;*.pif;*.bat;*.cmd|${res:SharpDevelop.FileFilter.AllFiles}|*.*"));
-// fdiag.Filter = StringParserService.Parse("${res:SharpDevelop.FileFilter.ExecutableFiles}|*.exe;*.com;*.pif;*.bat;*.cmd|${res:SharpDevelop.FileFilter.AllFiles}|*.*");
- if ( fs.Run () == (int) ResponseType.Ok) {
- deployScriptEntry.Text = fs.SelectionEntry.Text;
- }
- fs.Hide ();
+ using (FileSelection fs = new FileSelection ("Select your File")) { // Put correct title
+ fs.Complete("*.txt");
+ if ( fs.Run () == (int) ResponseType.Ok) {
+ deployScriptEntry.Text = fs.SelectionEntry.Text;
+ }
+ fs.Hide ();
+ }
}
void SelectTargetFolderEvent(object sender, EventArgs e)
{
- FileSelection fs = new FileSelection ("${res:Dialog.Options.PrjOptions.DeployFile.FolderDialogDescription}");
- if ( fs.Run () == (int) ResponseType.Ok) {
- deployTargetEntry.Text = fs.SelectionEntry.Text;
+ using (FileSelection fs = new FileSelection ("${res:Dialog.Options.PrjOptions.DeployFile.FolderDialogDescription}")) {
+ if ( fs.Run () == (int) ResponseType.Ok) {
+ deployTargetEntry.Text = fs.SelectionEntry.Text;
+ }
+ fs.Hide ();
}
- fs.Hide ();
}
void RadioButtonClicked(object sender, EventArgs e)
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs 2004-03-10 21:19:47 UTC (rev 1140)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs 2004-03-11 04:21:09 UTC (rev 1141)
@@ -8,10 +8,6 @@
using System;
using System.IO;
using System.Text;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using MSjogren.GacTool.FusionNative;
using MonoDevelop.Internal.Project;
using MonoDevelop.Core.Services;
@@ -37,32 +33,33 @@
{
// FIXME: il8n the dialog name
StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
- FileSelection fdiag = new FileSelection("Find .Net Assembly");
+ using (FileSelection fdiag = new FileSelection("Find .Net Assembly")) {
// FIXME: this should only allow dll's and exe's
- fdiag.Complete("*");
- fdiag.SelectMultiple = true;
- int response = fdiag.Run();
- string[] selectedFiles = new string[fdiag.Selections.Length];
- fdiag.Selections.CopyTo(selectedFiles, 0);
- fdiag.Destroy();
+ // fdiag.Complete("*");
+ fdiag.SelectMultiple = true;
+ int response = fdiag.Run();
+ string[] selectedFiles = new string[fdiag.Selections.Length];
+ fdiag.Selections.CopyTo(selectedFiles, 0);
+ fdiag.Hide ();
- if (response == (int) ResponseType.Ok) {
- foreach (string file in selectedFiles) {
- bool isAssembly = true;
- try {
- System.Reflection.AssemblyName.GetAssemblyName(System.IO.Path.GetFullPath (file));
- } catch (Exception assemblyExcep) {
- isAssembly = false;
- }
+ if (response == (int) ResponseType.Ok) {
+ foreach (string file in selectedFiles) {
+ bool isAssembly = true;
+ try {
+ System.Reflection.AssemblyName.GetAssemblyName(System.IO.Path.GetFullPath (file));
+ } catch (Exception assemblyExcep) {
+ isAssembly = false;
+ }
- if (isAssembly) {
- selectDialog.AddReference(ReferenceType.Assembly,
- System.IO.Path.GetFileName(file),
- file);
- } else {
- IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
- // FIXME: il8n this
- messageService.ShowError("File " + file + "is not a valid .Net Assembly");
+ if (isAssembly) {
+ selectDialog.AddReference(ReferenceType.Assembly,
+ System.IO.Path.GetFileName(file),
+ file);
+ } else {
+ IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
+ // FIXME: il8n this
+ messageService.ShowError("File " + file + "is not a valid .Net Assembly");
+ }
}
}
}
@@ -70,7 +67,7 @@
public void AddReference(object sender, EventArgs e)
{
- System.Console.WriteLine("This panel will contain a file browser, but so long use the browse button :)");
+ //System.Console.WriteLine("This panel will contain a file browser, but so long use the browse button :)");
}
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs 2004-03-10 21:19:47 UTC (rev 1140)
+++ trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs 2004-03-11 04:21:09 UTC (rev 1141)
@@ -304,15 +304,17 @@
public void SaveCombineAs()
{
- Gtk.FileSelection fdiag = new Gtk.FileSelection ("Save Combine As...");
- fdiag.Filename = System.Environment.GetEnvironmentVariable ("HOME");
- if (fdiag.Run() == (int)Gtk.ResponseType.Ok) {
- string filename = fdiag.Filename;
- SaveCombine(filename);
- IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
- messageService.ShowMessage(filename, resourceService.GetString("Internal.Project.Combine.CombineSavedMessage"));
+ using (Gtk.FileSelection fdiag = new Gtk.FileSelection ("Save Combine As...")) {
+ fdiag.Filename = System.Environment.GetEnvironmentVariable ("HOME");
+ if (fdiag.Run() == (int)Gtk.ResponseType.Ok) {
+ string filename = fdiag.Filename;
+ SaveCombine(filename);
+ IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
+ messageService.ShowMessage(filename, resourceService.GetString("Internal.Project.Combine.CombineSavedMessage"));
+ }
+
+ fdiag.Hide ();
}
- fdiag.Destroy ();
}
public object AddEntry(string filename)
Modified: trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/AbstractProject.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/AbstractProject.cs 2004-03-10 21:19:47 UTC (rev 1140)
+++ trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/AbstractProject.cs 2004-03-11 04:21:09 UTC (rev 1141)
@@ -6,19 +6,17 @@
// </file>
using System;
+using System.ComponentModel;
+using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Collections;
using System.Collections.Specialized;
-using System.Diagnostics;
using System.Reflection;
-using System.ComponentModel;
using System.Xml;
using MonoDevelop.Core.Properties;
-
using MonoDevelop.Core.AddIns;
-
using MonoDevelop.Internal.Project.Collections;
using MonoDevelop.Internal.Project;
using MonoDevelop.Core.Services;
@@ -27,8 +25,6 @@
namespace MonoDevelop.Internal.Project
{
-
-
/// <summary>
/// External language bindings must extend this class
/// </summary>
@@ -511,19 +507,21 @@
public void SaveProjectAs()
{
- Gtk.FileSelection fdiag = new Gtk.FileSelection ("Save Project As...");
- fdiag.Filename = System.Environment.GetEnvironmentVariable ("HOME");
+ using (Gtk.FileSelection fdiag = new Gtk.FileSelection ("Save Project As...")) {
+ fdiag.Filename = System.Environment.GetEnvironmentVariable ("HOME");
- if (fdiag.Run() == (int)Gtk.ResponseType.Ok) {
- string filename = fdiag.Filename;
- SaveProject(filename);
- IResourceService resourceService = (IResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
- IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
- messageService.ShowMessage(filename, resourceService.GetString("Internal.Project.DefaultProject.ProjectSavedMessage"));
+ if (fdiag.Run() == (int)Gtk.ResponseType.Ok) {
+ string filename = fdiag.Filename;
+ SaveProject(filename);
+ IResourceService resourceService = (IResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
+ IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
+ messageService.ShowMessage(filename, resourceService.GetString("Internal.Project.DefaultProject.ProjectSavedMessage"));
+ }
+
+ fdiag.Hide ();
}
- fdiag.Destroy ();
}
-
+
public void CopyReferencesToOutputPath(bool force)
{
AbstractProjectConfiguration config = ActiveConfiguration as AbstractProjectConfiguration;
More information about the Monodevelop-patches-list
mailing list