|
|
@ -2,6 +2,7 @@ |
|
|
|
using System.Collections.ObjectModel; |
|
|
|
using System.IO; |
|
|
|
using System.Runtime.Serialization.Formatters.Binary; |
|
|
|
using System.Windows; |
|
|
|
|
|
|
|
namespace Signal_Generator.Properties { |
|
|
|
|
|
|
@ -16,9 +17,9 @@ namespace Signal_Generator.Properties { |
|
|
|
public Settings() { |
|
|
|
// // Для добавления обработчиков событий для сохранения и изменения параметров раскомментируйте приведенные ниже строки:
|
|
|
|
//
|
|
|
|
this.SettingChanging += this.SettingChangingEventHandler; |
|
|
|
//this.SettingChanging += this.SettingChangingEventHandler;
|
|
|
|
//
|
|
|
|
this.SettingsSaving += this.SettingsSavingEventHandler; |
|
|
|
//this.SettingsSaving += this.SettingsSavingEventHandler;
|
|
|
|
//
|
|
|
|
} |
|
|
|
|
|
|
@ -31,6 +32,8 @@ namespace Signal_Generator.Properties { |
|
|
|
} |
|
|
|
|
|
|
|
public static void SaveSignals(ObservableCollection<IAnalogSignal> signals) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
BinaryFormatter formatter = new BinaryFormatter(); |
|
|
|
using (FileStream fs = new FileStream("settings.dat", FileMode.OpenOrCreate)) |
|
|
@ -38,6 +41,11 @@ namespace Signal_Generator.Properties { |
|
|
|
formatter.Serialize(fs, signals); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
MessageBox.Show(ex.Message, "Не удалось сохранить результаты работы"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static ObservableCollection<IAnalogSignal> LoadSignals() |
|
|
|
{ |
|
|
|