From a202c6e274a340479516293066f024cc345a25ec Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 11 May 2013 21:12:19 +0200 Subject: [PATCH] add "All known file extensions" to "Open file" FileFilter --- data/resources/StringResources.fr.resx | 2 +- data/resources/StringResources.it.resx | 72 +++++++++++++++++++ data/resources/StringResources.resx | 3 + data/resources/StringResources.ru.resx | 2 +- data/resources/StringResources.tr.resx | 15 ++++ .../Base/Project/Src/Commands/FileCommands.cs | 27 +------ .../Services/ProjectService/ProjectService.cs | 26 +++++++ 7 files changed, 120 insertions(+), 27 deletions(-) diff --git a/data/resources/StringResources.fr.resx b/data/resources/StringResources.fr.resx index f07b8c49bc..f60b7f2b8e 100644 --- a/data/resources/StringResources.fr.resx +++ b/data/resources/StringResources.fr.resx @@ -2371,7 +2371,7 @@ Voulez-vous ajouter le nouveau fichier au projet ${CurrentProjectName}? Tout processeur - x86/x64 - préfère 64 bits + x86/x64 - préfère 32 bits x86/x64 - préfère 64 bits diff --git a/data/resources/StringResources.it.resx b/data/resources/StringResources.it.resx index 0dab7dd7f3..40dd09b7fb 100644 --- a/data/resources/StringResources.it.resx +++ b/data/resources/StringResources.it.resx @@ -1502,6 +1502,9 @@ Ad esempio: "120", "MainClass", "Main.cs, 120". Versione delle impostazioni non supportata! + + Questo comando elimina tutte le personalizzazioni prima di importare i files selezionati. Continuare? + Valore @@ -1863,6 +1866,12 @@ Vuoi aggiungere il nuovo file al progetto ${CurrentProjectName}? Debugging + + Attiva decompilatore + + + Attiva Modifica e Continua + Eccezioni @@ -1893,6 +1902,12 @@ Vuoi aggiungere il nuovo file al progetto ${CurrentProjectName}? Salta le proprietà su linea singola + + Salta ottimizzazione JIT + + + Salta ottimizzazione NGEN + Simboli @@ -2353,6 +2368,12 @@ Vuoi aggiungere il nuovo file al progetto ${CurrentProjectName}? Qualsiasi processore + + Quasiasi processore (preferisci 32-bit) + + + Qualsiasi processore (preferisci 64-bit) + Processore Intel 64-bit Itanium @@ -2707,6 +2728,9 @@ Puoi anche scegliere di memorizzare le impostazioni in un file .user invece che Sorgente + + Avanzate + Annulla @@ -4017,6 +4041,12 @@ Sono ammesse solo lettere, numeri, spazi, '.' o '_'. La cultura supportata dal riferimento + + Incorpora tipi COM + + + Specifica quale tipi COM presenti nell'assembly referenziato devono essere incorportati nell'assembly di destinazione. + Copia locale @@ -4038,6 +4068,9 @@ Sono ammesse solo lettere, numeri, spazi, '.' o '_'. Referenzia assembly + + Se impostato a falso, questo riferimento implica solo una dipendenza nella sequenza di compilazione e non un riferimento all'assembly. + Versione Specifica @@ -5400,6 +5433,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension< Impossibile trovare gli strumenti per Libreria di Classi Portabile + + Sottoinsieme Portabile .NET + Selezionare almeno 2 frameworks. @@ -6401,6 +6437,24 @@ SharpDevelop 2 compila le risorse differentemente: il nome della risorsa non è File di Build NAnt + + Crea una Vista per un Modulo PRISM ed il relativo Modello + + + Vista PRISM e Modello (Unity) + + + Crea un modello per un Modulo PRISM + + + Modello PRISM (Unity) + + + Crea una Vista per un Modulo PRISM + + + Vista PRISM (Unity) + Aggiunge '#if TEST ... #endif' @@ -6671,6 +6725,24 @@ SharpDevelop 2 compila le risorse differentemente: il nome della risorsa non è Libreria di classi portabile + + Crea una piccola Applicazione Prism con Avvio e Infrastruttura + + + Applicazione PRISM - piccola (Unity) + + + Crea una Applicazione PRISM con Avvio e Infrastruttura + + + Applicazione PRISM (Unity) + + + Crea un Modulo PRISM con una Vista e relativo Modulo + + + Modulo PRISM (Unity) + Un progetto Windows Installer per creare file di installazione MSI. diff --git a/data/resources/StringResources.resx b/data/resources/StringResources.resx index 4687b39dbf..d4142b7e12 100644 --- a/data/resources/StringResources.resx +++ b/data/resources/StringResources.resx @@ -6111,6 +6111,9 @@ Removed the end part of the original message ", reason '${Message}'" since this All files (*.*) + + All known file extensions + Assembly Files (*.exe;*.dll) diff --git a/data/resources/StringResources.ru.resx b/data/resources/StringResources.ru.resx index 733af3f8b3..9aa6cd15b1 100644 --- a/data/resources/StringResources.ru.resx +++ b/data/resources/StringResources.ru.resx @@ -5116,7 +5116,7 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension< Текущий метод - Текларирующий тип + Декларирующий тип Развернуть автосвойство diff --git a/data/resources/StringResources.tr.resx b/data/resources/StringResources.tr.resx index 55288c5c64..ba68240be8 100644 --- a/data/resources/StringResources.tr.resx +++ b/data/resources/StringResources.tr.resx @@ -1871,6 +1871,12 @@ Yeni dosyayı, ${CurrentProjectName} projesine eklemek istiyor musunuz? Hata ayıklama + + Tekrar derlemeyi etkinleştir + + + Düzenle ve Devam eti Etkinleştir + İstisnalar @@ -1901,6 +1907,12 @@ Yeni dosyayı, ${CurrentProjectName} projesine eklemek istiyor musunuz? Tek satır özellikleri üzerinden Adımla + + JIT optimizasyonunu engelle + + + NGEN optimizasyonunu engelle + Semboller @@ -2720,6 +2732,9 @@ Ayrıca bir ayarı proje dosyası yerine kullanıcı dosyası(.user-file) içind Kaynak + + Gelişmiş + Başarısız diff --git a/src/Main/Base/Project/Src/Commands/FileCommands.cs b/src/Main/Base/Project/Src/Commands/FileCommands.cs index 5654bd3a12..483b94c86c 100644 --- a/src/Main/Base/Project/Src/Commands/FileCommands.cs +++ b/src/Main/Base/Project/Src/Commands/FileCommands.cs @@ -218,31 +218,8 @@ namespace ICSharpCode.SharpDevelop.Commands using (OpenFileDialog fdiag = new OpenFileDialog()) { fdiag.AddExtension = true; - var fileFilters = ProjectService.GetFileFilters(); - fdiag.Filter = String.Join("|", fileFilters); - bool foundFilter = false; - - // search filter like in the current open file - if (!foundFilter) { - IViewContent content = SD.Workbench.ActiveViewContent; - if (content != null) { - string extension = Path.GetExtension(content.PrimaryFileName); - if (string.IsNullOrEmpty(extension) == false) { - for (int i = 0; i < fileFilters.Count; ++i) { - if (fileFilters[i].ContainsExtension(extension)) { - fdiag.FilterIndex = i + 1; - foundFilter = true; - break; - } - } - } - } - } - - if (!foundFilter) { - fdiag.FilterIndex = fileFilters.Count; - } - + fdiag.Filter = ProjectService.GetAllFilesFilter(); + fdiag.FilterIndex = 0; fdiag.Multiselect = true; fdiag.CheckFileExists = true; diff --git a/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs b/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs index 2ee78eb05a..0e6b215649 100644 --- a/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs +++ b/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs @@ -114,6 +114,32 @@ namespace ICSharpCode.SharpDevelop.Project return AddInTree.BuildItems("/SharpDevelop/Workbench/FileFilter", null); } + /// + /// Returns a File Dialog filter that can be used to filter on all registered file formats + /// + public static string GetAllFilesFilter() + { + IEnumerable filters = GetFileFilters(); + StringBuilder b = new StringBuilder(StringParser.Parse("${res:SharpDevelop.FileFilter.AllKnownFiles} (*.cs, *.vb, ...)|")); + bool first = true; + foreach (var filter in filters) { + string ext = filter.Extensions; + if (ext != "*.*" && ext.Length > 0) { + if (!first) { + b.Append(';'); + } else { + first = false; + } + b.Append(ext); + } + } + foreach (var filter in filters) { + b.Append('|'); + b.Append(filter.ToString()); + } + return b.ToString(); + } + /// /// Returns a File Dialog filter that can be used to filter on all registered project formats ///