-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLanguageCloudConfig.cs
38 lines (33 loc) · 1.35 KB
/
LanguageCloudConfig.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.IO;
namespace Switch_Trados_Studios_Environment
{
internal class LanguageCloudConfig
{
private static string _machineUserPath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
InstalledBuilds installedBuilds = new InstalledBuilds();
DirectoryInfo appdataDirectory = new DirectoryInfo($@"{_machineUserPath}\AppData\Roaming\");
public void DeleteLanguageCloudConfig(int studioBuildType)
{
string buildType;
if (installedBuilds.nrOfInstalledBuilds > studioBuildType)
{
buildType = installedBuilds.studioBuildTypeDictionary[studioBuildType];
}
else
{
buildType = "Studio17";
}
string languageCloudMachineTranslationLocation = buildType.Contains("17") ? "Trados\\Trados Studio" : "SDL\\SDL Trados Studio";
if (Directory.Exists($@"{appdataDirectory}{languageCloudMachineTranslationLocation}"))
{
try
{
FileInfo fileInfo = new FileInfo($@"{appdataDirectory}{languageCloudMachineTranslationLocation}\{buildType}\{Constants.LanguageCloudMachineTranslation}");
fileInfo.Delete();
}
catch (Exception ex) { };
}
}
}
}