From 680943ba2946baa464b520767b90d734f5ead08c Mon Sep 17 00:00:00 2001 From: Eltos Date: Thu, 16 Jul 2026 23:58:21 +0200 Subject: [PATCH 01/11] WIP: Shell extension --- PasteIntoFile.sln | 2 + PasteIntoFile/ExplorerUtil.cs | 124 ++++++ PasteIntoFile/PasteIntoFile.csproj | 6 + .../Properties/Resources.Designer.cs | 13 +- PasteIntoFile/Properties/Resources.resx | 3 + PasteIntoFile/Resources/icon150.png | Bin 0 -> 5658 bytes PasteIntoFile/Resources/icon44.png | Bin 0 -> 1444 bytes PasteIntoFile/Wizard.Designer.cs | 57 ++- PasteIntoFile/Wizard.cs | 64 +++- PasteIntoFileShellExtension/AppxManifest.xml | 40 ++ PasteIntoFileShellExtension/Command.cs | 358 ++++++++++++++++++ .../PasteIntoFileShellExtension.csproj | 23 ++ 12 files changed, 652 insertions(+), 38 deletions(-) create mode 100644 PasteIntoFile/Resources/icon150.png create mode 100644 PasteIntoFile/Resources/icon44.png create mode 100644 PasteIntoFileShellExtension/AppxManifest.xml create mode 100644 PasteIntoFileShellExtension/Command.cs create mode 100644 PasteIntoFileShellExtension/PasteIntoFileShellExtension.csproj diff --git a/PasteIntoFile.sln b/PasteIntoFile.sln index 07216d8..7623209 100644 --- a/PasteIntoFile.sln +++ b/PasteIntoFile.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.28729.10 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PasteIntoFile", "PasteIntoFile\PasteIntoFile.csproj", "{F6F4215C-6CD7-4279-9C4C-C2DA9A823D0C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PasteIntoFileShellExtension", "PasteIntoFileShellExtension\PasteIntoFileShellExtension.csproj", "{3FF1060D-CD0D-43BE-8E4F-61D2C0475AF2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/PasteIntoFile/ExplorerUtil.cs b/PasteIntoFile/ExplorerUtil.cs index c861512..8a510b4 100644 --- a/PasteIntoFile/ExplorerUtil.cs +++ b/PasteIntoFile/ExplorerUtil.cs @@ -1,9 +1,11 @@ using System; +using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; using System.Text; using System.Threading.Tasks; +using System.Windows.Forms; using SHDocVw; using Shell32; @@ -438,6 +440,128 @@ public static void MoveToRecycleBin(string path) { } + + private const string Win11ContextMenuPackageName = "PasteIntoFile.Dev.ShellExtension"; + + public static bool IsWin11ContextMenuRegistered() { + string output; + var exitCode = RunPowerShell( + "if (Get-AppxPackage -Name " + PowerShellQuote(Win11ContextMenuPackageName) + ") { exit 0 } else { exit 1 }", + out output, + false + ); + + return exitCode == 0; + } + + public static void SetWin11ContextMenuRegistered(bool registered) { + if (registered) { + RegisterWin11ContextMenu(); + } else { + UnregisterWin11ContextMenu(); + } + } + + public static void RegisterWin11ContextMenu() { + var directory = Path.GetDirectoryName(Application.ExecutablePath); + + if (string.IsNullOrWhiteSpace(directory)) { + throw new InvalidOperationException("Der Installationsordner konnte nicht ermittelt werden."); + } + + var manifest = Path.Combine(directory, "AppxManifest.xml"); + + if (!File.Exists(manifest)) { + throw new FileNotFoundException( + "Das AppxManifest.xml wurde nicht gefunden. Die Win11-Menüintegration kann nicht registriert werden.", + manifest + ); + } + + string output; + RunPowerShell( + "$ErrorActionPreference = 'Stop'; " + + "Add-AppxPackage " + + "-Register " + PowerShellQuote(manifest) + " " + + "-ExternalLocation " + PowerShellQuote(directory) + " " + + "-ForceApplicationShutdown", + out output, + true + ); + + //RestartExplorer(); + } + + public static void UnregisterWin11ContextMenu() { + string output; + RunPowerShell( + "$ErrorActionPreference = 'Stop'; " + + "$package = Get-AppxPackage -Name " + PowerShellQuote(Win11ContextMenuPackageName) + "; " + + "if ($package) { $package | Remove-AppxPackage }", + out output, + true + ); + + //RestartExplorer(); + } + + private static string PowerShellQuote(string value) { + return "'" + value.Replace("'", "''") + "'"; + } + + private static int RunPowerShell(string command, out string output, bool throwOnError) { + var encodedCommand = Convert.ToBase64String(Encoding.Unicode.GetBytes(command)); + + var startInfo = new ProcessStartInfo { + FileName = "powershell.exe", + Arguments = "-NoProfile -ExecutionPolicy Bypass -EncodedCommand " + encodedCommand, + UseShellExecute = false, + CreateNoWindow = true, + RedirectStandardOutput = true, + RedirectStandardError = true + }; + + using (var process = Process.Start(startInfo)) { + if (process == null) { + throw new InvalidOperationException("PowerShell konnte nicht gestartet werden."); + } + + var stdout = process.StandardOutput.ReadToEnd(); + var stderr = process.StandardError.ReadToEnd(); + + process.WaitForExit(); + + output = stdout; + + if (!string.IsNullOrWhiteSpace(stderr)) { + output += Environment.NewLine + stderr; + } + + if (throwOnError && process.ExitCode != 0) { + throw new InvalidOperationException(output.Trim()); + } + + return process.ExitCode; + } + } + + private static void RestartExplorer() { + foreach (var process in Process.GetProcessesByName("explorer")) { + try { + process.Kill(); + } catch { + // Ignorieren: Explorer wird gleich neu gestartet. + } + } + + Process.Start("explorer.exe"); + } + + + + + + private static IntPtr PathToPidl(string path, bool special = false) { if (special) { // Will use special paths, e.g. "::{374DE290-123F-4565-9164-39C4925E467B}" for Downloads diff --git a/PasteIntoFile/PasteIntoFile.csproj b/PasteIntoFile/PasteIntoFile.csproj index ec7043b..3a8a524 100644 --- a/PasteIntoFile/PasteIntoFile.csproj +++ b/PasteIntoFile/PasteIntoFile.csproj @@ -155,6 +155,12 @@ True + + + + + + + true + + x64 + win-x64 + + true + + + + + + + + + + From 1e3e5d61b773396a961b1c7e80e5fe319bbd603f Mon Sep 17 00:00:00 2001 From: Eltos Date: Fri, 17 Jul 2026 00:10:29 +0200 Subject: [PATCH 02/11] Build --- PasteIntoFile.sln | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PasteIntoFile.sln b/PasteIntoFile.sln index 7623209..e9e5318 100644 --- a/PasteIntoFile.sln +++ b/PasteIntoFile.sln @@ -17,6 +17,10 @@ Global {F6F4215C-6CD7-4279-9C4C-C2DA9A823D0C}.Debug|Any CPU.Build.0 = Debug|Any CPU {F6F4215C-6CD7-4279-9C4C-C2DA9A823D0C}.Release|Any CPU.ActiveCfg = Release|Any CPU {F6F4215C-6CD7-4279-9C4C-C2DA9A823D0C}.Release|Any CPU.Build.0 = Release|Any CPU + {3FF1060D-CD0D-43BE-8E4F-61D2C0475AF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3FF1060D-CD0D-43BE-8E4F-61D2C0475AF2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3FF1060D-CD0D-43BE-8E4F-61D2C0475AF2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3FF1060D-CD0D-43BE-8E4F-61D2C0475AF2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 941b94c61c92b27be944c90cdc1648a295d2151a Mon Sep 17 00:00:00 2001 From: Eltos Date: Fri, 17 Jul 2026 00:27:03 +0200 Subject: [PATCH 03/11] Build --- PasteIntoFile.sln | 3 +++ PasteIntoFile/PasteIntoFile.csproj | 2 +- .../PasteIntoFileShellExtension.csproj | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/PasteIntoFile.sln b/PasteIntoFile.sln index e9e5318..3e71250 100644 --- a/PasteIntoFile.sln +++ b/PasteIntoFile.sln @@ -4,6 +4,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 VisualStudioVersion = 16.0.28729.10 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PasteIntoFile", "PasteIntoFile\PasteIntoFile.csproj", "{F6F4215C-6CD7-4279-9C4C-C2DA9A823D0C}" + ProjectSection(ProjectDependencies) = postProject + {3FF1060D-CD0D-43BE-8E4F-61D2C0475AF2} = {3FF1060D-CD0D-43BE-8E4F-61D2C0475AF2} + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PasteIntoFileShellExtension", "PasteIntoFileShellExtension\PasteIntoFileShellExtension.csproj", "{3FF1060D-CD0D-43BE-8E4F-61D2C0475AF2}" EndProject diff --git a/PasteIntoFile/PasteIntoFile.csproj b/PasteIntoFile/PasteIntoFile.csproj index 3a8a524..5beb337 100644 --- a/PasteIntoFile/PasteIntoFile.csproj +++ b/PasteIntoFile/PasteIntoFile.csproj @@ -159,7 +159,7 @@ - + @@ -46,73 +50,15 @@ - + + - - - - + - - - - - - - - - - - - - - - - - - - - - - - UserControl - - - Form - - - TemplateEdit.cs - - - Form - - - Wizard.cs - - - Form - - - Dialog.cs - - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - Designer @@ -120,13 +66,6 @@ SettingsSingleFileGenerator Settings.Designer.cs - - True - Settings.settings - True - - - Designer @@ -161,7 +100,6 @@ - true + + + diff --git a/PasteIntoFileShellExtension/ReplaceCommand.cs b/PasteIntoFileShellExtension/ReplaceCommand.cs new file mode 100644 index 0000000..1ea42d8 --- /dev/null +++ b/PasteIntoFileShellExtension/ReplaceCommand.cs @@ -0,0 +1,27 @@ +using System.Runtime.InteropServices; + +namespace PasteIntoFileShellExtension; + +[ComVisible(true)] +[Guid(Clsids.ReplaceCommand)] +[ProgId("PasteIntoFile.ShellExtension.ReplaceCommand")] +[ClassInterface(ClassInterfaceType.None)] +[ComDefaultInterface(typeof(IExplorerCommand))] +public sealed class ReplaceCommand : BaseExplorerCommand { + + public override string Clsid => Clsids.ReplaceCommand; + + public override int GetTitle(IShellItemArray psiItemArray, out IntPtr ppszName) { + ppszName = Marshal.StringToCoTaskMemUni(Titles.Replace); + return HResult.S_OK; + } + + public override int GetState(IShellItemArray psiItemArray, bool fOkToBeSlow, out EXPCMDSTATE pCmdState) { + pCmdState = CheckSingleFileSelected(psiItemArray); + return HResult.S_OK; + } + + public override int Invoke(IShellItemArray psiItemArray, IntPtr pbc) { + return InvokePasteIntoFile(psiItemArray, PasteMode.Replace); + } +} From 4416e60f842ab4ea21909d45f7520a74f1215549 Mon Sep 17 00:00:00 2001 From: Eltos Date: Mon, 12 Oct 2026 21:12:07 +0200 Subject: [PATCH 10/11] Rename project --- .../AppendCommand.cs | 0 .../AppxManifest.xml | 8 ++++---- .../BaseExplorerCommand.cs | 0 .../CopyCommand.cs | 0 .../PasteCommand.cs | 0 .../PasteIntoFile.ShellExtension.csproj | 1 + .../ReplaceCommand.cs | 0 PasteIntoFile.sln | 2 +- PasteIntoFile/PasteIntoFile.csproj | 2 +- 9 files changed, 7 insertions(+), 6 deletions(-) rename {PasteIntoFileShellExtension => PasteIntoFile.ShellExtension}/AppendCommand.cs (100%) rename {PasteIntoFileShellExtension => PasteIntoFile.ShellExtension}/AppxManifest.xml (90%) rename {PasteIntoFileShellExtension => PasteIntoFile.ShellExtension}/BaseExplorerCommand.cs (100%) rename {PasteIntoFileShellExtension => PasteIntoFile.ShellExtension}/CopyCommand.cs (100%) rename {PasteIntoFileShellExtension => PasteIntoFile.ShellExtension}/PasteCommand.cs (100%) rename PasteIntoFileShellExtension/PasteIntoFileShellExtension.csproj => PasteIntoFile.ShellExtension/PasteIntoFile.ShellExtension.csproj (94%) rename {PasteIntoFileShellExtension => PasteIntoFile.ShellExtension}/ReplaceCommand.cs (100%) diff --git a/PasteIntoFileShellExtension/AppendCommand.cs b/PasteIntoFile.ShellExtension/AppendCommand.cs similarity index 100% rename from PasteIntoFileShellExtension/AppendCommand.cs rename to PasteIntoFile.ShellExtension/AppendCommand.cs diff --git a/PasteIntoFileShellExtension/AppxManifest.xml b/PasteIntoFile.ShellExtension/AppxManifest.xml similarity index 90% rename from PasteIntoFileShellExtension/AppxManifest.xml rename to PasteIntoFile.ShellExtension/AppxManifest.xml index 287f168..85de774 100644 --- a/PasteIntoFileShellExtension/AppxManifest.xml +++ b/PasteIntoFile.ShellExtension/AppxManifest.xml @@ -17,10 +17,10 @@ - - - - + + + + diff --git a/PasteIntoFileShellExtension/BaseExplorerCommand.cs b/PasteIntoFile.ShellExtension/BaseExplorerCommand.cs similarity index 100% rename from PasteIntoFileShellExtension/BaseExplorerCommand.cs rename to PasteIntoFile.ShellExtension/BaseExplorerCommand.cs diff --git a/PasteIntoFileShellExtension/CopyCommand.cs b/PasteIntoFile.ShellExtension/CopyCommand.cs similarity index 100% rename from PasteIntoFileShellExtension/CopyCommand.cs rename to PasteIntoFile.ShellExtension/CopyCommand.cs diff --git a/PasteIntoFileShellExtension/PasteCommand.cs b/PasteIntoFile.ShellExtension/PasteCommand.cs similarity index 100% rename from PasteIntoFileShellExtension/PasteCommand.cs rename to PasteIntoFile.ShellExtension/PasteCommand.cs diff --git a/PasteIntoFileShellExtension/PasteIntoFileShellExtension.csproj b/PasteIntoFile.ShellExtension/PasteIntoFile.ShellExtension.csproj similarity index 94% rename from PasteIntoFileShellExtension/PasteIntoFileShellExtension.csproj rename to PasteIntoFile.ShellExtension/PasteIntoFile.ShellExtension.csproj index dfd201d..e8b9c62 100644 --- a/PasteIntoFileShellExtension/PasteIntoFileShellExtension.csproj +++ b/PasteIntoFile.ShellExtension/PasteIntoFile.ShellExtension.csproj @@ -11,6 +11,7 @@ win-x64 true + PasteIntoFileShellExtension diff --git a/PasteIntoFileShellExtension/ReplaceCommand.cs b/PasteIntoFile.ShellExtension/ReplaceCommand.cs similarity index 100% rename from PasteIntoFileShellExtension/ReplaceCommand.cs rename to PasteIntoFile.ShellExtension/ReplaceCommand.cs diff --git a/PasteIntoFile.sln b/PasteIntoFile.sln index 830f801..97b0c3e 100644 --- a/PasteIntoFile.sln +++ b/PasteIntoFile.sln @@ -11,7 +11,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PasteIntoFile", "PasteIntoF {A1B2C3D4-E5F6-7890-ABCD-EF1234567890} = {A1B2C3D4-E5F6-7890-ABCD-EF1234567890} EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PasteIntoFileShellExtension", "PasteIntoFileShellExtension\PasteIntoFileShellExtension.csproj", "{3FF1060D-CD0D-43BE-8E4F-61D2C0475AF2}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PasteIntoFile.ShellExtension", "PasteIntoFile.ShellExtension\PasteIntoFile.ShellExtension.csproj", "{3FF1060D-CD0D-43BE-8E4F-61D2C0475AF2}" ProjectSection(ProjectDependencies) = postProject {A1B2C3D4-E5F6-7890-ABCD-EF1234567890} = {A1B2C3D4-E5F6-7890-ABCD-EF1234567890} EndProjectSection diff --git a/PasteIntoFile/PasteIntoFile.csproj b/PasteIntoFile/PasteIntoFile.csproj index 8a9830b..2c86668 100644 --- a/PasteIntoFile/PasteIntoFile.csproj +++ b/PasteIntoFile/PasteIntoFile.csproj @@ -93,7 +93,7 @@ - + From ae9d432227eb91afaf0e7d9ceb359a631692968e Mon Sep 17 00:00:00 2001 From: Eltos Date: Mon, 12 Oct 2026 21:42:27 +0200 Subject: [PATCH 11/11] Localization --- PasteIntoFile.Core/PasteIntoFile.Core.csproj | 11 ++ .../Properties/Resources.Designer.cs | 107 ++++++++++++++++++ .../Properties/Resources.de.resx | 33 ++++++ .../Properties/Resources.es-es.resx | 33 ++++++ .../Properties/Resources.fr.resx | 33 ++++++ .../Properties/Resources.it.resx | 33 ++++++ .../Properties/Resources.ja-jp.resx | 33 ++++++ .../Properties/Resources.ko.resx | 33 ++++++ .../Properties/Resources.pt-br.resx | 33 ++++++ .../Properties/Resources.pt-pt.resx | 33 ++++++ PasteIntoFile.Core/Properties/Resources.resx | 38 +++++++ .../Properties/Resources.ru-ru.resx | 33 ++++++ .../Properties/Resources.uk-ua.resx | 19 ++++ .../Properties/Resources.zh-CN.resx | 33 ++++++ .../Properties/Resources.zh-TW.resx | 33 ++++++ PasteIntoFile.ShellExtension/AppendCommand.cs | 5 +- PasteIntoFile.ShellExtension/AppxManifest.xml | 8 +- .../BaseExplorerCommand.cs | 13 +-- PasteIntoFile.ShellExtension/CopyCommand.cs | 10 +- .../ExplorerCommandEnumerator.cs | 60 ++++++++++ .../FileGroupCommand.cs | 61 ++++++++++ PasteIntoFile.ShellExtension/PasteCommand.cs | 3 +- .../ReplaceCommand.cs | 10 +- PasteIntoFile/Properties/Resources.de.resx | 18 --- PasteIntoFile/Properties/Resources.es-ES.resx | 18 --- PasteIntoFile/Properties/Resources.fr.resx | 18 --- PasteIntoFile/Properties/Resources.it.resx | 18 --- PasteIntoFile/Properties/Resources.ja-JP.resx | 18 --- PasteIntoFile/Properties/Resources.ko.resx | 18 --- PasteIntoFile/Properties/Resources.pt-BR.resx | 18 --- PasteIntoFile/Properties/Resources.pt-PT.resx | 18 --- PasteIntoFile/Properties/Resources.resx | 18 --- PasteIntoFile/Properties/Resources.ru-RU.resx | 18 --- PasteIntoFile/Properties/Resources.uk-UA.resx | 4 - PasteIntoFile/Properties/Resources.zh-CN.resx | 12 -- PasteIntoFile/Properties/Resources.zh-TW.resx | 12 -- PasteIntoFile/RegistryUtil.cs | 12 +- PasteIntoFile/Wizard.Designer.cs | 6 +- 38 files changed, 693 insertions(+), 241 deletions(-) create mode 100644 PasteIntoFile.Core/Properties/Resources.Designer.cs create mode 100644 PasteIntoFile.Core/Properties/Resources.de.resx create mode 100644 PasteIntoFile.Core/Properties/Resources.es-es.resx create mode 100644 PasteIntoFile.Core/Properties/Resources.fr.resx create mode 100644 PasteIntoFile.Core/Properties/Resources.it.resx create mode 100644 PasteIntoFile.Core/Properties/Resources.ja-jp.resx create mode 100644 PasteIntoFile.Core/Properties/Resources.ko.resx create mode 100644 PasteIntoFile.Core/Properties/Resources.pt-br.resx create mode 100644 PasteIntoFile.Core/Properties/Resources.pt-pt.resx create mode 100644 PasteIntoFile.Core/Properties/Resources.resx create mode 100644 PasteIntoFile.Core/Properties/Resources.ru-ru.resx create mode 100644 PasteIntoFile.Core/Properties/Resources.uk-ua.resx create mode 100644 PasteIntoFile.Core/Properties/Resources.zh-CN.resx create mode 100644 PasteIntoFile.Core/Properties/Resources.zh-TW.resx create mode 100644 PasteIntoFile.ShellExtension/ExplorerCommandEnumerator.cs create mode 100644 PasteIntoFile.ShellExtension/FileGroupCommand.cs diff --git a/PasteIntoFile.Core/PasteIntoFile.Core.csproj b/PasteIntoFile.Core/PasteIntoFile.Core.csproj index a5317ee..b7f60bb 100644 --- a/PasteIntoFile.Core/PasteIntoFile.Core.csproj +++ b/PasteIntoFile.Core/PasteIntoFile.Core.csproj @@ -18,5 +18,16 @@ + + True + True + Resources.resx + + + + + ResXFileCodeGenerator + Resources.Designer.cs + diff --git a/PasteIntoFile.Core/Properties/Resources.Designer.cs b/PasteIntoFile.Core/Properties/Resources.Designer.cs new file mode 100644 index 0000000..734b04f --- /dev/null +++ b/PasteIntoFile.Core/Properties/Resources.Designer.cs @@ -0,0 +1,107 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace PasteIntoFile.Core.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + public Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PasteIntoFile.Core.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Paste into file. + /// + public static string str_contextentry { + get { + return ResourceManager.GetString("str_contextentry", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Append. + /// + public static string str_contextentry_append { + get { + return ResourceManager.GetString("str_contextentry_append", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy file content. + /// + public static string str_contextentry_copyfromfile { + get { + return ResourceManager.GetString("str_contextentry_copyfromfile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Paste into this file. + /// + public static string str_contextentry_paste_into_existing_file { + get { + return ResourceManager.GetString("str_contextentry_paste_into_existing_file", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Replace. + /// + public static string str_contextentry_replace { + get { + return ResourceManager.GetString("str_contextentry_replace", resourceCulture); + } + } + } +} diff --git a/PasteIntoFile.Core/Properties/Resources.de.resx b/PasteIntoFile.Core/Properties/Resources.de.resx new file mode 100644 index 0000000..dc137cb --- /dev/null +++ b/PasteIntoFile.Core/Properties/Resources.de.resx @@ -0,0 +1,33 @@ + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Dateiinhalt kopieren + Context menu entry for copying + + + + Einfügen in diese Datei + + + Einfügen als Datei + Context menu entry for pasting + + + Anfügen + + + Ersetzen + + diff --git a/PasteIntoFile.Core/Properties/Resources.es-es.resx b/PasteIntoFile.Core/Properties/Resources.es-es.resx new file mode 100644 index 0000000..0220df3 --- /dev/null +++ b/PasteIntoFile.Core/Properties/Resources.es-es.resx @@ -0,0 +1,33 @@ + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Copiar contenido del archivo + Context menu entry for copying + + + + Pegar en este archivo + + + Pegar en fichero + Context menu entry for pasting + + + Anexar + + + Reemplazar + + diff --git a/PasteIntoFile.Core/Properties/Resources.fr.resx b/PasteIntoFile.Core/Properties/Resources.fr.resx new file mode 100644 index 0000000..0b3615f --- /dev/null +++ b/PasteIntoFile.Core/Properties/Resources.fr.resx @@ -0,0 +1,33 @@ + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Copier le contenu du fichier + Context menu entry for copying + + + + Coller dans ce fichier + + + Coller dans un fichier + Context menu entry for pasting + + + Ajouter + + + Remplacer + + diff --git a/PasteIntoFile.Core/Properties/Resources.it.resx b/PasteIntoFile.Core/Properties/Resources.it.resx new file mode 100644 index 0000000..b60db7e --- /dev/null +++ b/PasteIntoFile.Core/Properties/Resources.it.resx @@ -0,0 +1,33 @@ + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Copia il contenuto del file + Context menu entry for copying + + + + Incolla in questo file + + + Incolla nel file + Context menu entry for pasting + + + Aggiungi + + + Sostituisci + + diff --git a/PasteIntoFile.Core/Properties/Resources.ja-jp.resx b/PasteIntoFile.Core/Properties/Resources.ja-jp.resx new file mode 100644 index 0000000..31c0b32 --- /dev/null +++ b/PasteIntoFile.Core/Properties/Resources.ja-jp.resx @@ -0,0 +1,33 @@ + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ファイルの内容をコピー + Context menu entry for copying + + + + このファイルに貼り付け + + + ファイルに貼り付け + Context menu entry for pasting + + + 追記 + + + 置き換え + + diff --git a/PasteIntoFile.Core/Properties/Resources.ko.resx b/PasteIntoFile.Core/Properties/Resources.ko.resx new file mode 100644 index 0000000..b7080d2 --- /dev/null +++ b/PasteIntoFile.Core/Properties/Resources.ko.resx @@ -0,0 +1,33 @@ + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 파일 내용 복사 + Context menu entry for copying + + + + 이 파일에 붙여넣기 + + + 파일에 붙여넣기 + Context menu entry for pasting + + + 추가 + + + 바꾸기 + + diff --git a/PasteIntoFile.Core/Properties/Resources.pt-br.resx b/PasteIntoFile.Core/Properties/Resources.pt-br.resx new file mode 100644 index 0000000..652144d --- /dev/null +++ b/PasteIntoFile.Core/Properties/Resources.pt-br.resx @@ -0,0 +1,33 @@ + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Copiar conteúdo do arquivo + Context menu entry for copying + + + + Colar nesse arquivo + + + Colar no arquivo + Context menu entry for pasting + + + Acrescentar + + + Substituir + + diff --git a/PasteIntoFile.Core/Properties/Resources.pt-pt.resx b/PasteIntoFile.Core/Properties/Resources.pt-pt.resx new file mode 100644 index 0000000..e7620a2 --- /dev/null +++ b/PasteIntoFile.Core/Properties/Resources.pt-pt.resx @@ -0,0 +1,33 @@ + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Copiar conteúdo do ficheiro + Context menu entry for copying + + + + Colar neste ficheiro + + + Colar no ficheiro + Context menu entry for pasting + + + Acrescentar + + + Substituir + + diff --git a/PasteIntoFile.Core/Properties/Resources.resx b/PasteIntoFile.Core/Properties/Resources.resx new file mode 100644 index 0000000..7d9a4ac --- /dev/null +++ b/PasteIntoFile.Core/Properties/Resources.resx @@ -0,0 +1,38 @@ + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Copy file content + Context menu entry for copying + + + + Paste into this file + + + Paste into file + Context menu entry for pasting + + + Append + + + Replace + + diff --git a/PasteIntoFile.Core/Properties/Resources.ru-ru.resx b/PasteIntoFile.Core/Properties/Resources.ru-ru.resx new file mode 100644 index 0000000..541a3c8 --- /dev/null +++ b/PasteIntoFile.Core/Properties/Resources.ru-ru.resx @@ -0,0 +1,33 @@ + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Копировать содержимое файла + Context menu entry for copying + + + + Вставить в этот файл + + + Вставить в файл + Context menu entry for pasting + + + Дополнить + + + Заменить + + diff --git a/PasteIntoFile.Core/Properties/Resources.uk-ua.resx b/PasteIntoFile.Core/Properties/Resources.uk-ua.resx new file mode 100644 index 0000000..ae40532 --- /dev/null +++ b/PasteIntoFile.Core/Properties/Resources.uk-ua.resx @@ -0,0 +1,19 @@ + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Вставити до файлу + Context menu entry for pasting + + diff --git a/PasteIntoFile.Core/Properties/Resources.zh-CN.resx b/PasteIntoFile.Core/Properties/Resources.zh-CN.resx new file mode 100644 index 0000000..24a58d2 --- /dev/null +++ b/PasteIntoFile.Core/Properties/Resources.zh-CN.resx @@ -0,0 +1,33 @@ + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 复制文件内容 + Context menu entry for copying + + + + 粘贴到此文件中 + + + Paste Into File + Context menu entry for pasting + + + 追加 + + + 替换 + + diff --git a/PasteIntoFile.Core/Properties/Resources.zh-TW.resx b/PasteIntoFile.Core/Properties/Resources.zh-TW.resx new file mode 100644 index 0000000..f895455 --- /dev/null +++ b/PasteIntoFile.Core/Properties/Resources.zh-TW.resx @@ -0,0 +1,33 @@ + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 複製檔案內容 + Context menu entry for copying + + + + 貼入此檔案 + + + Paste Into File + Context menu entry for pasting + + + 追加 + + + 取代 + + diff --git a/PasteIntoFile.ShellExtension/AppendCommand.cs b/PasteIntoFile.ShellExtension/AppendCommand.cs index 2f19799..20d1fae 100644 --- a/PasteIntoFile.ShellExtension/AppendCommand.cs +++ b/PasteIntoFile.ShellExtension/AppendCommand.cs @@ -1,4 +1,5 @@ using System.Runtime.InteropServices; +using PasteIntoFile.Core.Properties; namespace PasteIntoFileShellExtension; @@ -12,7 +13,7 @@ public sealed class AppendCommand : BaseExplorerCommand { public override string Clsid => Clsids.AppendCommand; public override int GetTitle(IShellItemArray psiItemArray, out IntPtr ppszName) { - ppszName = Marshal.StringToCoTaskMemUni(Titles.Append); + ppszName = Marshal.StringToCoTaskMemUni(Resources.str_contextentry_append); return HResult.S_OK; } @@ -42,7 +43,7 @@ private static EXPCMDSTATE CheckSingleFileSelectedWithAppendSupport(IShellItemAr if (shellItem.GetDisplayName(SIGDN.SIGDN_FILESYSPATH, out var pathPtr) == HResult.S_OK && pathPtr != IntPtr.Zero) { var path = Marshal.PtrToStringUni(pathPtr); Marshal.FreeCoTaskMem(pathPtr); - if (!string.IsNullOrEmpty(path) && File.Exists(path) && IsAppendSupported(path)) { + if (!string.IsNullOrEmpty(path) && IsAppendSupported(path)) { return EXPCMDSTATE.ECS_ENABLED; } } diff --git a/PasteIntoFile.ShellExtension/AppxManifest.xml b/PasteIntoFile.ShellExtension/AppxManifest.xml index 85de774..db8507a 100644 --- a/PasteIntoFile.ShellExtension/AppxManifest.xml +++ b/PasteIntoFile.ShellExtension/AppxManifest.xml @@ -18,9 +18,7 @@ - - - + @@ -33,9 +31,7 @@ - - - + diff --git a/PasteIntoFile.ShellExtension/BaseExplorerCommand.cs b/PasteIntoFile.ShellExtension/BaseExplorerCommand.cs index 7c8899e..4b7716f 100644 --- a/PasteIntoFile.ShellExtension/BaseExplorerCommand.cs +++ b/PasteIntoFile.ShellExtension/BaseExplorerCommand.cs @@ -6,15 +6,6 @@ namespace PasteIntoFileShellExtension; -// Shared title constants — match the localized strings from the main app's Resources. -// Since the shell extension runs in a surrogate process, we use hardcoded English titles -// that match the default (English) resource strings. -static class Titles { - public const string Paste = "PasteIntoFile"; - public const string Copy = "Copy file contents"; - public const string Replace = "Paste into (Replace)"; - public const string Append = "Paste into (Append)"; -} // Shared COM class IDs — must match AppxManifest.xml registrations static class Clsids { @@ -182,12 +173,12 @@ public int GetCanonicalName(out Guid pguidCommandName) { public abstract int Invoke(IShellItemArray psiItemArray, IntPtr pbc); - public int GetFlags(out EXPCMDFLAGS pFlags) { + public virtual int GetFlags(out EXPCMDFLAGS pFlags) { pFlags = EXPCMDFLAGS.ECF_DEFAULT; return HResult.S_OK; } - public int EnumSubCommands(out IEnumExplorerCommand ppEnum) { + public virtual int EnumSubCommands(out IEnumExplorerCommand ppEnum) { ppEnum = null!; return HResult.E_NOTIMPL; } diff --git a/PasteIntoFile.ShellExtension/CopyCommand.cs b/PasteIntoFile.ShellExtension/CopyCommand.cs index bc65457..91fbd6c 100644 --- a/PasteIntoFile.ShellExtension/CopyCommand.cs +++ b/PasteIntoFile.ShellExtension/CopyCommand.cs @@ -1,4 +1,5 @@ using System.Runtime.InteropServices; +using PasteIntoFile.Core.Properties; namespace PasteIntoFileShellExtension; @@ -12,12 +13,17 @@ public sealed class CopyCommand : BaseExplorerCommand { public override string Clsid => Clsids.CopyCommand; public override int GetTitle(IShellItemArray psiItemArray, out IntPtr ppszName) { - ppszName = Marshal.StringToCoTaskMemUni(Titles.Copy); + ppszName = Marshal.StringToCoTaskMemUni(Resources.str_contextentry_copyfromfile); return HResult.S_OK; } public override int GetState(IShellItemArray psiItemArray, bool fOkToBeSlow, out EXPCMDSTATE pCmdState) { - pCmdState = CheckSingleFileSelected(psiItemArray); + // Show if exactly one item is selected + if (psiItemArray != null && psiItemArray.GetCount(out var count) == HResult.S_OK && count == 1) { + pCmdState = EXPCMDSTATE.ECS_ENABLED; + } else { + pCmdState = EXPCMDSTATE.ECS_HIDDEN; + } return HResult.S_OK; } diff --git a/PasteIntoFile.ShellExtension/ExplorerCommandEnumerator.cs b/PasteIntoFile.ShellExtension/ExplorerCommandEnumerator.cs new file mode 100644 index 0000000..bc87eae --- /dev/null +++ b/PasteIntoFile.ShellExtension/ExplorerCommandEnumerator.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Runtime.InteropServices; + +namespace PasteIntoFileShellExtension; + +/// +/// COM-visible enumerator for IExplorerCommand subcommands. +/// Wraps a list of IExplorerCommand instances and exposes them via IEnumExplorerCommand. +/// +[ComVisible(true)] +[Guid("B2E4F8A1-3D5C-4B9E-A7F1-9C8D6E5A4B3C")] +[ClassInterface(ClassInterfaceType.None)] +[ComDefaultInterface(typeof(IEnumExplorerCommand))] +public class ExplorerCommandEnumerator : IEnumExplorerCommand { + private readonly IEnumerator _enumerator; + private IExplorerCommand? _current; + + public ExplorerCommandEnumerator(IList commands) { + _enumerator = commands.GetEnumerator(); + } + + public int Next(uint celt, out IExplorerCommand rgelt, out uint pceltFetched) { + rgelt = null!; + pceltFetched = 0; + + if (celt == 0) { + return HResult.S_OK; + } + + if (_enumerator.MoveNext()) { + _current = (IExplorerCommand)_enumerator.Current; + rgelt = _current; + pceltFetched = 1; + return HResult.S_OK; + } + + return HResult.S_FALSE; + } + + public int Skip(uint celt) { + for (uint i = 0; i < celt; i++) { + if (!_enumerator.MoveNext()) { + return HResult.S_FALSE; + } + } + return HResult.S_OK; + } + + public int Reset() { + _enumerator.Reset(); + _current = null; + return HResult.S_OK; + } + + public int Clone(out IEnumExplorerCommand ppEnum) { + // Clone is not supported; return E_NOTIMPL + ppEnum = null!; + return HResult.E_NOTIMPL; + } +} diff --git a/PasteIntoFile.ShellExtension/FileGroupCommand.cs b/PasteIntoFile.ShellExtension/FileGroupCommand.cs new file mode 100644 index 0000000..46da7ae --- /dev/null +++ b/PasteIntoFile.ShellExtension/FileGroupCommand.cs @@ -0,0 +1,61 @@ +using System.Runtime.InteropServices; +using PasteIntoFile.Core.Properties; + +namespace PasteIntoFileShellExtension; + +// Shared COM class ID for the file group command +static class FileGroupClsid { + public const string Value = "109EFE3F-786B-4DFA-B639-4B673C05B932"; +} + +/// +/// Parent group command for file context menus. +/// Displays "Paste Into File" with a right-arrow submenu containing Copy, Replace, and Append. +/// +[ComVisible(true)] +[Guid(FileGroupClsid.Value)] +[ProgId("PasteIntoFile.ShellExtension.FileGroupCommand")] +[ClassInterface(ClassInterfaceType.None)] +[ComDefaultInterface(typeof(IExplorerCommand))] +public sealed class FileGroupCommand : BaseExplorerCommand { + + public override string Clsid => FileGroupClsid.Value; + + public override int GetTitle(IShellItemArray psiItemArray, out IntPtr ppszName) { + ppszName = Marshal.StringToCoTaskMemUni(Resources.str_contextentry); + return HResult.S_OK; + } + + public override int GetState(IShellItemArray psiItemArray, bool fOkToBeSlow, out EXPCMDSTATE pCmdState) { + // Show the group if exactly one item is selected + if (psiItemArray != null && psiItemArray.GetCount(out var count) == HResult.S_OK && count == 1) { + pCmdState = EXPCMDSTATE.ECS_ENABLED; + } else { + pCmdState = EXPCMDSTATE.ECS_HIDDEN; + } + return HResult.S_OK; + } + + public override int Invoke(IShellItemArray psiItemArray, IntPtr pbc) { + // The group itself is not invokable; only its subcommands are. + return HResult.E_NOTIMPL; + } + + public override int GetFlags(out EXPCMDFLAGS pFlags) { + // Mark this command as having subcommands so Explorer shows the right-arrow indicator + pFlags = EXPCMDFLAGS.ECF_HASSUBCOMMANDS; + return HResult.S_OK; + } + + public override int EnumSubCommands(out IEnumExplorerCommand ppEnum) { + // Return the subcommands in the desired order: Copy, Replace, Append + var subCommands = new List { + new ReplaceCommand(), + new AppendCommand(), + new CopyCommand() + }; + + ppEnum = new ExplorerCommandEnumerator(subCommands); + return HResult.S_OK; + } +} diff --git a/PasteIntoFile.ShellExtension/PasteCommand.cs b/PasteIntoFile.ShellExtension/PasteCommand.cs index e1deacd..f3b0c76 100644 --- a/PasteIntoFile.ShellExtension/PasteCommand.cs +++ b/PasteIntoFile.ShellExtension/PasteCommand.cs @@ -1,5 +1,6 @@ using System.Runtime.InteropServices; using PasteIntoFile.Core; +using PasteIntoFile.Core.Properties; namespace PasteIntoFileShellExtension; @@ -17,7 +18,7 @@ public override int GetTitle(IShellItemArray psiItemArray, out IntPtr ppszName) // while avoiding expensive file I/O on slow storage. SettingsUtil.ReloadIfChanged(Settings.Default); - var title = Titles.Paste; + var title = Resources.str_contextentry; if (!Settings.Default.autoSave) { title += "…"; // opens a dialog } diff --git a/PasteIntoFile.ShellExtension/ReplaceCommand.cs b/PasteIntoFile.ShellExtension/ReplaceCommand.cs index 1ea42d8..e57a823 100644 --- a/PasteIntoFile.ShellExtension/ReplaceCommand.cs +++ b/PasteIntoFile.ShellExtension/ReplaceCommand.cs @@ -1,4 +1,5 @@ using System.Runtime.InteropServices; +using PasteIntoFile.Core.Properties; namespace PasteIntoFileShellExtension; @@ -12,12 +13,17 @@ public sealed class ReplaceCommand : BaseExplorerCommand { public override string Clsid => Clsids.ReplaceCommand; public override int GetTitle(IShellItemArray psiItemArray, out IntPtr ppszName) { - ppszName = Marshal.StringToCoTaskMemUni(Titles.Replace); + ppszName = Marshal.StringToCoTaskMemUni(Resources.str_contextentry_replace); return HResult.S_OK; } public override int GetState(IShellItemArray psiItemArray, bool fOkToBeSlow, out EXPCMDSTATE pCmdState) { - pCmdState = CheckSingleFileSelected(psiItemArray); + // Show if exactly one item is selected + if (psiItemArray != null && psiItemArray.GetCount(out var count) == HResult.S_OK && count == 1) { + pCmdState = EXPCMDSTATE.ECS_ENABLED; + } else { + pCmdState = EXPCMDSTATE.ECS_HIDDEN; + } return HResult.S_OK; } diff --git a/PasteIntoFile/Properties/Resources.de.resx b/PasteIntoFile/Properties/Resources.de.resx index ecc7892..85773f9 100644 --- a/PasteIntoFile/Properties/Resources.de.resx +++ b/PasteIntoFile/Properties/Resources.de.resx @@ -84,10 +84,6 @@ Bitte die Anwendung als Administrator ausführen! - - Einfügen als Datei - Context menu entry for pasting - Speicherort auswählen str_select_folder @@ -188,11 +184,6 @@ Aktuellen Inhalt der Zwischenablage jetzt speichern? Ungültiges Zeichen: {0} - - Dateiinhalt kopieren - Context menu entry for copying - - Die Datei {0} enthält Daten eines unbekannten Formats, die nicht in die Zwischenablage kopiert werden können. @@ -298,15 +289,6 @@ Allows to keep application window always on top (in foreground of other windows) Hinzufügen zu bestehender Datei wird für "{0}" nicht unterstützt. - - Ersetzen - - - Einfügen in diese Datei - - - Anfügen - Die Ordner-Vorlage wird bei gedrückter STRG Taste an den Zielordner angefügt. Absolute Pfade sind auch möglich und ersetzten den Zielordner. diff --git a/PasteIntoFile/Properties/Resources.es-ES.resx b/PasteIntoFile/Properties/Resources.es-ES.resx index 822c35f..7ae2b6c 100644 --- a/PasteIntoFile/Properties/Resources.es-ES.resx +++ b/PasteIntoFile/Properties/Resources.es-ES.resx @@ -84,10 +84,6 @@ ¡Por favor, ejecute la aplicación como administrador! - - Pegar en fichero - Context menu entry for pasting - Seleccione una carpeta para guardar este archivo str_select_folder @@ -188,11 +184,6 @@ Para más detalles sobre el formato especificados <a>haga clic aquí</a Carácter no válido: '{0}' - - Copiar contenido del archivo - Context menu entry for copying - - El archivo {0} contiene datos de formato desconocido que no pueden copiarse al portapapeles. @@ -291,15 +282,6 @@ Allows to keep application window always on top (in foreground of other windows) Adjuntar no está soportado para la extensión "{0}". - - Reemplazar - - - Pegar en este archivo - - - Anexar - La plantilla de subcarpeta se añade a la ruta de la carpeta cuando se ejecuta Pegar en el archivo con la tecla CTRL presionada. Las rutas absolutas también están soportadas y reemplazarán la carpeta. diff --git a/PasteIntoFile/Properties/Resources.fr.resx b/PasteIntoFile/Properties/Resources.fr.resx index 298ccec..0778103 100644 --- a/PasteIntoFile/Properties/Resources.fr.resx +++ b/PasteIntoFile/Properties/Resources.fr.resx @@ -84,10 +84,6 @@ Veuillez exécuter l'application en tant qu'administrateur ! - - Coller dans un fichier - Context menu entry for pasting - Sélectionnez un dossier pour enregistrer ce fichier str_select_folder @@ -188,11 +184,6 @@ Enregistrer le contenu actuel du presse-papiers maintenant ? Caractère invalide : {0} - - Copier le contenu du fichier - Context menu entry for copying - - Le fichier {0} contient des données de format inconnu qui ne peuvent pas être copiées dans le presse-papiers. @@ -297,15 +288,6 @@ Allows to keep application window always on top (in foreground of other windows) L'ajout n'est pas pris en charge pour l'extension "{0}". - - Remplacer - - - Coller dans ce fichier - - - Ajouter - Le modèle de dossier est ajouté au chemin du dossier lors de l'exécution de Coller dans un fichier avec la touche CTRL pressée. Les chemins absolus sont également pris en charge et remplaceront le dossier. diff --git a/PasteIntoFile/Properties/Resources.it.resx b/PasteIntoFile/Properties/Resources.it.resx index ad7ec36..16f93ee 100644 --- a/PasteIntoFile/Properties/Resources.it.resx +++ b/PasteIntoFile/Properties/Resources.it.resx @@ -84,10 +84,6 @@ Perfavore avvia l'app come amministratore! - - Incolla nel file - Context menu entry for pasting - Seleziona una cartella per salvare questo file str_select_folder @@ -189,11 +185,6 @@ Salvare ora i contenuti degli appunti correnti? Carattere non valido: {0} - - Copia il contenuto del file - Context menu entry for copying - - Il file {0} contiene dati di formato sconosciuto che non possono essere copiati negli appunti. @@ -292,15 +283,6 @@ Allows to keep application window always on top (in foreground of other windows) L'aggiunta non è supportata per l'estensione "{0}". - - Sostituisci - - - Incolla in questo file - - - Aggiungi - Il modello di cartella viene aggiunto al percorso della cartella quando si esegue Incolla nel file con il tasto CTRL premuto. Anche i percorsi assoluti sono supportati e sostituiranno la cartella. diff --git a/PasteIntoFile/Properties/Resources.ja-JP.resx b/PasteIntoFile/Properties/Resources.ja-JP.resx index f897b30..3de3b7f 100644 --- a/PasteIntoFile/Properties/Resources.ja-JP.resx +++ b/PasteIntoFile/Properties/Resources.ja-JP.resx @@ -84,10 +84,6 @@ 管理者としてアプリケーションを実行してください! - - ファイルに貼り付け - Context menu entry for pasting - このファイルを保存するフォルダーを選択してください str_select_folder @@ -189,11 +185,6 @@ Tooltip 無効な文字: {0} - - ファイルの内容をコピー - Context menu entry for copying - - ファイル {0} は、クリップボードにコピーできない不明なフォーマットのデータを含んでいます。 @@ -292,15 +283,6 @@ Allows to keep application window always on top (in foreground of other windows) 拡張機能「{0}」の追加はサポートされていません。 - - 置き換え - - - このファイルに貼り付け - - - 追記 - CTRLキーを押しながら Paste Into File を実行すると、サブフォルダーテンプレートがフォルダーパスに追加されます。 絶対パスもサポートされ、フォルダーを置き換えます。 diff --git a/PasteIntoFile/Properties/Resources.ko.resx b/PasteIntoFile/Properties/Resources.ko.resx index 0dffdf7..2843062 100644 --- a/PasteIntoFile/Properties/Resources.ko.resx +++ b/PasteIntoFile/Properties/Resources.ko.resx @@ -84,10 +84,6 @@ 응용 프로그램을 관리자로 실행해 주세요! - - 파일에 붙여넣기 - Context menu entry for pasting - 이 파일을 저장할 폴더 선택 str_select_folder @@ -188,11 +184,6 @@ Tooltip 잘못된 문자: {0} - - 파일 내용 복사 - Context menu entry for copying - - 파일 {0}에는 클립보드에 복사할 수 없는 형식이 알려지지 않은 데이터가 포함되어 있습니다. @@ -298,15 +289,6 @@ Allows to keep application window always on top (in foreground of other windows) 확장자 "{0}"에서는 추가 기능이 지원되지 않습니다. - - 바꾸기 - - - 이 파일에 붙여넣기 - - - 추가 - 하위 폴더 템플릿은 CTRL 키를 눌러 파일에 붙여넣기를 실행할 때 폴더 경로에 추가됩니다. 절대 경로도 지원되며 폴더를 대체합니다. diff --git a/PasteIntoFile/Properties/Resources.pt-BR.resx b/PasteIntoFile/Properties/Resources.pt-BR.resx index 3a4e2b5..1a88646 100644 --- a/PasteIntoFile/Properties/Resources.pt-BR.resx +++ b/PasteIntoFile/Properties/Resources.pt-BR.resx @@ -84,10 +84,6 @@ Por favor, execute o aplicativo como administrador! - - Colar no arquivo - Context menu entry for pasting - Selecione uma pasta para salvar este arquivo str_select_folder @@ -189,11 +185,6 @@ Salvar conteúdos atuais da área de transferência? Carácter inválido: {0} - - Copiar conteúdo do arquivo - Context menu entry for copying - - O arquivo {0} contém dados de um formato desconhecido em que não pode ser copiado para a área de transferência. @@ -292,15 +283,6 @@ Allows to keep application window always on top (in foreground of other windows) Acrescentar não é suportado para a extensão "{0}". - - Substituir - - - Colar nesse arquivo - - - Acrescentar - O modelo da subpasta é acrescentada para o caminho da pasta ao executar Paste Into File quando pressionar a tecla CTRL. Caminhos absolutos também são compatíveis e vão substituir a pasta. diff --git a/PasteIntoFile/Properties/Resources.pt-PT.resx b/PasteIntoFile/Properties/Resources.pt-PT.resx index 43bf453..06c9167 100644 --- a/PasteIntoFile/Properties/Resources.pt-PT.resx +++ b/PasteIntoFile/Properties/Resources.pt-PT.resx @@ -84,10 +84,6 @@ Por favor, execute a aplicação como administrador! - - Colar no ficheiro - Context menu entry for pasting - Selecione uma pasta para salvar este ficheiro str_select_folder @@ -189,11 +185,6 @@ Guardar atuais conteúdos da área de transferência? Carácter inválido: {0} - - Copiar conteúdo do ficheiro - Context menu entry for copying - - O ficheiro {0} contém dados de formato desconhecido que não pode ser copiado para a área de transferência @@ -292,15 +283,6 @@ Allows to keep application window always on top (in foreground of other windows) Impossível acrescentar para a extensão "{0}". - - Substituir - - - Colar neste ficheiro - - - Acrescentar - O modelo de pasta é acrescentado ao caminho da pasta ao executar Paste Into File quando premir a tecla CTRL. Caminhos absolutos são suportados e irão substituir a pasta. diff --git a/PasteIntoFile/Properties/Resources.resx b/PasteIntoFile/Properties/Resources.resx index bc00a9d..4375bad 100644 --- a/PasteIntoFile/Properties/Resources.resx +++ b/PasteIntoFile/Properties/Resources.resx @@ -89,10 +89,6 @@ Please run the application as administrator! - - Paste into file - Context menu entry for pasting - Use new Windows 11 context menu @@ -203,11 +199,6 @@ Save current clipboard contents now? Invalid character: {0} - - Copy file content - Context menu entry for copying - - The file {0} contains data of unknown format which cannot be copied to the clipboard. @@ -313,15 +304,6 @@ Allows to keep application window always on top (in foreground of other windows) Appending is not supported for extension "{0}". - - Replace - - - Paste into this file - - - Append - The folder template is appended to the folder path when executing Paste Into File with pressed CTRL key. Absolute paths are also supported and will replace the folder. diff --git a/PasteIntoFile/Properties/Resources.ru-RU.resx b/PasteIntoFile/Properties/Resources.ru-RU.resx index b75201b..1407da9 100644 --- a/PasteIntoFile/Properties/Resources.ru-RU.resx +++ b/PasteIntoFile/Properties/Resources.ru-RU.resx @@ -84,10 +84,6 @@ Пожалуйста, запустите приложение от имени администратора! - - Вставить в файл - Context menu entry for pasting - Выберите папку для сохранения данного файла str_select_folder @@ -189,11 +185,6 @@ Tooltip Недопустимый символ: {0} - - Копировать содержимое файла - Context menu entry for copying - - Файл {0} содержит данные неизвестного формата, которые невозможно скопировать в буфер обмена. @@ -291,15 +282,6 @@ Allows to keep application window always on top (in foreground of other windows) Дополнение содержимого не поддерживается для файла с расширением "{0}". - - Заменить - - - Вставить в этот файл - - - Дополнить - Шаблон вложенной папки добавляется к пути к папке при выполнении Paste Into File с нажатой клавишей CTRL. Также поддерживаются абсолютные пути, которые заменяют папку. diff --git a/PasteIntoFile/Properties/Resources.uk-UA.resx b/PasteIntoFile/Properties/Resources.uk-UA.resx index 644e389..da41fde 100644 --- a/PasteIntoFile/Properties/Resources.uk-UA.resx +++ b/PasteIntoFile/Properties/Resources.uk-UA.resx @@ -81,10 +81,6 @@ Папка Folder path location to save file into - - Вставити до файлу - Context menu entry for pasting - Виберіть папку для збереження цього файлу str_select_folder diff --git a/PasteIntoFile/Properties/Resources.zh-CN.resx b/PasteIntoFile/Properties/Resources.zh-CN.resx index c2694fa..ecc460d 100644 --- a/PasteIntoFile/Properties/Resources.zh-CN.resx +++ b/PasteIntoFile/Properties/Resources.zh-CN.resx @@ -84,10 +84,6 @@ 请以管理员身份运行此应用程序! - - Paste Into File - Context menu entry for pasting - 选择保存此文件的文件夹 str_select_folder @@ -189,11 +185,6 @@ Tooltip 无效字符:{0} - - 复制文件内容 - Context menu entry for copying - - 文件 {0} 包含未知格式的数据,无法复制到剪贴板。 @@ -302,9 +293,6 @@ Allows to keep application window always on top (in foreground of other windows) 替换 - - 粘贴到此文件中 - 追加 diff --git a/PasteIntoFile/Properties/Resources.zh-TW.resx b/PasteIntoFile/Properties/Resources.zh-TW.resx index bce0ac9..0c86541 100644 --- a/PasteIntoFile/Properties/Resources.zh-TW.resx +++ b/PasteIntoFile/Properties/Resources.zh-TW.resx @@ -84,10 +84,6 @@ 請以管理員模式執行本應用程式! - - 貼入檔案 - Context menu entry for pasting - 選擇資料夾來儲存此檔案 str_select_folder @@ -189,11 +185,6 @@ Tooltip 無效字元:{0} - - 複製檔案內容 - Context menu entry for copying - - 檔案 {0} 內含未知的資料格式而無法複製到剪貼簿。 @@ -294,9 +285,6 @@ Allows to keep application window always on top (in foreground of other windows) 取代 - - 貼入此檔案 - 貼入尾端 diff --git a/PasteIntoFile/RegistryUtil.cs b/PasteIntoFile/RegistryUtil.cs index d3dfdf3..31c1ead 100644 --- a/PasteIntoFile/RegistryUtil.cs +++ b/PasteIntoFile/RegistryUtil.cs @@ -34,13 +34,13 @@ public void Register(RegistryKey key) { public static readonly ContextMenuEntryPaste ContextMenuPaste = new ContextMenuEntryPaste(); public class ContextMenuEntryPaste : ContextMenuEntry { public ContextMenuEntryPaste() : base("Directory", "PasteIntoFile") { } - protected override Command Command => new Command(Resources.str_contextentry, "paste \"%V\"", () => !Settings.Default.autoSave); + protected override Command Command => new Command(Core.Properties.Resources.str_contextentry, "paste \"%V\"", () => !Settings.Default.autoSave); } public static readonly ContextMenuEntryCopy ContextMenuCopy = new ContextMenuEntryCopy(); public class ContextMenuEntryCopy : ContextMenuEntry { public ContextMenuEntryCopy() : base("*", "PasteIntoFile") { } - protected override Command Command => new Command(Resources.str_contextentry_copyfromfile, "copy \"%V\""); + protected override Command Command => new Command(Core.Properties.Resources.str_contextentry_copyfromfile, "copy \"%V\""); } public static readonly ContextMenuEntryReplace ContextMenuReplace = new ContextMenuEntryReplace(); @@ -48,7 +48,7 @@ public class ContextMenuEntryReplace : ContextMenuEntry { public ContextMenuEntryReplace() : base("*", "PasteIntoFile_replace") { } protected override string AppliesTo() => APPEND_NOT_SUPPORTED; protected override Command Command => new Command( - Resources.str_contextentry_paste_into_existing_file + " (" + Resources.str_replace + ")", + Core.Properties.Resources.str_contextentry_paste_into_existing_file + " (" + Core.Properties.Resources.str_contextentry_replace + ")", "paste --overwrite=true --directory=\"%w\" --filename=\"%V\" --autosave=true" ); public override void Register() { @@ -63,10 +63,10 @@ public override void UnRegister() { private class ContextMenuEntryReplaceAppend : ContextMenuEntry { public ContextMenuEntryReplaceAppend() : base("*", "PasteIntoFile_replace_append") { } protected override string AppliesTo() => "NOT ( " + APPEND_NOT_SUPPORTED + " )"; - protected override string Title => Resources.str_contextentry_paste_into_existing_file; + protected override string Title => Core.Properties.Resources.str_contextentry_paste_into_existing_file; protected override Command[] SubCommands => new[]{ - new Command(Resources.str_replace, "paste --overwrite=true --directory=\"%w\" --filename=\"%V\" --autosave=true"), - new Command(Resources.str_append, "paste --append --directory=\"%w\" --filename=\"%V\" --autosave=true") + new Command(Core.Properties.Resources.str_contextentry_replace, "paste --overwrite=true --directory=\"%w\" --filename=\"%V\" --autosave=true"), + new Command(Core.Properties.Resources.str_contextentry_append, "paste --append --directory=\"%w\" --filename=\"%V\" --autosave=true") }; } // for file types that are known not to support appending, show an entry without subcommands instead diff --git a/PasteIntoFile/Wizard.Designer.cs b/PasteIntoFile/Wizard.Designer.cs index a93980f..398edef 100644 --- a/PasteIntoFile/Wizard.Designer.cs +++ b/PasteIntoFile/Wizard.Designer.cs @@ -213,7 +213,7 @@ private void InitializeComponent() { this.contextEntryCheckBoxPaste.Name = "contextEntryCheckBoxPaste"; this.contextEntryCheckBoxPaste.Size = new System.Drawing.Size(288, 24); this.contextEntryCheckBoxPaste.TabIndex = 1; - this.contextEntryCheckBoxPaste.Text = Resources.str_contextentry; + this.contextEntryCheckBoxPaste.Text = Core.Properties.Resources.str_contextentry; this.contextEntryCheckBoxPaste.UseVisualStyleBackColor = true; this.contextEntryCheckBoxPaste.CheckedChanged += new System.EventHandler(this.ChkContextEntry_CheckedChanged); // @@ -227,7 +227,7 @@ private void InitializeComponent() { this.contextEntryCheckBoxCopy.Name = "contextEntryCheckBoxCopy"; this.contextEntryCheckBoxCopy.Size = new System.Drawing.Size(288, 24); this.contextEntryCheckBoxCopy.TabIndex = 2; - this.contextEntryCheckBoxCopy.Text = Resources.str_contextentry_copyfromfile; + this.contextEntryCheckBoxCopy.Text = Core.Properties.Resources.str_contextentry_copyfromfile; this.contextEntryCheckBoxCopy.UseVisualStyleBackColor = true; this.contextEntryCheckBoxCopy.CheckedChanged += new System.EventHandler(this.ChkContextEntry_CheckedChanged); // @@ -241,7 +241,7 @@ private void InitializeComponent() { this.contextEntryCheckBoxReplace.Name = "contextEntryCheckBoxReplace"; this.contextEntryCheckBoxReplace.Size = new System.Drawing.Size(288, 24); this.contextEntryCheckBoxReplace.TabIndex = 3; - this.contextEntryCheckBoxReplace.Text = Resources.str_contextentry_paste_into_existing_file + " (" + Resources.str_replace + "/" + Resources.str_append + ")"; + this.contextEntryCheckBoxReplace.Text = Core.Properties.Resources.str_contextentry_paste_into_existing_file + " (" + Core.Properties.Resources.str_contextentry_replace + "/" + Core.Properties.Resources.str_contextentry_append + ")"; this.contextEntryCheckBoxReplace.UseVisualStyleBackColor = true; this.contextEntryCheckBoxReplace.CheckedChanged += new System.EventHandler(this.ChkContextEntry_CheckedChanged); //