private void InternalLoadPackageBody() { string xmlFilePath = _content.GetBody(); _context.Log.AddLogInformation("XML-конфигурация ожидается в '" + xmlFilePath + "'"); _body = GinSerializer.Deserialize <PackageBody>(xmlFilePath); _context.Log.AddLogInformation("XML-конфигурация загружена"); }
private void LoadTransactions() { _context.Log.AddLogInformation("Загружаем транзакции"); _transactions = new List <Transaction>(); if (String.IsNullOrEmpty(TransactionsPath) || !Directory.Exists(TransactionsPath)) { _context.Log.AddLogInformation("Транзакции отсутствуют"); return; } string[] transactionNames = Directory.GetDirectories(TransactionsPath); _context.Log.AddLogInformation("Найдено " + transactionNames.Length + " транзакций"); foreach (string name in transactionNames) { string transactionPath = Path.Combine(TransactionsPath, name); string dataFilePath = Path.Combine(transactionPath, TRANSACTIONS_DATA_FILENAME); Transaction transaction = GinSerializer.Deserialize <Transaction>(dataFilePath); _transactions.Add(transaction); } _context.Log.AddLogInformation("Все транзакции загружены"); }
private void LoadPackageData() { if (File.Exists(SoftwareDataFile)) { _softwareData = GinSerializer.Deserialize <SoftwareData>(SoftwareDataFile); foreach (var item in _softwareData.InstallationParameters) { _context.SaveResult(item.Name, item.Value, true); } _context.Log.AddLogInformation("Загружен SoftwareData"); } if (String.IsNullOrEmpty(PackageDataFile) || !File.Exists(PackageDataFile)) { return; } _context.Log.AddLogInformation("PackageData ожидается в '" + PackageDataFile + "'"); _packageData = GinSerializer.Deserialize <PackageData>(PackageDataFile); _alreadyExecuted = true; _context.Log.AddLogInformation("Загружен PackageData"); }