Skip to content

Commit 0ef886d

Browse files
committed
2.4.1.9 - New macro tag "%capturenow%". Changelog and Help documentation updated. Code cleanup.
1 parent 4bcc998 commit 0ef886d

23 files changed

+250
-222
lines changed

DataConvert.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace AutoScreenCapture
2828
public class DataConvert
2929
{
3030
/// <summary>
31-
///
31+
/// Constructor
3232
/// </summary>
3333
public DataConvert()
3434
{

Gavin.Kendall.SFTP/SftpClient.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,22 @@ public class SftpClient
3030
{
3131
private Renci.SshNet.SftpClient _sftpClient;
3232

33+
/// <summary>
34+
/// An SFTP client to handle SFTP operations.
35+
/// </summary>
36+
/// <param name="host">The host.</param>
37+
/// <param name="port">The port number.</param>
38+
/// <param name="username">The username to use to connect to the host.</param>
39+
/// <param name="password">The password to use to connect to the host.</param>
3340
public SftpClient(string host, int port, string username, string password)
3441
{
3542
_sftpClient = new Renci.SshNet.SftpClient(host, port, username, password);
3643
}
3744

45+
/// <summary>
46+
/// Connects to the host.
47+
/// </summary>
48+
/// <returns>Returns true if connection was successful or false if connection was not successful.</returns>
3849
public bool Connect()
3950
{
4051
try

ScreenCapture.cs

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ public enum ScreenSavingErrorLevels
8383
/// </summary>
8484
public class ScreenCapture
8585
{
86-
private Log _log;
87-
private Config _config;
88-
private FileSystem _fileSystem;
86+
private readonly Log _log;
87+
private readonly Config _config;
88+
private readonly FileSystem _fileSystem;
8989

9090
[StructLayout(LayoutKind.Sequential)]
9191
private struct CURSORINFO
@@ -200,37 +200,37 @@ private struct DEVMODE
200200
private const int CCHDEVICENAME = 0x20;
201201
private const int CCHFORMNAME = 0x20;
202202
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x20)]
203-
private string dmDeviceName;
204-
private short dmSpecVersion;
205-
private short dmDriverVersion;
203+
private readonly string dmDeviceName;
204+
private readonly short dmSpecVersion;
205+
private readonly short dmDriverVersion;
206206
internal short dmSize;
207-
private short dmDriverExtra;
208-
private int dmFields;
209-
private int dmPositionX;
210-
private int dmPositionY;
211-
private ScreenOrientation dmDisplayOrientation;
212-
private int dmDisplayFixedOutput;
213-
private short dmColor;
214-
private short dmDuplex;
215-
private short dmYResolution;
216-
private short dmTTOption;
217-
private short dmCollate;
207+
private readonly short dmDriverExtra;
208+
private readonly int dmFields;
209+
private readonly int dmPositionX;
210+
private readonly int dmPositionY;
211+
private readonly ScreenOrientation dmDisplayOrientation;
212+
private readonly int dmDisplayFixedOutput;
213+
private readonly short dmColor;
214+
private readonly short dmDuplex;
215+
private readonly short dmYResolution;
216+
private readonly short dmTTOption;
217+
private readonly short dmCollate;
218218
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x20)]
219-
private string dmFormName;
220-
private short dmLogPixels;
221-
private int dmBitsPerPel;
222-
internal int dmPelsWidth;
223-
internal int dmPelsHeight;
224-
private int dmDisplayFlags;
225-
private int dmDisplayFrequency;
226-
private int dmICMMethod;
227-
private int dmICMIntent;
228-
private int dmMediaType;
229-
private int dmDitherType;
230-
private int dmReserved1;
231-
private int dmReserved2;
232-
private int dmPanningWidth;
233-
private int dmPanningHeight;
219+
private readonly string dmFormName;
220+
private readonly short dmLogPixels;
221+
private readonly int dmBitsPerPel;
222+
internal readonly int dmPelsWidth;
223+
internal readonly int dmPelsHeight;
224+
private readonly int dmDisplayFlags;
225+
private readonly int dmDisplayFrequency;
226+
private readonly int dmICMMethod;
227+
private readonly int dmICMIntent;
228+
private readonly int dmMediaType;
229+
private readonly int dmDitherType;
230+
private readonly int dmReserved1;
231+
private readonly int dmReserved2;
232+
private readonly int dmPanningWidth;
233+
private readonly int dmPanningHeight;
234234
}
235235

