Skip to content

Commit b7f68af

Browse files
2.2.0.8 - New macro tags for getting the name of the currently logged in user and the name of the machine being used
1 parent 84cf23c commit b7f68af

File tree

7 files changed

+20
-12
lines changed

7 files changed

+20
-12
lines changed

FormMain.Designer.cs

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

Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("2.2.0.7")]
36-
[assembly: AssemblyFileVersion("2.2.0.7")]
35+
[assembly: AssemblyVersion("2.2.0.8")]
36+
[assembly: AssemblyFileVersion("2.2.0.8")]
3737
[assembly: NeutralResourcesLanguageAttribute("en-CA")]

app.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<assemblyIdentity
44
type="win32"
55
name="GavinKendall.AutoScreenCapture"
6-
version="2.2.0.7"/>
6+
version="2.2.0.8"/>
77
<asmv3:application>
88
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
99
<dpiAware>True/PM</dpiAware>

macro/MacroParser.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
//-----------------------------------------------------------------------
88
namespace AutoScreenCapture
99
{
10+
using System;
11+
1012
/// <summary>
1113
///
1214
/// </summary>
@@ -93,6 +95,8 @@ public static string ParseTags(string name, string macro, ImageFormat format)
9395
macro = macro.Replace(MacroTagSpec.Second, screenCapture.DateTimePreviousCycle.ToString(SecondFormat));
9496
macro = macro.Replace(MacroTagSpec.Millisecond, screenCapture.DateTimePreviousCycle.ToString(MillisecondFormat));
9597
macro = macro.Replace(MacroTagSpec.Count, screenCapture.Count.ToString());
98+
macro = macro.Replace(MacroTagSpec.User, Environment.UserName);
99+
macro = macro.Replace(MacroTagSpec.Machine, Environment.MachineName);
96100

97101
return macro;
98102
}

macro/MacroTagCollection.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public MacroTagCollection()
3838
Add(new MacroTag(MacroTagSpec.Second, "Second of " + DateTime.Now.ToString(MacroParser.TimeFormat) + " (" + DateTime.Now.ToString(MacroParser.SecondFormat) + ")"));
3939
Add(new MacroTag(MacroTagSpec.Millisecond, "Millisecond of " + DateTime.Now.ToString(MacroParser.TimeFormat) + " (" + DateTime.Now.ToString(MacroParser.MillisecondFormat) + ")"));
4040
Add(new MacroTag(MacroTagSpec.Count, "Number of screen capture cycles during the current screen capture session"));
41+
Add(new MacroTag(MacroTagSpec.User, "Name of logged in user (" + Environment.UserName + ")"));
42+
Add(new MacroTag(MacroTagSpec.Machine, "Name of machine being used (" + Environment.MachineName + ")"));
4143
}
4244

4345
/// <summary>

macro/MacroTagSpec.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@ public static class MacroTagSpec
2121
public static readonly string Second = "%second%";
2222
public static readonly string Millisecond = "%millisecond%";
2323
public static readonly string Count = "%count%";
24+
public static readonly string User = "%user%";
25+
public static readonly string Machine = "%machine%";
2426
}
2527
}

settings/Settings.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace AutoScreenCapture
1313
public static class Settings
1414
{
1515
public static readonly string ApplicationName = "Auto Screen Capture";
16-
public static readonly string ApplicationVersion = "2.2.0.7";
16+
public static readonly string ApplicationVersion = "2.2.0.8";
1717
public static readonly string ApplicationCodename = "Dalek";
1818

1919
public static SettingCollection Application;
@@ -29,15 +29,9 @@ public static void Initialize()
2929
// This version.
3030
_versionCollection.Add(new Version(ApplicationCodename, ApplicationVersion, isCurrentVersion: true));
3131

32-
// Older versions should be listed here.
32+
// Older versions should be listed here only if you need to check for a specific version
33+
// in order to upgrade a particular area of the application.
3334
_versionCollection.Add(new Version("Clara", "2.1.8.2"));
34-
_versionCollection.Add(new Version("Dalek", "2.2.0.0"));
35-
_versionCollection.Add(new Version("Dalek", "2.2.0.1"));
36-
_versionCollection.Add(new Version("Dalek", "2.2.0.2"));
37-
_versionCollection.Add(new Version("Dalek", "2.2.0.3"));
38-
_versionCollection.Add(new Version("Dalek", "2.2.0.4"));
39-
_versionCollection.Add(new Version("Dalek", "2.2.0.5"));
40-
_versionCollection.Add(new Version("Dalek", "2.2.0.6"));
4135

4236
Application = new SettingCollection();
4337
Application.Filepath = FileSystem.SettingsFolder + FileSystem.ApplicationSettingsFile;
@@ -58,6 +52,11 @@ public static void Initialize()
5852
if (File.Exists(Application.Filepath))
5953
{
6054
Application.Load();
55+
56+
Application.GetByKey("Name", defaultValue: Settings.ApplicationName).Value = ApplicationName;
57+
Application.GetByKey("Version", defaultValue: Settings.ApplicationVersion).Value = ApplicationVersion;
58+
59+
Application.Save();
6160
}
6261
else
6362
{

0 commit comments

Comments
 (0)