aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/Identifier.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Data/Identifier.cs')
-rw-r--r--src/WixToolset.Data/Identifier.cs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/WixToolset.Data/Identifier.cs b/src/WixToolset.Data/Identifier.cs
index 57241007..8333198f 100644
--- a/src/WixToolset.Data/Identifier.cs
+++ b/src/WixToolset.Data/Identifier.cs
@@ -12,7 +12,7 @@ namespace WixToolset.Data
12 [DebuggerDisplay("{Access} {Id,nq}")] 12 [DebuggerDisplay("{Access} {Id,nq}")]
13 public class Identifier 13 public class Identifier
14 { 14 {
15 public static Identifier Invalid = new Identifier(AccessModifier.Private, (string)null); 15 public static Identifier Invalid = new Identifier(AccessModifier.Section, (string)null);
16 16
17 [Obsolete] 17 [Obsolete]
18 public Identifier(string id, AccessModifier access) 18 public Identifier(string id, AccessModifier access)
@@ -58,10 +58,9 @@ namespace WixToolset.Data
58 internal static Identifier Deserialize(JsonObject jsonObject) 58 internal static Identifier Deserialize(JsonObject jsonObject)
59 { 59 {
60 var id = jsonObject.GetValueOrDefault<string>("id"); 60 var id = jsonObject.GetValueOrDefault<string>("id");
61 var accessValue = jsonObject.GetValueOrDefault<string>("access"); 61 var accessValue = jsonObject.GetValueOrDefault("access", "global");
62 Enum.TryParse(accessValue, true, out AccessModifier access);
63 62
64 return new Identifier(access, id); 63 return new Identifier(accessValue.AsAccessModifier(), id);
65 } 64 }
66 65
67 internal JsonObject Serialize() 66 internal JsonObject Serialize()
@@ -69,7 +68,7 @@ namespace WixToolset.Data
69 var jsonObject = new JsonObject 68 var jsonObject = new JsonObject
70 { 69 {
71 { "id", this.Id }, 70 { "id", this.Id },
72 { "access", this.Access.ToString().ToLowerInvariant() } 71 { "access", this.Access.AsString() }
73 }; 72 };
74 73
75 return jsonObject; 74 return jsonObject;