236236
private DEVMODE _dm;
@@ -281,7 +281,7 @@ public struct DeviceOptions
281281
public static string ImageFormat;
282282

283283
/// <summary>
284-
///
284+
/// Default maximum characters allowd for active window title.
285285
/// </summary>
286286
private const int MAX_CHARS = 48000;
287287

@@ -315,6 +315,11 @@ public struct DeviceOptions
315315
/// </summary>
316316
public int Count { get; set; }
317317

318+
/// <summary>
319+
/// The numer of times the user did a "Capture Now".
320+
/// </summary>
321+
public int CountNow { get; set; }
322+
318323
/// <summary>
319324
/// Determines if the screen capture session is locked.
320325
/// </summary>

changelog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Auto Screen Capture by Gavin Kendall
22

33

4-
2.4.1.9 Screenshots count is reset when screenshots limit is reached to avoid falling into an infinite loop. New trigger actions Restart Screen Capture, Delete Screenshots By Cycle Count, and Delete Screenshots From Oldest Capture Cycle. New command "-restart".
4+
2.4.1.9 Screenshots count is reset when screenshots limit is reached to avoid falling into an infinite loop. New trigger actions Restart Screen Capture, Delete Screenshots By Cycle Count, and Delete Screenshots From Oldest Capture Cycle. New command "-restart". New macro tag "%capturenow%".
55
2.4.1.8 Delete Screenshots trigger uses ScreenshotsFolder instead of DefaultScreenshotsFolder. Sending a test email from Email Settings logs any exception error and the Send Test Email button is enabled again after an exception has been caught. Email Settings form accepts multiple email addresses in TO, CC, and BCC fields using either ; or , as a separator.
66
2.4.1.7 Hash included in Screenshot Metadata. Additional debug logging has been included in the screen capture methods.
77
2.4.1.6 $AppDataLocal$ and $AppDataRoaming$ introduced for autoscreen.conf and autoscreen.conf included as part of installation so that an installation of the application can run under normal user privileges without needing to run autoscreen.exe as Administrator from "C:\Program Files" or "C:\Program Files (x86)" since the data files are being written to the user's local or roaming app data folder (AppData\Local by default).

help/help-2.rtf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7699,7 +7699,7 @@ ad7bbdad7bbda57bbda57bbda57b000000040000002701ffff030000000000
76997699
I love the Blade movies and I don't care what anyone says but the music in the "Bloodbath" nightclub scene of the first movie is still cool.\par
77007700
The biggest feature implemented in 2.4 was the ability to encrypt and decrypt screenshots. The interface was cleaned up and more user-friendly notes were included. This version introduces the "Auto Adapt" feature for screens so that the position and size of each screen is automatically adjusted based on changes made to the display setup.\par
77017701
Here's every change in the 2.4 "Blade" series (starting with the most recent change):\par
7702-
\cf1\f1\fs19\lang1033 2.4.1.9 Screenshots count is reset when screenshots limit is reached to avoid falling into an infinite loop. New trigger actions Restart Screen Capture, \f2 Delete Screenshots By Cycle Count, and Delete Screenshots From Oldest Capture Cycle\f1 . New command "-restart".\par
7702+
\cf1\f1\fs19\lang1033 2.4.1.9 Screenshots count is reset when screenshots limit is reached to avoid falling into an infinite loop. New trigger actions Restart Screen Capture, \f2 Delete Screenshots By Cycle Count, and Delete Screenshots From Oldest Capture Cycle\f1 . New command "-restart". \f2 New macro tag "%capturenow%".\f1\par
77037703
2.4.1.8 \f2 Delete Screenshots trigger uses ScreenshotsFolder instead of DefaultScreenshotsFolder. Sending a test email from Email Settings logs any exception error and the Send Test Email button is enabled again after an exception has been caught. Email Settings form accepts multiple email addresses in TO, CC, and BCC fields using either ; or , as a separator.\f1\par
77047704
2.4.1.7 \f2 Hash included in Screenshot Metadata. Additional debug logging has been included in the screen capture methods.\f1\lang9\par
77057705
2.4.1.6 $AppDataLocal$ and $AppDataRoaming$ introduced for autoscreen.conf and autoscreen.conf included as part \lang1033 of \f2\lang9 installation so that an installation of the application can run under normal user privileges without needing to run autoscreen.exe as Administrator from "C:\\Program Files" or "C:\\Program Files (x86)" since the data files are being written to the user's local or roaming app data folder\f1\lang1033 (AppData\\Local by default)\f2\lang9 .\par

