Browse Source

add "All known file extensions" to "Open file" FileFilter

pull/32/merge
Siegfried Pammer 12 years ago
parent
commit
a202c6e274
  1. 2
      data/resources/StringResources.fr.resx
  2. 72
      data/resources/StringResources.it.resx
  3. 3
      data/resources/StringResources.resx
  4. 2
      data/resources/StringResources.ru.resx
  5. 15
      data/resources/StringResources.tr.resx
  6. 27
      src/Main/Base/Project/Src/Commands/FileCommands.cs
  7. 26
      src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

2
data/resources/StringResources.fr.resx

@ -2371,7 +2371,7 @@ Voulez-vous ajouter le nouveau fichier au projet ${CurrentProjectName}?</value> @@ -2371,7 +2371,7 @@ Voulez-vous ajouter le nouveau fichier au projet ${CurrentProjectName}?</value>
<value>Tout processeur</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any32" xml:space="preserve">
<value>x86/x64 - préfère 64 bits</value>
<value>x86/x64 - préfère 32 bits</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any64" xml:space="preserve">
<value>x86/x64 - préfère 64 bits</value>

72
data/resources/StringResources.it.resx

@ -1502,6 +1502,9 @@ Ad esempio: "120", "MainClass", "Main.cs, 120".</value> @@ -1502,6 +1502,9 @@ Ad esempio: "120", "MainClass", "Main.cs, 120".</value>
<data name="Dialog.HighlightingEditor.NotSupportedMessage" xml:space="preserve">
<value>Versione delle impostazioni non supportata!</value>
</data>
<data name="Dialog.HighlightingEditor.OverwriteCustomizationsMessage" xml:space="preserve">
<value>Questo comando elimina tutte le personalizzazioni prima di importare i files selezionati. Continuare?</value>
</data>
<data name="Dialog.HighlightingEditor.Properties.Value" xml:space="preserve">
<value>Valore</value>
</data>
@ -1863,6 +1866,12 @@ Vuoi aggiungere il nuovo file al progetto ${CurrentProjectName}?</value> @@ -1863,6 +1866,12 @@ Vuoi aggiungere il nuovo file al progetto ${CurrentProjectName}?</value>
<data name="Dialog.Options.IDEOptions.Debugging" xml:space="preserve">
<value>Debugging</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableDecompiler" xml:space="preserve">
<value>Attiva decompilatore</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableEditAndContinue" xml:space="preserve">
<value>Attiva Modifica e Continua</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Exceptions" xml:space="preserve">
<value>Eccezioni</value>
</data>
@ -1893,6 +1902,12 @@ Vuoi aggiungere il nuovo file al progetto ${CurrentProjectName}?</value> @@ -1893,6 +1902,12 @@ Vuoi aggiungere il nuovo file al progetto ${CurrentProjectName}?</value>
<data name="Dialog.Options.IDEOptions.Debugging.Stepping.StepOverSingleLineProperties" xml:space="preserve">
<value>Salta le proprietà su linea singola</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressJITOptimization" xml:space="preserve">
<value>Salta ottimizzazione JIT</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressNGENOptimization" xml:space="preserve">
<value>Salta ottimizzazione NGEN</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Symbols" xml:space="preserve">
<value>Simboli</value>
</data>
@ -2353,6 +2368,12 @@ Vuoi aggiungere il nuovo file al progetto ${CurrentProjectName}?</value> @@ -2353,6 +2368,12 @@ Vuoi aggiungere il nuovo file al progetto ${CurrentProjectName}?</value>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any" xml:space="preserve">
<value>Qualsiasi processore</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any32" xml:space="preserve">
<value>Quasiasi processore (preferisci 32-bit)</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Any64" xml:space="preserve">
<value>Qualsiasi processore (preferisci 64-bit)</value>
</data>
<data name="Dialog.ProjectOptions.Build.TargetCPU.Itanium" xml:space="preserve">
<value>Processore Intel 64-bit Itanium</value>
</data>
@ -2707,6 +2728,9 @@ Puoi anche scegliere di memorizzare le impostazioni in un file .user invece che @@ -2707,6 +2728,9 @@ Puoi anche scegliere di memorizzare le impostazioni in un file .user invece che
<data name="FormsDesigner.DesignTabPages.SourceTabPage" xml:space="preserve">
<value>Sorgente</value>
</data>
<data name="Gloabl.Advanced" xml:space="preserve">
<value>Avanzate</value>
</data>
<data name="Global.AbortButtonText" xml:space="preserve">
<value>Annulla</value>
</data>
@ -4017,6 +4041,12 @@ Sono ammesse solo lettere, numeri, spazi, '.' o '_'.</value> @@ -4017,6 +4041,12 @@ Sono ammesse solo lettere, numeri, spazi, '.' o '_'.</value>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.Culture.Description" xml:space="preserve">
<value>La cultura supportata dal riferimento</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.EmbedInteropTypes" xml:space="preserve">
<value>Incorpora tipi COM</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.EmbedInteropTypes.Description" xml:space="preserve">
<value>Specifica quale tipi COM presenti nell'assembly referenziato devono essere incorportati nell'assembly di destinazione.</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.LocalCopy" xml:space="preserve">
<value>Copia locale</value>
</data>
@ -4038,6 +4068,9 @@ Sono ammesse solo lettere, numeri, spazi, '.' o '_'.</value> @@ -4038,6 +4068,9 @@ Sono ammesse solo lettere, numeri, spazi, '.' o '_'.</value>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.ReferenceOutputAssembly" xml:space="preserve">
<value>Referenzia assembly</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.ReferenceOutputAssembly.Description" xml:space="preserve">
<value>Se impostato a falso, questo riferimento implica solo una dipendenza nella sequenza di compilazione e non un riferimento all'assembly.</value>
</data>
<data name="ICSharpCode.SharpDevelop.Internal.Project.ProjectReference.SpecificVersion" xml:space="preserve">
<value>Versione Specifica</value>
</data>
@ -5400,6 +5433,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension< @@ -5400,6 +5433,9 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<data name="PortableLibrary.CouldNotFindTools" xml:space="preserve">
<value>Impossibile trovare gli strumenti per Libreria di Classi Portabile</value>
</data>
<data name="PortableLibrary.PortableSubset" xml:space="preserve">
<value>Sottoinsieme Portabile .NET</value>
</data>
<data name="PortableLibrary.SelectAtLeastTwoFrameworks" xml:space="preserve">
<value>Selezionare almeno 2 frameworks.</value>
</data>
@ -6401,6 +6437,24 @@ SharpDevelop 2 compila le risorse differentemente: il nome della risorsa non è @@ -6401,6 +6437,24 @@ SharpDevelop 2 compila le risorse differentemente: il nome della risorsa non è
<data name="Templates.File.NAnt.NAntBuildFile.Name" xml:space="preserve">
<value>File di Build NAnt</value>
</data>
<data name="Templates.File.PRISMViewAndViewModelUnity.Description" xml:space="preserve">
<value>Crea una Vista per un Modulo PRISM ed il relativo Modello</value>
</data>
<data name="Templates.File.PRISMViewAndViewModelUnity.Name" xml:space="preserve">
<value>Vista PRISM e Modello (Unity)</value>
</data>
<data name="Templates.File.PRISMViewModelUnity.Description" xml:space="preserve">
<value>Crea un modello per un Modulo PRISM</value>
</data>
<data name="Templates.File.PRISMViewModelUnity.Name" xml:space="preserve">
<value>Modello PRISM (Unity)</value>
</data>
<data name="Templates.File.PRISMViewUnity.Description" xml:space="preserve">
<value>Crea una Vista per un Modulo PRISM</value>
</data>
<data name="Templates.File.PRISMViewUnity.Name" xml:space="preserve">
<value>Vista PRISM (Unity)</value>
</data>
<data name="Templates.File.Properties.AddIFDEFTest" xml:space="preserve">
<value>Aggiunge '#if TEST ... #endif'</value>
</data>
@ -6671,6 +6725,24 @@ SharpDevelop 2 compila le risorse differentemente: il nome della risorsa non è @@ -6671,6 +6725,24 @@ SharpDevelop 2 compila le risorse differentemente: il nome della risorsa non è
<data name="Templates.Project.PortableLibrary.Name" xml:space="preserve">
<value>Libreria di classi portabile</value>
</data>
<data name="Templates.Project.PRISMApplicationSmallUnity.Description" xml:space="preserve">
<value>Crea una piccola Applicazione Prism con Avvio e Infrastruttura</value>
</data>
<data name="Templates.Project.PRISMApplicationSmallUnity.Name" xml:space="preserve">
<value>Applicazione PRISM - piccola (Unity)</value>
</data>
<data name="Templates.Project.PRISMApplicationUnity.Description" xml:space="preserve">
<value>Crea una Applicazione PRISM con Avvio e Infrastruttura</value>
</data>
<data name="Templates.Project.PRISMApplicationUnity.Name" xml:space="preserve">
<value>Applicazione PRISM (Unity)</value>
</data>
<data name="Templates.Project.PRISMModuleUnity.Description" xml:space="preserve">
<value>Crea un Modulo PRISM con una Vista e relativo Modulo</value>
</data>
<data name="Templates.Project.PRISMModuleUnity.Name" xml:space="preserve">
<value>Modulo PRISM (Unity)</value>
</data>
<data name="Templates.Project.SetupProject.Description" xml:space="preserve">
<value>Un progetto Windows Installer per creare file di installazione MSI.</value>
</data>

