mirror of
https://github.com/DaKerboul/perun.git
synced 2026-08-09 20:15:39 +02:00
Code clean-up
This commit is contained in:
@@ -6,14 +6,19 @@ internal class PerunHelper
|
|||||||
{
|
{
|
||||||
public static void LogHistoryAdd(ref string[] arrLogHistory, string strEntryToAdd)
|
public static void LogHistoryAdd(ref string[] arrLogHistory, string strEntryToAdd)
|
||||||
{
|
{
|
||||||
// Add entry to log history and rotate
|
// Rotate log history
|
||||||
for (int i = 0; i < arrLogHistory.Length - 1; i++)
|
for (int i = 0; i < arrLogHistory.Length - 1; i++)
|
||||||
{
|
{
|
||||||
arrLogHistory[i] = arrLogHistory[i + 1]; // Shift one down
|
arrLogHistory[i] = arrLogHistory[i + 1]; // Shift one down
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add new entry
|
||||||
arrLogHistory[arrLogHistory.Length - 1] = DateTime.Now.ToString("yyyy-dd-MM HH:mm:ss") + " > " + strEntryToAdd; // Add entry at the last position
|
arrLogHistory[arrLogHistory.Length - 1] = DateTime.Now.ToString("yyyy-dd-MM HH:mm:ss") + " > " + strEntryToAdd; // Add entry at the last position
|
||||||
|
|
||||||
|
// Add the entry to log file
|
||||||
LogController.WriteLog(arrLogHistory[arrLogHistory.Length - 1]);
|
LogController.WriteLog(arrLogHistory[arrLogHistory.Length - 1]);
|
||||||
|
|
||||||
|
// Update control at my window
|
||||||
Globals.bLogHistoryUpdate = true;
|
Globals.bLogHistoryUpdate = true;
|
||||||
}
|
}
|
||||||
public static string GetAppVersion(string strBeginning)
|
public static string GetAppVersion(string strBeginning)
|
||||||
@@ -21,11 +26,13 @@ internal class PerunHelper
|
|||||||
// Gets build version
|
// Gets build version
|
||||||
if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
|
if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
|
||||||
{
|
{
|
||||||
|
// For network deployed
|
||||||
System.Deployment.Application.ApplicationDeployment cd = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
|
System.Deployment.Application.ApplicationDeployment cd = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
|
||||||
Globals.strPerunVersion = cd.CurrentVersion.ToString();
|
Globals.strPerunVersion = cd.CurrentVersion.ToString();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// For other cases
|
||||||
Globals.strPerunVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
Globals.strPerunVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||||
}
|
}
|
||||||
return strBeginning+"v" + Globals.strPerunVersion;
|
return strBeginning+"v" + Globals.strPerunVersion;
|
||||||
|
|||||||
Reference in New Issue
Block a user