interface/macro_tag/FormMacroTag.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ private void FormMacroTag_Load(object sender, EventArgs e)
7979
comboBoxType.Items.Add("Height");
8080
comboBoxType.Items.Add("Process Name");
8181
comboBoxType.Items.Add("Label");
82+
comboBoxType.Items.Add("Capture Now Count");
8283

8384
if (MacroTagObject != null)
8485
{

interface/main/FormMain-ScreenCapture.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ private void TakeScreenshot(bool captureNow)
120120
_screenCapture.Count++;
121121
_screenCapture.CaptureNow = captureNow;
122122

123+
// Keep a count of how many times the user has used "Capture Now" so we can include it in a Macro Tag.
124+
if (captureNow)
125+
{
126+
_screenCapture.CountNow++;
127+
}
128+
123129
DateTime dtNow = DateTime.Now;
124130

125131
_screenCapture.DateTimeScreenshotsTaken = dtNow;

interface/region_select/FormRegionSelectOptions.Designer.cs

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

interface/region_select/FormRegionSelectOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private void FormRegionSelectOptions_Load(object sender, EventArgs e)
5555
private void LoadOptions()
5656
{
5757
textBoxAutoSaveFolder.Text = _config.Settings.User.GetByKey("AutoSaveFolder", _config.Settings.DefaultSettings.AutoSaveFolder).Value.ToString();
58-
textBoxAutoSaveMacro.Text = _config.Settings.User.GetByKey("AutoSaveMacro", _config.Settings.DefaultSettings.AutoSaveMacro).Value.ToString();
58+
textBoxAutoSaveFile.Text = _config.Settings.User.GetByKey("AutoSaveMacro", _config.Settings.DefaultSettings.AutoSaveMacro).Value.ToString();
5959

6060
comboBoxFormat.Items.Clear();
6161

@@ -70,7 +70,7 @@ private void LoadOptions()
7070
private void SaveOptions()
7171
{
7272
_config.Settings.User.GetByKey("AutoSaveFolder", _config.Settings.DefaultSettings.AutoSaveFolder).Value = textBoxAutoSaveFolder.Text.Trim();
73-
_config.Settings.User.GetByKey("AutoSaveMacro", _config.Settings.DefaultSettings.AutoSaveMacro).Value = textBoxAutoSaveMacro.Text.Trim();
73+
_config.Settings.User.GetByKey("AutoSaveMacro", _config.Settings.DefaultSettings.AutoSaveMacro).Value = textBoxAutoSaveFile.Text.Trim();
7474
_config.Settings.User.GetByKey("AutoSaveFormat", _config.Settings.DefaultSettings.AutoSaveFormat).Value = comboBoxFormat.Text;
7575

7676
_config.Settings.User.Save(_config.Settings, _fileSystem);

interface/screenshot_metadata/FormScreenshotMetadata.Designer.cs

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)