Serialize converters were added

This commit is contained in:
Evgeny Redikultsev
2024-09-08 17:47:46 +05:00
parent 408e9f6999
commit 6e0b7b8070
60 changed files with 1713 additions and 443 deletions

View File

@@ -3,7 +3,9 @@ using StructureHelperCommon.Models.Codes;
using StructureHelperCommon.Models.Codes.Factories;
using StructureHelperCommon.Models.Materials;
using StructureHelperCommon.Models.Materials.Libraries;
using StructureHelperCommon.Models.Projects;
using System.Collections.Generic;
using System.ComponentModel.Design.Serialization;
using System.Linq;
using System.Windows.Documents;
using System.Windows.Navigation;
@@ -55,7 +57,15 @@ namespace StructureHelperCommon.Infrastructures.Settings
return materialRepository;
}
}
public static List<IProject> Projects { get; } = new();
public static IProject CurrentProject
{
get
{
if (Projects.Any()) { return Projects[0]; }
return null;
}
}
public static List<IMaterialLogic> MaterialLogics
{
get
@@ -64,5 +74,21 @@ namespace StructureHelperCommon.Infrastructures.Settings
return materialLogics;
}
}
public static void SetCurrentProjectToNotActual()
{
if (CurrentProject is null)
{
return;
}
CurrentProject.IsActual = false;
}
public static IFileVersion GetCurrentFileVersion()
{
return new FileVersion()
{
VersionNumber = 1,
SubVersionNumber = 0
};
}
}
}