3
data/resources/StringResources.resx

@ -6111,6 +6111,9 @@ Removed the end part of the original message ", reason '${Message}'" since this @@ -6111,6 +6111,9 @@ Removed the end part of the original message ", reason '${Message}'" since this
<data name="SharpDevelop.FileFilter.AllFiles" xml:space="preserve">
<value>All files (*.*)</value>
</data>
<data name="SharpDevelop.FileFilter.AllKnownFiles" xml:space="preserve">
<value>All known file extensions</value>
</data>
<data name="SharpDevelop.FileFilter.AssemblyFiles" xml:space="preserve">
<value>Assembly Files (*.exe;*.dll)</value>
</data>

2
data/resources/StringResources.ru.resx

@ -5116,7 +5116,7 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension< @@ -5116,7 +5116,7 @@ Microsoft.Tools.WindowsInstallerXml.Extensions.NetFxCompiler, WixNetFxExtension<
<value>Текущий метод</value>
</data>
<data name="SharpDevelop.Refactoring.DeclaringType" xml:space="preserve">
<value>Текларирующий тип</value>
<value>Декларирующий тип</value>
</data>
<data name="SharpDevelop.Refactoring.ExpandAutomaticProperty" xml:space="preserve">
<value>Развернуть автосвойство</value>

