From 713dc51b4d500eff7337fb2651cd28ae22479ccd Mon Sep 17 00:00:00 2001 From: Egor Deev Date: Fri, 2 Oct 2026 23:45:35 +0000 Subject: [PATCH] =?UTF-8?q?Revert=20"=D0=A1=D0=B2=D0=BE=D1=8F=20ReadWrite?= =?UTF-8?q?=20=D0=B2=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20=D0=B2=D1=83=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D1=81=D0=BA=D0=BE=D0=B9=20=D0=B1=D0=B8=D0=B1=D0=BB?= =?UTF-8?q?=D0=B8=D0=BE=D1=82=D0=B5=D0=BA=D0=B8=20RSREU.IO"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d937da139fb8c5729d896a83d639a5b397f12dbf. --- InvestWinApp/InvestWinApp.vcxproj | 3 +++ InvestWinApp/config.h | 33 ++----------------------------- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/InvestWinApp/InvestWinApp.vcxproj b/InvestWinApp/InvestWinApp.vcxproj index d9efdb3..28662e5 100644 --- a/InvestWinApp/InvestWinApp.vcxproj +++ b/InvestWinApp/InvestWinApp.vcxproj @@ -155,6 +155,9 @@ + + x64\Debug\RSREU.IO.dll + diff --git a/InvestWinApp/config.h b/InvestWinApp/config.h index 4476b84..79bb7e9 100644 --- a/InvestWinApp/config.h +++ b/InvestWinApp/config.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include #include @@ -10,41 +10,12 @@ #include #include +using namespace RSREU::IO; using namespace System; using namespace System::Windows::Forms; using namespace System::Collections::Generic; -// Сохранение и загрузка списка в файл (двоичная сериализация .NET). -// Раньше бралось из вузовской библиотеки RSREU.IO, которой нет в репозитории. -ref class ReadWrite abstract sealed { -public: - template - static T Load(String^ path) { - if (!System::IO::File::Exists(path)) return nullptr; - System::IO::FileStream^ fs = System::IO::File::OpenRead(path); - try { - auto formatter = gcnew System::Runtime::Serialization::Formatters::Binary::BinaryFormatter(); - return safe_cast(formatter->Deserialize(fs)); - } - finally { - fs->Close(); - } - } - - template - static void Save(T obj, String^ path) { - System::IO::FileStream^ fs = System::IO::File::Create(path); - try { - auto formatter = gcnew System::Runtime::Serialization::Formatters::Binary::BinaryFormatter(); - formatter->Serialize(fs, obj); - } - finally { - fs->Close(); - } - } -}; - [Serializable] ref struct Applicant { String^ surname;