Skip to content

Commit 0572ff8

Browse files
committed
Settings V2 added
1 parent 8a4c440 commit 0572ff8

4 files changed

Lines changed: 21 additions & 32 deletions

File tree

‎Source/NETworkManager/Models/Settings/CredentialManager.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace NETworkManager.Models.Settings
1818
public static class CredentialManager
1919
{
2020
public const string CredentialsFileName = "Credentials";
21+
public const string CredentialsVersion = "V2";
2122
public const string CredentialsExtension = "xml";
2223

2324
// Collection with ID, Name, Username, Password
@@ -47,7 +48,7 @@ public static bool VerifyMasterPasword(SecureString password)
4748

4849
public static string GetCredentialsFileName()
4950
{
50-
return $"{CredentialsFileName}.{CredentialsExtension}";
51+
return $"{CredentialsFileName}.{CredentialsVersion}.{CredentialsExtension}";
5152
}
5253

5354
public static string GetCredentialsFilePath()

‎Source/NETworkManager/Models/Settings/ProfileManager.cs‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,23 @@ namespace NETworkManager.Models.Settings
1515
{
1616
public static class ProfileManager
1717
{
18-
public const string ProfilesFileName = "Profiles.xml";
18+
public const string ProfilesFileName = "Profiles";
19+
public const string ProfilesVersion = "V2";
20+
public const string ProfilesFileExtension = "xml";
1921

2022
public const string TagIdentifier = "tag=";
2123

2224
public static ObservableCollection<ProfileInfo> Profiles { get; set; }
2325
public static bool ProfilesChanged { get; set; }
2426

27+
public static string GetProfilesFileName()
28+
{
29+
return $"{ProfilesFileName}.{ProfilesVersion}.{ProfilesFileExtension}";
30+
}
31+
2532
public static string GetProfilesFilePath()
2633
{
27-
return Path.Combine(SettingsManager.GetSettingsLocation(), ProfilesFileName);
34+
return Path.Combine(SettingsManager.GetSettingsLocation(), GetProfilesFileName());
2835
}
2936

3037
public static List<string> GetGroups()

‎Source/NETworkManager/Models/Settings/SettingsManager.cs‎

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Collections.ObjectModel;
32
using System.IO;
43
using System.Linq;
54
using System.Reflection;
@@ -10,9 +9,10 @@
109
namespace NETworkManager.Models.Settings
1110
{
1211
public static class SettingsManager
13-
{
12+
{
1413
private const string SettingsFolderName = "Settings";
1514
private const string SettingsFileName = "Settings";
15+
private const string SettingsVersion = "V2";
1616
private const string SettingsFileExtension = "xml";
1717
private const string IsPortableFileName = "IsPortable";
1818
private const string IsPortableExtension = "settings";
@@ -34,7 +34,7 @@ private static string GetApplicationLocation()
3434

3535
public static string GetSettingsFileName()
3636
{
37-
return $"{SettingsFileName}.{SettingsFileExtension}";
37+
return $"{SettingsFileName}.{SettingsVersion}.{SettingsFileExtension}";
3838
}
3939

4040
public static string GetIsPortableFileName()
@@ -209,29 +209,10 @@ public static void Update(Version assemblyVersion, Version settingsVersion)
209209
{
210210
var reorderApplications = false;
211211

212-
// Features added in 1.8.0.0
213-
if (settingsVersion < new Version("1.8.0.0"))
212+
// Features added in 2.0.0.0
213+
if (settingsVersion < new Version("2.0.0.0"))
214214
{
215-
Current.General_ApplicationList.Add(new ApplicationViewInfo(ApplicationViewManager.Name.TigerVNC));
216-
Current.General_ApplicationList.Add(new ApplicationViewInfo(ApplicationViewManager.Name.Whois));
217215

218-
reorderApplications = true;
219-
}
220-
221-
// Features added in 1.9.0.0
222-
if (settingsVersion < new Version("1.9.0.0"))
223-
{
224-
Current.General_ApplicationList.Add(new ApplicationViewInfo(ApplicationViewManager.Name.PowerShell));
225-
226-
reorderApplications = true;
227-
}
228-
229-
// Features added in 1.10.0.0
230-
if (settingsVersion < new Version("1.10.0.0"))
231-
{
232-
Current.General_ApplicationList.Add(new ApplicationViewInfo(ApplicationViewManager.Name.Dashboard));
233-
234-
reorderApplications = true;
235216
}
236217

237218
// Reorder application view

‎Source/NETworkManager/NETworkManager.csproj‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1717
<TargetFrameworkProfile />
1818
<IsWebBootstrapper>false</IsWebBootstrapper>
19+
<NuGetPackageImportStamp>
20+
</NuGetPackageImportStamp>
1921
<PublishUrl>publish\</PublishUrl>
2022
<Install>true</Install>
2123
<InstallFrom>Disk</InstallFrom>
@@ -30,8 +32,6 @@
3032
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
3133
<UseApplicationTrust>false</UseApplicationTrust>
3234
<BootstrapperEnabled>true</BootstrapperEnabled>
33-
<NuGetPackageImportStamp>
34-
</NuGetPackageImportStamp>
3535
</PropertyGroup>
3636
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
3737
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -1379,10 +1379,10 @@
13791379
<Version>0.0.3.203</Version>
13801380
</PackageReference>
13811381
<PackageReference Include="IPNetwork2">
1382-
<Version>2.4.0.126</Version>
1382+
<Version>2.4.0.147</Version>
13831383
</PackageReference>
13841384
<PackageReference Include="Lextm.SharpSnmpLib">
1385-
<Version>11.2.0</Version>
1385+
<Version>11.3.0</Version>
13861386
</PackageReference>
13871387
<PackageReference Include="LiveCharts.Wpf">
13881388
<Version>0.9.7</Version>
@@ -1403,7 +1403,7 @@
14031403
<Version>12.0.2</Version>
14041404
</PackageReference>
14051405
<PackageReference Include="Octokit">
1406-
<Version>0.32.0</Version>
1406+
<Version>0.34.0</Version>
14071407
</PackageReference>
14081408
</ItemGroup>
14091409
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

0 commit comments

Comments
 (0)