mirror of
https://github.com/DaKerboul/perun.git
synced 2026-08-09 17:05:39 +02:00
v0.4.0 major code cleanup
This commit is contained in:
26
02_Windows_App/Perun_v1/01_Classes/PerunHelper.cs
Normal file
26
02_Windows_App/Perun_v1/01_Classes/PerunHelper.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
// This class gathers all helper functions
|
||||
using System;
|
||||
|
||||
internal class PerunHelper
|
||||
{
|
||||
public static void LogHistoryAdd(ref string[] arrLogHistory, string strEntryToAdd)
|
||||
{
|
||||
// Add entry to log history and rotate
|
||||
for (int i = 0; i < arrLogHistory.Length - 1; i++)
|
||||
{
|
||||
arrLogHistory[i] = arrLogHistory[i + 1]; // Shift one down
|
||||
}
|
||||
|
||||
arrLogHistory[arrLogHistory.Length - 1] = DateTime.Now.ToString("HH:mm:ss") + " > " + strEntryToAdd; // Add entry at the last position
|
||||
}
|
||||
public static string GetAppVersion(string strBeginning)
|
||||
{
|
||||
// Gets build version
|
||||
if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
|
||||
{
|
||||
System.Deployment.Application.ApplicationDeployment cd = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
|
||||
Globals.strPerunVersion = cd.CurrentVersion.ToString();
|
||||
}
|
||||
return strBeginning+"v" + Globals.strPerunVersion;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user