15
data/resources/StringResources.tr.resx

@ -1871,6 +1871,12 @@ Yeni dosyayı, ${CurrentProjectName} projesine eklemek istiyor musunuz?</value> @@ -1871,6 +1871,12 @@ Yeni dosyayı, ${CurrentProjectName} projesine eklemek istiyor musunuz?</value>
<data name="Dialog.Options.IDEOptions.Debugging" xml:space="preserve">
<value>Hata ayıklama</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableDecompiler" xml:space="preserve">
<value>Tekrar derlemeyi etkinleştir</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.EnableEditAndContinue" xml:space="preserve">
<value>Düzenle ve Devam eti Etkinleştir</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Exceptions" xml:space="preserve">
<value>İstisnalar</value>
</data>
@ -1901,6 +1907,12 @@ Yeni dosyayı, ${CurrentProjectName} projesine eklemek istiyor musunuz?</value> @@ -1901,6 +1907,12 @@ Yeni dosyayı, ${CurrentProjectName} projesine eklemek istiyor musunuz?</value>
<data name="Dialog.Options.IDEOptions.Debugging.Stepping.StepOverSingleLineProperties" xml:space="preserve">
<value>Tek satır özellikleri üzerinden Adımla</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressJITOptimization" xml:space="preserve">
<value>JIT optimizasyonunu engelle</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.SuppressNGENOptimization" xml:space="preserve">
<value>NGEN optimizasyonunu engelle</value>
</data>
<data name="Dialog.Options.IDEOptions.Debugging.Symbols" xml:space="preserve">
<value>Semboller</value>
</data>
@ -2720,6 +2732,9 @@ Ayrıca bir ayarı proje dosyası yerine kullanıcı dosyası(.user-file) içind @@ -2720,6 +2732,9 @@ Ayrıca bir ayarı proje dosyası yerine kullanıcı dosyası(.user-file) içind
<data name="FormsDesigner.DesignTabPages.SourceTabPage" xml:space="preserve">
<value>Kaynak</value>
</data>
<data name="Gloabl.Advanced" xml:space="preserve">
<value>Gelişmiş</value>
</data>
<data name="Global.AbortButtonText" xml:space="preserve">
<value>Başarısız</value>
</data>

27
src/Main/Base/Project/Src/Commands/FileCommands.cs

@ -218,31 +218,8 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -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;

26
src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

@ -114,6 +114,32 @@ namespace ICSharpCode.SharpDevelop.Project @@ -114,6 +114,32 @@ namespace ICSharpCode.SharpDevelop.Project
return AddInTree.BuildItems<FileFilterDescriptor>("/SharpDevelop/Workbench/FileFilter", null);
}
/// <summary>
/// Returns a File Dialog filter that can be used to filter on all registered file formats
/// </summary>
public static string GetAllFilesFilter()
{
IEnumerable<FileFilterDescriptor> 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();
}
/// <summary>
/// Returns a File Dialog filter that can be used to filter on all registered project formats
/// </summary>

Loading…
Cancel
Save