|
@ -1,4 +1,5 @@ |
|
|
using System.Collections.ObjectModel; |
|
|
using System; |
|
|
|
|
|
using System.Collections.ObjectModel; |
|
|
using System.IO; |
|
|
using System.IO; |
|
|
using System.Runtime.Serialization.Formatters.Binary; |
|
|
using System.Runtime.Serialization.Formatters.Binary; |
|
|
|
|
|
|
|
@ -41,10 +42,15 @@ namespace Signal_Generator.Properties { |
|
|
public static ObservableCollection<IAnalogSignal> LoadSignals() |
|
|
public static ObservableCollection<IAnalogSignal> LoadSignals() |
|
|
{ |
|
|
{ |
|
|
BinaryFormatter formatter = new BinaryFormatter(); |
|
|
BinaryFormatter formatter = new BinaryFormatter(); |
|
|
using (FileStream fs = new FileStream("settings.dat", FileMode.Open)) |
|
|
try |
|
|
{ |
|
|
{ |
|
|
if (!fs.CanRead) return null; |
|
|
using (FileStream fs = new FileStream("settings.dat", FileMode.Open)) |
|
|
return (ObservableCollection<IAnalogSignal>)formatter.Deserialize(fs); |
|
|
{ |
|
|
|
|
|
return (ObservableCollection<IAnalogSignal>)formatter.Deserialize(fs); |
|
|
|
|
|
} |
|
|
|
|
|
} catch |
|
|
|
|
|
{ |
|
|
|
|
|
return null; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|