From 169eee636e89cc87a4fa05667416de6c3c91444d Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Wed, 2 Mar 2022 15:27:41 -0500
Subject: [PATCH 01/19] Added ctrl and shift key combination logic
Added functionality for Ctrl key combination to have PasteIntoFile perform the default action automatically without having to prompt user with a dialog window.
Added Shift key combination, to add a default sub folder to 'Current Location' field.
The default sub folder for a text file is Text, and the default sub folder for an image file is Image.
Added command line options TextSubDir and ImageSubDir.
To change the default Text Sub Folder, use argument:
/TextSubDir MyDefaultTextFolder
To change the default Image Sub Folder, use argument:
/ImageSubDir MyImgDir
Added logic to have combo list for text files only show text file types, and for image files only show image file types.
Added additional text file types to the combo list.
---
PasteIntoFile/Program.cs | 89 +++++++++++++++++++++------
PasteIntoFile/frmMain.Designer.cs | 17 ------
PasteIntoFile/frmMain.cs | 99 ++++++++++++++++++++++++-------
3 files changed, 149 insertions(+), 56 deletions(-)
diff --git a/PasteIntoFile/Program.cs b/PasteIntoFile/Program.cs
index 202ab20..e55cb42 100644
--- a/PasteIntoFile/Program.cs
+++ b/PasteIntoFile/Program.cs
@@ -20,23 +20,40 @@ static void Main(string[] args)
Application.SetCompatibleTextRenderingDefault(false);
if (args.Length>0)
{
- if (args[0] == "/reg")
+ if (string.Equals(args[0], "/reg", StringComparison.CurrentCultureIgnoreCase))
{
RegisterApp();
return;
}
- else if (args[0] == "/unreg")
+ else if (string.Equals(args[0], "/unreg", StringComparison.CurrentCultureIgnoreCase))
{
UnRegisterApp();
return;
}
- else if (args[0] == "/filename")
- {
- if (args.Length > 1) {
- RegisterFilename(args[1]);
- }
- return;
- }
+ else if (string.Equals(args[0], "/filename", StringComparison.CurrentCultureIgnoreCase))
+ {
+ if (args.Length > 1)
+ {
+ RegisterFilename(args[1]);
+ }
+ return;
+ }
+ else if (string.Equals(args[0], "/TextSubDir", StringComparison.CurrentCultureIgnoreCase))
+ {
+ if (args.Length > 1)
+ {
+ RegisterTextSubDir(args[1]);
+ }
+ return;
+ }
+ else if (string.Equals(args[0], "/ImageSubDir", StringComparison.CurrentCultureIgnoreCase))
+ {
+ if (args.Length > 1)
+ {
+ RegisterImageSubDir(args[1]);
+ }
+ return;
+ }
Application.Run(new frmMain(args[0]));
}
else
@@ -46,20 +63,56 @@ static void Main(string[] args)
}
+ public static void ShowMessageToRunAsAdmin(Exception ex)
+ {
+ MessageBox.Show(ex.Message + "\nPlease run the application as Administrator !", "Paste As File", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+
public static void RegisterFilename(string filename)
{
try
{
- var key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey("Paste Into File");
- key = key.CreateSubKey("filename");
- key.SetValue("", filename);
+ var key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey("Paste Into File");
+ key = key.CreateSubKey("filename");
+ key.SetValue("", filename);
+
+ MessageBox.Show("Filename has been registered with your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ catch (Exception ex)
+ {
+ ShowMessageToRunAsAdmin(ex);
+ }
+ }
+
+ public static void RegisterTextSubDir(string TextSubDir)
+ {
+ try
+ {
+ var key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey("Paste Into File");
+ key = key.CreateSubKey("TextSubDir");
+ key.SetValue("", TextSubDir);
+
+ MessageBox.Show("TextSubDir has been registered with your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ catch (Exception ex)
+ {
+ ShowMessageToRunAsAdmin(ex);
+ }
+ }
+
+ public static void RegisterImageSubDir(string ImageSubDir)
+ {
+ try
+ {
+ var key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey("Paste Into File");
+ key = key.CreateSubKey("ImageSubDir");
+ key.SetValue("", ImageSubDir);
- MessageBox.Show("Filename has been registered with your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ MessageBox.Show("ImageSubDir has been registered with your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
- //throw;
- MessageBox.Show(ex.Message + "\nPlease run the application as Administrator !", "Paste As File", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ ShowMessageToRunAsAdmin(ex);
}
}
@@ -78,8 +131,7 @@ public static void UnRegisterApp()
}
catch (Exception ex)
{
- MessageBox.Show(ex.Message + "\nPlease run the application as Administrator !", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Error);
-
+ ShowMessageToRunAsAdmin(ex);
}
}
@@ -101,8 +153,7 @@ public static void RegisterApp()
}
catch (Exception ex)
{
- //throw;
- MessageBox.Show(ex.Message + "\nPlease run the application as Administrator !", "Paste As File", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ ShowMessageToRunAsAdmin(ex);
}
}
diff --git a/PasteIntoFile/frmMain.Designer.cs b/PasteIntoFile/frmMain.Designer.cs
index a6636b4..d9e7d23 100644
--- a/PasteIntoFile/frmMain.Designer.cs
+++ b/PasteIntoFile/frmMain.Designer.cs
@@ -107,22 +107,6 @@ private void InitializeComponent()
// comExt
//
this.comExt.FormattingEnabled = true;
- this.comExt.Items.AddRange(new object[] {
- "txt",
- "html",
- "js",
- "css",
- "csv",
- "json",
- "cs",
- "cpp",
- "java",
- "php",
- "png",
- "jpg",
- "bmp",
- "gif",
- "ico"});
this.comExt.Location = new System.Drawing.Point(316, 37);
this.comExt.Margin = new System.Windows.Forms.Padding(4);
this.comExt.Name = "comExt";
@@ -257,6 +241,5 @@ private void InitializeComponent()
private System.Windows.Forms.Label lblMe;
private System.Windows.Forms.Label lblWebsite;
private System.Windows.Forms.Label lblHelp;
- }
}
diff --git a/PasteIntoFile/frmMain.cs b/PasteIntoFile/frmMain.cs
index bce6897..1e6ac82 100644
--- a/PasteIntoFile/frmMain.cs
+++ b/PasteIntoFile/frmMain.cs
@@ -17,10 +17,12 @@ namespace PasteAsFile
{
public partial class frmMain : Form
{
- public const string DEFAULT_FILENAME_FORMAT = "yyyy-MM-dd HH.mm.ss";
- public string CurrentLocation { get; set; }
- public bool IsText { get; set; }
- public frmMain()
+ public const string DEFAULT_TEXT_SUBFOLDER = "Text";
+ public const string DEFAULT_IMAGE_SUBFOLDER = "Image";
+ public const string DEFAULT_FILENAME_FORMAT = "yyyy-MM-dd HH.mm.ss";
+ public string CurrentLocation { get; set; }
+ public bool IsText { get; set; }
+ public frmMain()
{
InitializeComponent();
}
@@ -31,11 +33,13 @@ public frmMain(string location)
}
private void frmMain_Load(object sender, EventArgs e)
{
- string filename = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\shell\Paste Into File\filename", "", null) ?? DEFAULT_FILENAME_FORMAT;
- txtFilename.Text = DateTime.Now.ToString(filename);
+ string TextSubDir = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\shell\Paste Into File\TextSubDir", "", null) ?? DEFAULT_TEXT_SUBFOLDER;
+ string ImageSubDir = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\shell\Paste Into File\ImageSubDir", "", null) ?? DEFAULT_IMAGE_SUBFOLDER;
+ string filename = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\shell\Paste Into File\filename", "", null) ?? DEFAULT_FILENAME_FORMAT;
+ txtFilename.Text = DateTime.Now.ToString(filename);
txtCurrentLocation.Text = CurrentLocation ?? @"C:\";
- if (Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Paste Into File\command", "", null) == null)
+ if (Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Paste Into File\command", "", null) == null)
{
if (MessageBox.Show("Seems that you are running this application for the first time,\nDo you want to Register it with your system Context Menu ?", "Paste Into File", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
@@ -46,30 +50,72 @@ private void frmMain_Load(object sender, EventArgs e)
if (Clipboard.ContainsText())
{
lblType.Text = "Text File";
+ comExt.Items.AddRange(new object[] {
+ "ahk", // - AutoHotkey
+ "au3", // - AutoIt
+ "bat", // - DOS Batch
+ "cmd", // - DOS Batch (modern)
+ "cpp", // - C++ Language
+ "cs", // - C-Sharp Langauge
+ "css", // - Cascading Style Sheets - use to style an HTML document
+ "csv", // - Comma-Separated Value
+ "htm", // - Hypertext Markup Language
+ "html", // - Hypertext Markup Language
+ "ini", // - INI - Windows Configuration File
+ "java", // - Java Language
+ "js", // - JavaScript Language
+ "json", // - JavaScript Object Notation
+ "php", // - PHP Language
+ "pl", // - Perl Language
+ "ps1", // - PowerShell
+ "py", // - Python Language
+ "reg", // - Registry File
+ "swift", // - Switft Language
+ "txt", // - Text Files
+ "vb", // - Visual Basic Language
+ "vbs", // - Visual Basic Script Language
+ "xml" // - Extensible Markup Language
+ });
comExt.SelectedItem = "txt";
IsText = true;
- txtContent.Text = Clipboard.GetText();
- return;
+ txtContent.Text = Clipboard.GetText();
+ if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
+ txtCurrentLocation.Text = txtCurrentLocation.Text + @"\" + TextSubDir;
+ if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
+ Save_Action(0);
+ return;
}
if (Clipboard.ContainsImage())
{
lblType.Text = "Image";
+ comExt.Items.AddRange(new object[] {
+ "png",
+ "jpg",
+ "bmp",
+ "gif",
+ "ico"
+ });
comExt.SelectedItem = "png";
- imgContent.Image = Clipboard.GetImage();
+ imgContent.Image = Clipboard.GetImage();
+ if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
+ txtCurrentLocation.Text = txtCurrentLocation.Text + @"\" + ImageSubDir;
+ if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
+ Save_Action(0);
return;
}
lblType.Text = "Unknown File";
btnSave.Enabled = false;
+ }
- }
-
- private void btnSave_Click(object sender, EventArgs e)
+ public void Save_Action(int millisecondsTimeout)
{
string location = txtCurrentLocation.Text;
- location = location.EndsWith("\\") ? location : location + "\\";
+ if (!Directory.Exists(location))
+ Directory.CreateDirectory(location);
+ location = location.EndsWith("\\") ? location : location + "\\";
string filename = txtFilename.Text + "." + comExt.SelectedItem.ToString();
if (IsText)
{
@@ -106,10 +152,15 @@ private void btnSave_Click(object sender, EventArgs e)
Task.Factory.StartNew(() =>
{
- Thread.Sleep(1000);
+ if (millisecondsTimeout > 0)
+ Thread.Sleep(millisecondsTimeout);
Environment.Exit(0);
});
}
+ private void btnSave_Click(object sender, EventArgs e)
+ {
+ Save_Action(1000);
+ }
private void btnBrowseForFolder_Click(object sender, EventArgs e)
{
@@ -133,11 +184,19 @@ private void lblMe_Click(object sender, EventArgs e)
private void lblHelp_Click(object sender, EventArgs e)
{
- string msg = "Paste Into File helps you paste any text or images in your system clipboard into a file directly instead of creating new file yourself";
- msg += "\n--------------------\nTo Register the application to your system Context Menu run the program as Administrator with this argument : /reg";
- msg += "\nto Unregister the application use this argument : /unreg\n";
- msg += "\nTo change the format of the default filename, use this argument: /filename yyyy-MM-dd_HHmm\n";
- msg += "\n--------------------\nSend Feedback to : eslamx7@gmail.com\n\nThanks :)";
+ string msg = "Paste Into File helps you paste any text or images in your system clipboard into a file directly instead of creating new file yourself\n";
+ msg += "-----------------------------------------------------------------\n";
+ msg += "To Register the application to your system Context Menu run the program as Administrator with argument: /reg\n";
+ msg += "To Unregister the application use argument: /unreg\n";
+ msg += "To change the format of the default filename, use argument:\n/filename yyyy-MM-dd_HHmm\n";
+ msg += "-----------------------------------------------------------------\n";
+
+ msg += "To create a file automatically without a window prompt, hold ctrl key while selecting 'Paste Into File'\n";
+ msg += "To add a default sub folder to 'Current Location', hold shift key while selecting 'Paste Into File'. ";
+ msg += "The default sub folder for a text file is Text, and the default sub folder for an image file is Image.\n\n";
+ msg += "To change the default Text Sub Folder, use argument:\n/TextSubDir MyDefaultTextFolder\n";
+ msg += "To change the default Image Sub Folder, use argument:\n/ImageSubDir MyImgDir\n";
+ msg += "\n--------------------\nSend Feedback to : eslamx7@gmail.com\n\nThanks :)";
MessageBox.Show(msg, "Paste As File Help", MessageBoxButtons.OK, MessageBoxIcon.Information);
From c6197cb01e3d620c81230f88955f9b11333512fa Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Wed, 2 Mar 2022 15:30:40 -0500
Subject: [PATCH 02/19] Update frmMain.Designer.cs
---
PasteIntoFile/frmMain.Designer.cs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/PasteIntoFile/frmMain.Designer.cs b/PasteIntoFile/frmMain.Designer.cs
index d9e7d23..01c98fe 100644
--- a/PasteIntoFile/frmMain.Designer.cs
+++ b/PasteIntoFile/frmMain.Designer.cs
@@ -241,5 +241,7 @@ private void InitializeComponent()
private System.Windows.Forms.Label lblMe;
private System.Windows.Forms.Label lblWebsite;
private System.Windows.Forms.Label lblHelp;
+ }
}
+
From 871507ec743524376e4b33d874580728caa85fce Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Wed, 2 Mar 2022 15:53:51 -0500
Subject: [PATCH 03/19] Update README.md
---
README.md | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 3cdfd3c..e66f1a8 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ choco install pasteintofile
## Usage
-1. Right click in the folder where you want to create the file and choose the *Paste Into File* entry from the context menu:
+1. Right click in the folder where you want to create the file and choose the **Paste Into File** entry from the context menu:

@@ -30,6 +30,13 @@ choco install pasteintofile
2. Choose the filename, extenstion and location, then press the *Save* button:

+### Combination Key Usage
+* To create a file automatically (without a windows prompt), hold **CTRL** key while choosing **[Paste Into File]** in the context menu.
+* To create the file in a default sub folder under the current directory, hold **SHIFT** key while choosing **[Paste Into File]** in the context menu.
+* Holding both keys (**CTRL+SHIFT**) while choosing **[Paste Into File]** will create the text file automatically in the default sub folder associated with the file type.
+ * The default sub folder for a text file is Text, and the default folder for an image file is Image.
+ * The default sub folders can be changed using command line options. See Configuration section for details.
+
## Configuration
Run the following commands in a terminal (Command Prompt or PowerShell).
@@ -46,11 +53,25 @@ Run the following commands in a terminal (Command Prompt or PowerShell).
PasteIntoFile /unreg
```
-- To change the default filename format:
+- To change the default **filename** format:
```powershell
PasteIntoFile /filename yyyyMMdd_HHmmss
```
+
+- To change the default **Text** Sub Folder:
+
+ ```powershell
+ PasteIntoFile /TextSubDir MyDefaultTextFolder
+ ```
+
+
+- To change the default **Image** Sub Folder:
+
+ ```powershell
+ PasteIntoFile /ImageSubDir MyImgDir
+ ```
+
For more information on the format specifiers, see [Custom date and time format strings](https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings).
From 3abfe4d7438d99ed087dc809048b37a96d71f561 Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Wed, 2 Mar 2022 16:09:53 -0500
Subject: [PATCH 04/19] Update AssemblyInfo.cs
---
PasteIntoFile/Properties/AssemblyInfo.cs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/PasteIntoFile/Properties/AssemblyInfo.cs b/PasteIntoFile/Properties/AssemblyInfo.cs
index c316d43..82e65a9 100644
--- a/PasteIntoFile/Properties/AssemblyInfo.cs
+++ b/PasteIntoFile/Properties/AssemblyInfo.cs
@@ -8,9 +8,9 @@
[assembly: AssemblyTitle("PasteIntoFile")]
[assembly: AssemblyDescription("Paste Clipboard Contents Into Files")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("EslaMxSoft 2014")]
-[assembly: AssemblyProduct("PasteIntoFile v1.4")]
-[assembly: AssemblyCopyright("Copyright © EslaMxSoft 2014")]
+[assembly: AssemblyCompany("EslaMxSoft 2022")]
+[assembly: AssemblyProduct("PasteIntoFile v1.5")]
+[assembly: AssemblyCopyright("Copyright © EslaMxSoft 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.4.0.1")]
-[assembly: AssemblyFileVersion("1.4.0.1")]
+[assembly: AssemblyVersion("1.5.0.1")]
+[assembly: AssemblyFileVersion("1.5.0.1")]
From a89a50df2c4a6fd6f8ea88ad2ffcd3c4eedee3ee Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Wed, 2 Mar 2022 16:11:59 -0500
Subject: [PATCH 05/19] Update AssemblyInfo.cs
---
PasteIntoFile/Properties/AssemblyInfo.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/PasteIntoFile/Properties/AssemblyInfo.cs b/PasteIntoFile/Properties/AssemblyInfo.cs
index 82e65a9..45e5a0e 100644
--- a/PasteIntoFile/Properties/AssemblyInfo.cs
+++ b/PasteIntoFile/Properties/AssemblyInfo.cs
@@ -9,7 +9,7 @@
[assembly: AssemblyDescription("Paste Clipboard Contents Into Files")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("EslaMxSoft 2022")]
-[assembly: AssemblyProduct("PasteIntoFile v1.5")]
+[assembly: AssemblyProduct("PasteIntoFile v1.6")]
[assembly: AssemblyCopyright("Copyright © EslaMxSoft 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.5.0.1")]
-[assembly: AssemblyFileVersion("1.5.0.1")]
+[assembly: AssemblyVersion("1.6.0.1")]
+[assembly: AssemblyFileVersion("1.6.0.1")]
From eb8c67d136dd233cd7ae2b83e901f5bfdb3691d4 Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Wed, 2 Mar 2022 16:25:32 -0500
Subject: [PATCH 06/19] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index e66f1a8..7ce83d9 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## 📢 New Version Released: [Info & Download](https://on.eslamx.com/2YcPKdt) 🔥
+## 📢 New Version Released: [Info & Download](https://github.com/David-Maisonave/PasteIntoFile/releases/tag/v1.6) 🔥
---
# Paste Into File
@@ -18,7 +18,7 @@ choco install pasteintofile
1. Make sure you have _.NET Framework 4.5+_ installed in your system. (_Included in Windows 10_)
-2. Download the executable from [here](https://on.eslamx.com/2YcPKdt) and install it.
+2. Download the executable from [here](https://github.com/David-Maisonave/PasteIntoFile/releases/tag/v1.6) and install it.
## Usage
From 4f71fcaf475af3c4a7fe48ac3addc42bbea68ebe Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Wed, 2 Mar 2022 16:26:25 -0500
Subject: [PATCH 07/19] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 7ce83d9..e2a4f11 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## 📢 New Version Released: [Info & Download](https://github.com/David-Maisonave/PasteIntoFile/releases/tag/v1.6) 🔥
+## 📢 New Version Released: [Info & Download](https://github.com/David-Maisonave/PasteIntoFile/releases/tag/latest) 🔥
---
# Paste Into File
@@ -18,7 +18,7 @@ choco install pasteintofile
1. Make sure you have _.NET Framework 4.5+_ installed in your system. (_Included in Windows 10_)
-2. Download the executable from [here](https://github.com/David-Maisonave/PasteIntoFile/releases/tag/v1.6) and install it.
+2. Download the executable from [here](https://github.com/David-Maisonave/PasteIntoFile/releases/tag/latest) and install it.
## Usage
From 7c1a643f94b09e4966c54e1798fdead8b3982f26 Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Wed, 2 Mar 2022 16:27:59 -0500
Subject: [PATCH 08/19] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index e2a4f11..c6dcb91 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## 📢 New Version Released: [Info & Download](https://github.com/David-Maisonave/PasteIntoFile/releases/tag/latest) 🔥
+## 📢 New Version Released: [Info & Download](https://github.com/David-Maisonave/PasteIntoFile/releases/latest) 🔥
---
# Paste Into File
@@ -18,7 +18,7 @@ choco install pasteintofile
1. Make sure you have _.NET Framework 4.5+_ installed in your system. (_Included in Windows 10_)
-2. Download the executable from [here](https://github.com/David-Maisonave/PasteIntoFile/releases/tag/latest) and install it.
+2. Download the executable from [here](https://github.com/David-Maisonave/PasteIntoFile/releases/latest) and install it.
## Usage
From b9becec6b08094e9e5e470f497dbc667c76b51d1 Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Wed, 2 Mar 2022 16:41:13 -0500
Subject: [PATCH 09/19] Update AssemblyInfo.cs
---
PasteIntoFile/Properties/AssemblyInfo.cs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/PasteIntoFile/Properties/AssemblyInfo.cs b/PasteIntoFile/Properties/AssemblyInfo.cs
index 45e5a0e..4080dd8 100644
--- a/PasteIntoFile/Properties/AssemblyInfo.cs
+++ b/PasteIntoFile/Properties/AssemblyInfo.cs
@@ -5,11 +5,11 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("PasteIntoFile")]
+[assembly: AssemblyTitle("Paste Clipboard Contents Into File")]
[assembly: AssemblyDescription("Paste Clipboard Contents Into Files")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("EslaMxSoft 2022")]
-[assembly: AssemblyProduct("PasteIntoFile v1.6")]
+[assembly: AssemblyProduct("PasteIntoFile + David Maisonave Enhancements")]
[assembly: AssemblyCopyright("Copyright © EslaMxSoft 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.6.0.1")]
-[assembly: AssemblyFileVersion("1.6.0.1")]
+[assembly: AssemblyVersion("1.6.0.2")]
+[assembly: AssemblyFileVersion("1.6.0.2")]
From 4c1f0f2c8ee31f483ed7bed0d3e7504f24d65b1f Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Wed, 2 Mar 2022 16:46:25 -0500
Subject: [PATCH 10/19] Update AssemblyInfo.cs
---
PasteIntoFile/Properties/AssemblyInfo.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PasteIntoFile/Properties/AssemblyInfo.cs b/PasteIntoFile/Properties/AssemblyInfo.cs
index 4080dd8..b6730da 100644
--- a/PasteIntoFile/Properties/AssemblyInfo.cs
+++ b/PasteIntoFile/Properties/AssemblyInfo.cs
@@ -9,9 +9,9 @@
[assembly: AssemblyDescription("Paste Clipboard Contents Into Files")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("EslaMxSoft 2022")]
-[assembly: AssemblyProduct("PasteIntoFile + David Maisonave Enhancements")]
+[assembly: AssemblyProduct("PasteIntoFile")]
[assembly: AssemblyCopyright("Copyright © EslaMxSoft 2022")]
-[assembly: AssemblyTrademark("")]
+[assembly: AssemblyTrademark("EslaMxSoft 2022")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
From 4816a138020947b16f9e480d0a79631619d22f18 Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Thu, 3 Mar 2022 18:55:53 -0500
Subject: [PATCH 11/19] Switch keys around (ctrl and shift)
Switch keys around (ctrl and shift) so that it matches other version of PasteIntoFile.
---
PasteIntoFile/frmMain.cs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/PasteIntoFile/frmMain.cs b/PasteIntoFile/frmMain.cs
index 1e6ac82..e9aa843 100644
--- a/PasteIntoFile/frmMain.cs
+++ b/PasteIntoFile/frmMain.cs
@@ -79,9 +79,9 @@ private void frmMain_Load(object sender, EventArgs e)
comExt.SelectedItem = "txt";
IsText = true;
txtContent.Text = Clipboard.GetText();
- if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
- txtCurrentLocation.Text = txtCurrentLocation.Text + @"\" + TextSubDir;
if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
+ txtCurrentLocation.Text = txtCurrentLocation.Text + @"\" + TextSubDir;
+ if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
Save_Action(0);
return;
}
@@ -98,9 +98,9 @@ private void frmMain_Load(object sender, EventArgs e)
});
comExt.SelectedItem = "png";
imgContent.Image = Clipboard.GetImage();
- if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
- txtCurrentLocation.Text = txtCurrentLocation.Text + @"\" + ImageSubDir;
if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
+ txtCurrentLocation.Text = txtCurrentLocation.Text + @"\" + ImageSubDir;
+ if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
Save_Action(0);
return;
}
From 367c81d42591711b149c5bdcc31e8fe42fcea32d Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Thu, 3 Mar 2022 18:58:57 -0500
Subject: [PATCH 12/19] Update frmMain.cs
---
PasteIntoFile/frmMain.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PasteIntoFile/frmMain.cs b/PasteIntoFile/frmMain.cs
index e9aa843..4f90a2d 100644
--- a/PasteIntoFile/frmMain.cs
+++ b/PasteIntoFile/frmMain.cs
@@ -191,8 +191,8 @@ private void lblHelp_Click(object sender, EventArgs e)
msg += "To change the format of the default filename, use argument:\n/filename yyyy-MM-dd_HHmm\n";
msg += "-----------------------------------------------------------------\n";
- msg += "To create a file automatically without a window prompt, hold ctrl key while selecting 'Paste Into File'\n";
- msg += "To add a default sub folder to 'Current Location', hold shift key while selecting 'Paste Into File'. ";
+ msg += "To create a file automatically without a window prompt, hold shift key while selecting 'Paste Into File'\n";
+ msg += "To add a default sub folder to 'Current Location', hold ctrl key while selecting 'Paste Into File'. ";
msg += "The default sub folder for a text file is Text, and the default sub folder for an image file is Image.\n\n";
msg += "To change the default Text Sub Folder, use argument:\n/TextSubDir MyDefaultTextFolder\n";
msg += "To change the default Image Sub Folder, use argument:\n/ImageSubDir MyImgDir\n";
From 64ae4e93576431c3897df7f10c6104ba704c96cb Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Thu, 3 Mar 2022 18:59:36 -0500
Subject: [PATCH 13/19] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index c6dcb91..a8211a8 100644
--- a/README.md
+++ b/README.md
@@ -31,8 +31,8 @@ choco install pasteintofile

### Combination Key Usage
-* To create a file automatically (without a windows prompt), hold **CTRL** key while choosing **[Paste Into File]** in the context menu.
-* To create the file in a default sub folder under the current directory, hold **SHIFT** key while choosing **[Paste Into File]** in the context menu.
+* To create a file automatically (without a windows prompt), hold **SHIFT** key while choosing **[Paste Into File]** in the context menu.
+* To create the file in a default sub folder under the current directory, hold **CTRL** key while choosing **[Paste Into File]** in the context menu.
* Holding both keys (**CTRL+SHIFT**) while choosing **[Paste Into File]** will create the text file automatically in the default sub folder associated with the file type.
* The default sub folder for a text file is Text, and the default folder for an image file is Image.
* The default sub folders can be changed using command line options. See Configuration section for details.
From adf47e694a80558ba118c6d2198621b3c5a33848 Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Thu, 3 Mar 2022 19:01:43 -0500
Subject: [PATCH 14/19] Update AssemblyInfo.cs
---
PasteIntoFile/Properties/AssemblyInfo.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PasteIntoFile/Properties/AssemblyInfo.cs b/PasteIntoFile/Properties/AssemblyInfo.cs
index b6730da..797316a 100644
--- a/PasteIntoFile/Properties/AssemblyInfo.cs
+++ b/PasteIntoFile/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.6.0.2")]
-[assembly: AssemblyFileVersion("1.6.0.2")]
+[assembly: AssemblyVersion("1.6.1.0")]
+[assembly: AssemblyFileVersion("1.6.1.0")]
From 982e50a92c2c2f9619356c8b13b8853e240e6e78 Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Fri, 4 Mar 2022 14:21:51 -0500
Subject: [PATCH 15/19] Added option to have fully qualified path for sub
directories
Added option to have fully qualified path for sub directories.
This allows users to specify a specific directory to add all files to.
---
PasteIntoFile/frmMain.cs | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/PasteIntoFile/frmMain.cs b/PasteIntoFile/frmMain.cs
index 4f90a2d..0add625 100644
--- a/PasteIntoFile/frmMain.cs
+++ b/PasteIntoFile/frmMain.cs
@@ -17,8 +17,6 @@ namespace PasteAsFile
{
public partial class frmMain : Form
{
- public const string DEFAULT_TEXT_SUBFOLDER = "Text";
- public const string DEFAULT_IMAGE_SUBFOLDER = "Image";
public const string DEFAULT_FILENAME_FORMAT = "yyyy-MM-dd HH.mm.ss";
public string CurrentLocation { get; set; }
public bool IsText { get; set; }
@@ -33,11 +31,18 @@ public frmMain(string location)
}
private void frmMain_Load(object sender, EventArgs e)
{
- string TextSubDir = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\shell\Paste Into File\TextSubDir", "", null) ?? DEFAULT_TEXT_SUBFOLDER;
- string ImageSubDir = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\shell\Paste Into File\ImageSubDir", "", null) ?? DEFAULT_IMAGE_SUBFOLDER;
string filename = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\shell\Paste Into File\filename", "", null) ?? DEFAULT_FILENAME_FORMAT;
txtFilename.Text = DateTime.Now.ToString(filename);
- txtCurrentLocation.Text = CurrentLocation ?? @"C:\";
+ txtCurrentLocation.Text = CurrentLocation ?? @"C:\";
+ const string DEFAULT_TEXT_SUBFOLDER = "Text";
+ const string DEFAULT_IMAGE_SUBFOLDER = "Image";
+ string TextSubDir = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\shell\Paste Into File\TextSubDir", "", null) ?? DEFAULT_TEXT_SUBFOLDER;
+ string ImageSubDir = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\shell\Paste Into File\ImageSubDir", "", null) ?? DEFAULT_IMAGE_SUBFOLDER;
+ if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
+ {
+ string SubDir = (Clipboard.ContainsText()) ? TextSubDir : ImageSubDir;
+ txtCurrentLocation.Text = (SubDir.IndexOf(":") > 0) ? SubDir : txtCurrentLocation.Text + @"\" + SubDir;
+ }
if (Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Paste Into File\command", "", null) == null)
{
@@ -79,8 +84,6 @@ private void frmMain_Load(object sender, EventArgs e)
comExt.SelectedItem = "txt";
IsText = true;
txtContent.Text = Clipboard.GetText();
- if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
- txtCurrentLocation.Text = txtCurrentLocation.Text + @"\" + TextSubDir;
if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
Save_Action(0);
return;
@@ -98,8 +101,6 @@ private void frmMain_Load(object sender, EventArgs e)
});
comExt.SelectedItem = "png";
imgContent.Image = Clipboard.GetImage();
- if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
- txtCurrentLocation.Text = txtCurrentLocation.Text + @"\" + ImageSubDir;
if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
Save_Action(0);
return;
From cb338e0b992414661888b1d169d9ea8c9ecb5156 Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Fri, 4 Mar 2022 14:30:40 -0500
Subject: [PATCH 16/19] Update README.md
---
README.md | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/README.md b/README.md
index a8211a8..a354964 100644
--- a/README.md
+++ b/README.md
@@ -73,5 +73,13 @@ Run the following commands in a terminal (Command Prompt or PowerShell).
PasteIntoFile /ImageSubDir MyImgDir
```
+
+- To change the default path to a specific folder use a fully qualified path having a **drive** letter:
+ ```powershell
+ PasteIntoFile /ImageSubDir C:\MyProject\Screenshots
+ PasteIntoFile /TextSubDir C:\MyProject\SourceCode
+ ```
+
+
For more information on the format specifiers, see [Custom date and time format strings](https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings).
From 0bc08359edb1cdedad218c3c3952c1390c1e3b93 Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Fri, 4 Mar 2022 15:41:44 -0500
Subject: [PATCH 17/19] Change command line option names
Change command line option names for TextSubDir and ImageSubDir to TextDefaultDir and ImageDefaultDir.
Made this change because this option now supports both sub path and a full (FQN) path.
---
PasteIntoFile/Program.cs | 159 ++++++++++++---------------------------
PasteIntoFile/frmMain.cs | 10 +--
2 files changed, 55 insertions(+), 114 deletions(-)
diff --git a/PasteIntoFile/Program.cs b/PasteIntoFile/Program.cs
index e55cb42..3523d7a 100644
--- a/PasteIntoFile/Program.cs
+++ b/PasteIntoFile/Program.cs
@@ -20,39 +20,49 @@ static void Main(string[] args)
Application.SetCompatibleTextRenderingDefault(false);
if (args.Length>0)
{
- if (string.Equals(args[0], "/reg", StringComparison.CurrentCultureIgnoreCase))
+ try
{
- RegisterApp();
- return;
- }
- else if (string.Equals(args[0], "/unreg", StringComparison.CurrentCultureIgnoreCase))
- {
- UnRegisterApp();
- return;
- }
- else if (string.Equals(args[0], "/filename", StringComparison.CurrentCultureIgnoreCase))
- {
- if (args.Length > 1)
+ if (string.Equals(args[0], "/reg", StringComparison.CurrentCultureIgnoreCase))
{
- RegisterFilename(args[1]);
+ RegisterApp();
+ return;
}
- return;
- }
- else if (string.Equals(args[0], "/TextSubDir", StringComparison.CurrentCultureIgnoreCase))
- {
- if (args.Length > 1)
+ else if (string.Equals(args[0], "/unreg", StringComparison.CurrentCultureIgnoreCase))
{
- RegisterTextSubDir(args[1]);
+ UnRegisterApp();
+ return;
}
- return;
- }
- else if (string.Equals(args[0], "/ImageSubDir", StringComparison.CurrentCultureIgnoreCase))
+ else if (string.Equals(args[0], "/filename", StringComparison.CurrentCultureIgnoreCase) && args.Length > 1)
{
- if (args.Length > 1)
+ var key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey("Paste Into File");
+ key = key.CreateSubKey("filename");
+ key.SetValue("", args[1]);
+
+ MessageBox.Show("Filename has been registered with your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ return;
+ }
+ else if (string.Equals(args[0], "/TextDefaultDir", StringComparison.CurrentCultureIgnoreCase) && args.Length > 1)
{
- RegisterImageSubDir(args[1]);
+ var key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey("Paste Into File");
+ key = key.CreateSubKey("TextDefaultDir");
+ key.SetValue("", args[1]);
+
+ MessageBox.Show("TextDefaultDir has been registered with your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ return;
}
- return;
+ else if (string.Equals(args[0], "/ImageDefaultDir", StringComparison.CurrentCultureIgnoreCase) && args.Length > 1)
+ {
+ var key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey("Paste Into File");
+ key = key.CreateSubKey("ImageDefaultDir");
+ key.SetValue("", args[1]);
+
+ MessageBox.Show("ImageDefaultDir has been registered with your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ return;
+ }
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message + "\nPlease run the application as Administrator !", "Paste As File", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Application.Run(new frmMain(args[0]));
}
@@ -63,98 +73,29 @@ static void Main(string[] args)
}
- public static void ShowMessageToRunAsAdmin(Exception ex)
- {
- MessageBox.Show(ex.Message + "\nPlease run the application as Administrator !", "Paste As File", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
-
- public static void RegisterFilename(string filename)
- {
- try
- {
- var key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey("Paste Into File");
- key = key.CreateSubKey("filename");
- key.SetValue("", filename);
-
- MessageBox.Show("Filename has been registered with your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- catch (Exception ex)
- {
- ShowMessageToRunAsAdmin(ex);
- }
- }
-
- public static void RegisterTextSubDir(string TextSubDir)
- {
- try
- {
- var key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey("Paste Into File");
- key = key.CreateSubKey("TextSubDir");
- key.SetValue("", TextSubDir);
-
- MessageBox.Show("TextSubDir has been registered with your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- catch (Exception ex)
- {
- ShowMessageToRunAsAdmin(ex);
- }
- }
-
- public static void RegisterImageSubDir(string ImageSubDir)
- {
- try
- {
- var key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey("Paste Into File");
- key = key.CreateSubKey("ImageSubDir");
- key.SetValue("", ImageSubDir);
-
- MessageBox.Show("ImageSubDir has been registered with your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- catch (Exception ex)
- {
- ShowMessageToRunAsAdmin(ex);
- }
- }
-
public static void UnRegisterApp()
{
- try
- {
- var key = OpenDirectoryKey().OpenSubKey(@"Background\shell", true);
- key.DeleteSubKeyTree("Paste Into File");
-
- key = OpenDirectoryKey().OpenSubKey("shell", true);
- key.DeleteSubKeyTree("Paste Into File");
+ var key = OpenDirectoryKey().OpenSubKey(@"Background\shell", true);
+ key.DeleteSubKeyTree("Paste Into File");
- MessageBox.Show("Application has been Unregistered from your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ key = OpenDirectoryKey().OpenSubKey("shell", true);
+ key.DeleteSubKeyTree("Paste Into File");
- }
- catch (Exception ex)
- {
- ShowMessageToRunAsAdmin(ex);
- }
+ MessageBox.Show("Application has been Unregistered from your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
public static void RegisterApp()
{
- try
- {
- var key = OpenDirectoryKey().CreateSubKey(@"Background\shell").CreateSubKey("Paste Into File");
- key.SetValue("Icon", "\"" + Application.ExecutablePath + "\",0");
- key = key.CreateSubKey("command");
- key.SetValue("" , "\"" + Application.ExecutablePath + "\" \"%V\"");
-
- key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey("Paste Into File");
- key.SetValue("Icon", "\"" + Application.ExecutablePath + "\",0");
- key = key.CreateSubKey("command");
- key.SetValue("" , "\"" + Application.ExecutablePath + "\" \"%1\"");
- MessageBox.Show("Application has been registered with your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
-
- }
- catch (Exception ex)
- {
- ShowMessageToRunAsAdmin(ex);
- }
+ var key = OpenDirectoryKey().CreateSubKey(@"Background\shell").CreateSubKey("Paste Into File");
+ key.SetValue("Icon", "\"" + Application.ExecutablePath + "\",0");
+ key = key.CreateSubKey("command");
+ key.SetValue("", "\"" + Application.ExecutablePath + "\" \"%V\"");
+
+ key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey("Paste Into File");
+ key.SetValue("Icon", "\"" + Application.ExecutablePath + "\",0");
+ key = key.CreateSubKey("command");
+ key.SetValue("", "\"" + Application.ExecutablePath + "\" \"%1\"");
+ MessageBox.Show("Application has been registered with your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
public static void RestartApp()
diff --git a/PasteIntoFile/frmMain.cs b/PasteIntoFile/frmMain.cs
index 0add625..8a1927b 100644
--- a/PasteIntoFile/frmMain.cs
+++ b/PasteIntoFile/frmMain.cs
@@ -36,11 +36,11 @@ private void frmMain_Load(object sender, EventArgs e)
txtCurrentLocation.Text = CurrentLocation ?? @"C:\";
const string DEFAULT_TEXT_SUBFOLDER = "Text";
const string DEFAULT_IMAGE_SUBFOLDER = "Image";
- string TextSubDir = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\shell\Paste Into File\TextSubDir", "", null) ?? DEFAULT_TEXT_SUBFOLDER;
- string ImageSubDir = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\shell\Paste Into File\ImageSubDir", "", null) ?? DEFAULT_IMAGE_SUBFOLDER;
+ string TextDefaultDir = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\shell\Paste Into File\TextDefaultDir", "", null) ?? DEFAULT_TEXT_SUBFOLDER;
+ string ImageDefaultDir = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Directory\shell\Paste Into File\ImageDefaultDir", "", null) ?? DEFAULT_IMAGE_SUBFOLDER;
if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
{
- string SubDir = (Clipboard.ContainsText()) ? TextSubDir : ImageSubDir;
+ string SubDir = (Clipboard.ContainsText()) ? TextDefaultDir : ImageDefaultDir;
txtCurrentLocation.Text = (SubDir.IndexOf(":") > 0) ? SubDir : txtCurrentLocation.Text + @"\" + SubDir;
}
@@ -195,8 +195,8 @@ private void lblHelp_Click(object sender, EventArgs e)
msg += "To create a file automatically without a window prompt, hold shift key while selecting 'Paste Into File'\n";
msg += "To add a default sub folder to 'Current Location', hold ctrl key while selecting 'Paste Into File'. ";
msg += "The default sub folder for a text file is Text, and the default sub folder for an image file is Image.\n\n";
- msg += "To change the default Text Sub Folder, use argument:\n/TextSubDir MyDefaultTextFolder\n";
- msg += "To change the default Image Sub Folder, use argument:\n/ImageSubDir MyImgDir\n";
+ msg += "To change the default Text Sub Folder, use argument:\n/TextDefaultDir MyDefaultTextFolder\n";
+ msg += "To change the default Image Sub Folder, use argument:\n/ImageDefaultDir MyImgDir\n";
msg += "\n--------------------\nSend Feedback to : eslamx7@gmail.com\n\nThanks :)";
MessageBox.Show(msg, "Paste As File Help", MessageBoxButtons.OK, MessageBoxIcon.Information);
From 425c2285851b98deb2077c582bd0dc009d308898 Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Fri, 4 Mar 2022 15:42:58 -0500
Subject: [PATCH 18/19] Update README.md
---
README.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index a354964..4feb639 100644
--- a/README.md
+++ b/README.md
@@ -63,21 +63,21 @@ Run the following commands in a terminal (Command Prompt or PowerShell).
- To change the default **Text** Sub Folder:
```powershell
- PasteIntoFile /TextSubDir MyDefaultTextFolder
+ PasteIntoFile /TextDefaultDir MyDefaultTextFolder
```
- To change the default **Image** Sub Folder:
```powershell
- PasteIntoFile /ImageSubDir MyImgDir
+ PasteIntoFile /ImageDefaultDir MyImgDir
```
- To change the default path to a specific folder use a fully qualified path having a **drive** letter:
```powershell
- PasteIntoFile /ImageSubDir C:\MyProject\Screenshots
- PasteIntoFile /TextSubDir C:\MyProject\SourceCode
+ PasteIntoFile /ImageDefaultDir C:\MyProject\Screenshots
+ PasteIntoFile /TextDefaultDir C:\MyProject\SourceCode
```
From 06c23ee951941b43a8ec359a6773e3a012aeb646 Mon Sep 17 00:00:00 2001
From: David Maisonave <47364845+David-Maisonave@users.noreply.github.com>
Date: Fri, 4 Mar 2022 15:45:40 -0500
Subject: [PATCH 19/19] Update AssemblyInfo.cs
---
PasteIntoFile/Properties/AssemblyInfo.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PasteIntoFile/Properties/AssemblyInfo.cs b/PasteIntoFile/Properties/AssemblyInfo.cs
index 797316a..d9b9459 100644
--- a/PasteIntoFile/Properties/AssemblyInfo.cs
+++ b/PasteIntoFile/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.6.1.0")]
-[assembly: AssemblyFileVersion("1.6.1.0")]
+[assembly: AssemblyVersion("1.6.2.0")]
+[assembly: AssemblyFileVersion("1.6.2.0")]