From 8674986ef7368f6fad609219bac831f733292d2e Mon Sep 17 00:00:00 2001 From: Robin Cornelius Date: Sat, 4 Feb 2017 17:29:51 +0000 Subject: [PATCH] Only export to eds variables with the [EdsExport] attribute fixes #52 EdsExport was not being tested during save and was wrong on one variable. Fixing this also removed 4 special cases that were excluded on export --- libEDSsharp/eds.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libEDSsharp/eds.cs b/libEDSsharp/eds.cs index cf482a0d..832b21f2 100644 --- a/libEDSsharp/eds.cs +++ b/libEDSsharp/eds.cs @@ -213,13 +213,8 @@ public void write(StreamWriter writer) foreach (FieldInfo f in fields) { - if (f.Name == "EDSVersionMajor") - continue; - if (f.Name == "EDSVersionMinor") - continue; - if (f.Name == "CreationDateTime") - continue; - if (f.Name == "ModificationDateTime") + + if (!Attribute.IsDefined(f, typeof(EdsExport))) continue; if (f.GetValue(this) == null) @@ -462,9 +457,9 @@ public class FileInfo : InfoSection [EdsExport] public byte FileRevision;//=1 - [EdsExport] + public byte EDSVersionMajor;//=4.0 - [EdsExport] + public byte EDSVersionMinor;//=4.0 [EdsExport] public string EDSVersion="";