aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/SystemInformationModel.cs
blob: 5dde7374480d83a60425fdf78e404cce6f260bd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;

namespace Tango.MachineStudio.UI.TFS
{
    public class SystemInformationModel
    {
        public String ApplicationVersion { get; set; }
        public String EmbeddedVersion { get; set; }
        public String UserName { get; set; }
        public String HostName { get; set; }
        public Machine Machine { get; set; }
        public String ConfigurationString { get; set; }
        public String LoadedHardwareConfigurationString { get; set; }
        public String LoadedProcessParametersString { get; set; }
    }
}
an>.GetFullPath(@"..\..\Resources\" + fileName); } /// <summary> /// Gets the PMR (Protobuf Messages Repository) path. /// </summary> /// <returns></returns> public static String GetPMRPath() { return Path.GetFullPath(@"..\..\..\PMR\Messages\"); } /// <summary> /// Gets the SQLite database file path in DB folder. /// </summary> /// <returns></returns> public static String GetSQLiteFilePath() { return Path.GetFullPath(@"..\..\..\DB\Tango.db"); } /// <summary> /// Initializes the logging manager. /// </summary> public static ConsoleLogger InitializeLogging(bool useConsole = false, [CallerMemberName] string testName = null) { LogManager.Default.RegisterLogger(new FileLogger(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango", "logs", "Unit Testing", testName + ".txt"))); if (useConsole) { var consoleLogger = new ConsoleLogger(testName); LogManager.Default.RegisterLogger(consoleLogger); return consoleLogger; } return null; } /// <summary> /// Creates a temporary folder and returns it's path. /// </summary> /// <returns></returns> public static String GetTempFolderPathAppend(String customFolder, [CallerMemberName] string testName = null) { String tempDirectory = Path.Combine(Path.GetTempPath(), "Twine", "Unit Testing", testName, customFolder); Directory.CreateDirectory(tempDirectory); return tempDirectory; } /// <summary> /// Creates a temporary folder and returns it's path. /// </summary> /// <returns></returns> public static String GetTempFolderPath([CallerMemberName] string testName = null) { String tempDirectory = Path.Combine(Path.GetTempPath(), "Twine", "Unit Testing", testName, Path.GetRandomFileName()); Directory.CreateDirectory(tempDirectory); return tempDirectory; } /// <summary> /// Tries to delete folder. /// </summary> /// <param name="path">The path.</param> /// <returns></returns> public static bool TryDeleteFolder(String path) { try { Directory.Delete(path, true); return true; } catch { return false; } } /// <summary> /// Shows the file in explorer. /// </summary> /// <param name="path">Name of the file/folder.</param> public static void ShowInExplorer(String path) { Process.Start("explorer.exe", string.Format("/select,\"{0}\"", path)); } } }