diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-07-05 17:30:08 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-07-08 15:11:57 -0700 |
| commit | 5956ddf6e72ad0bb9fc43f82ef54d584bdf65a9c (patch) | |
| tree | 4c9b8027e57c41d6e973edee81a22699209e77be /src | |
| parent | 634fc916f620ee46c1634327e66328fabb68c9d1 (diff) | |
| download | wix-5956ddf6e72ad0bb9fc43f82ef54d584bdf65a9c.tar.gz wix-5956ddf6e72ad0bb9fc43f82ef54d584bdf65a9c.tar.bz2 wix-5956ddf6e72ad0bb9fc43f82ef54d584bdf65a9c.zip | |
Avoid Enum.ToString() by storing enums as integers
Diffstat (limited to 'src')
| -rw-r--r-- | src/WixToolset.Data/Symbols/WixComplexReferenceSymbol.cs | 12 | ||||
| -rw-r--r-- | src/WixToolset.Data/Symbols/WixGroupSymbol.cs | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/WixToolset.Data/Symbols/WixComplexReferenceSymbol.cs b/src/WixToolset.Data/Symbols/WixComplexReferenceSymbol.cs index 89365605..3db9bcd5 100644 --- a/src/WixToolset.Data/Symbols/WixComplexReferenceSymbol.cs +++ b/src/WixToolset.Data/Symbols/WixComplexReferenceSymbol.cs | |||
| @@ -11,10 +11,10 @@ namespace WixToolset.Data | |||
| 11 | new[] | 11 | new[] |
| 12 | { | 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.Parent), IntermediateFieldType.String), | 13 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.Parent), IntermediateFieldType.String), |
| 14 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.ParentAttributes), IntermediateFieldType.String), | 14 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.ParentAttributes), IntermediateFieldType.Number), |
| 15 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.ParentLanguage), IntermediateFieldType.String), | 15 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.ParentLanguage), IntermediateFieldType.String), |
| 16 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.Child), IntermediateFieldType.String), | 16 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.Child), IntermediateFieldType.String), |
| 17 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.ChildAttributes), IntermediateFieldType.String), | 17 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.ChildAttributes), IntermediateFieldType.Number), |
| 18 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.Attributes), IntermediateFieldType.Bool), | 18 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.Attributes), IntermediateFieldType.Bool), |
| 19 | }, | 19 | }, |
| 20 | typeof(WixComplexReferenceSymbol)); | 20 | typeof(WixComplexReferenceSymbol)); |
| @@ -55,8 +55,8 @@ namespace WixToolset.Data.Symbols | |||
| 55 | 55 | ||
| 56 | public ComplexReferenceParentType ParentType | 56 | public ComplexReferenceParentType ParentType |
| 57 | { | 57 | { |
| 58 | get => (ComplexReferenceParentType)Enum.Parse(typeof(ComplexReferenceParentType), (string)this.Fields[(int)WixComplexReferenceSymbolFields.ParentAttributes], true); | 58 | get => (ComplexReferenceParentType)this.Fields[(int)WixComplexReferenceSymbolFields.ParentAttributes].AsNumber(); |
| 59 | set => this.Set((int)WixComplexReferenceSymbolFields.ParentAttributes, value.ToString()); | 59 | set => this.Set((int)WixComplexReferenceSymbolFields.ParentAttributes, (int)value); |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | public string ParentLanguage | 62 | public string ParentLanguage |
| @@ -73,8 +73,8 @@ namespace WixToolset.Data.Symbols | |||
| 73 | 73 | ||
| 74 | public ComplexReferenceChildType ChildType | 74 | public ComplexReferenceChildType ChildType |
| 75 | { | 75 | { |
| 76 | get => (ComplexReferenceChildType)Enum.Parse(typeof(ComplexReferenceChildType), (string)this.Fields[(int)WixComplexReferenceSymbolFields.ChildAttributes], true); | 76 | get => (ComplexReferenceChildType)this.Fields[(int)WixComplexReferenceSymbolFields.ChildAttributes].AsNumber(); |
| 77 | set => this.Set((int)WixComplexReferenceSymbolFields.ChildAttributes, value.ToString()); | 77 | set => this.Set((int)WixComplexReferenceSymbolFields.ChildAttributes, (int)value); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | public bool IsPrimary | 80 | public bool IsPrimary |
diff --git a/src/WixToolset.Data/Symbols/WixGroupSymbol.cs b/src/WixToolset.Data/Symbols/WixGroupSymbol.cs index b9720890..babcff23 100644 --- a/src/WixToolset.Data/Symbols/WixGroupSymbol.cs +++ b/src/WixToolset.Data/Symbols/WixGroupSymbol.cs | |||
| @@ -11,9 +11,9 @@ namespace WixToolset.Data | |||
| 11 | new[] | 11 | new[] |
| 12 | { | 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(WixGroupSymbolFields.ParentId), IntermediateFieldType.String), | 13 | new IntermediateFieldDefinition(nameof(WixGroupSymbolFields.ParentId), IntermediateFieldType.String), |
| 14 | new IntermediateFieldDefinition(nameof(WixGroupSymbolFields.ParentType), IntermediateFieldType.String), | 14 | new IntermediateFieldDefinition(nameof(WixGroupSymbolFields.ParentType), IntermediateFieldType.Number), |
| 15 | new IntermediateFieldDefinition(nameof(WixGroupSymbolFields.ChildId), IntermediateFieldType.String), | 15 | new IntermediateFieldDefinition(nameof(WixGroupSymbolFields.ChildId), IntermediateFieldType.String), |
| 16 | new IntermediateFieldDefinition(nameof(WixGroupSymbolFields.ChildType), IntermediateFieldType.String), | 16 | new IntermediateFieldDefinition(nameof(WixGroupSymbolFields.ChildType), IntermediateFieldType.Number), |
| 17 | }, | 17 | }, |
| 18 | typeof(WixGroupSymbol)); | 18 | typeof(WixGroupSymbol)); |
| 19 | } | 19 | } |
| @@ -51,8 +51,8 @@ namespace WixToolset.Data.Symbols | |||
| 51 | 51 | ||
| 52 | public ComplexReferenceParentType ParentType | 52 | public ComplexReferenceParentType ParentType |
| 53 | { | 53 | { |
| 54 | get => (ComplexReferenceParentType)Enum.Parse(typeof(ComplexReferenceParentType), (string)this.Fields[(int)WixGroupSymbolFields.ParentType], true); | 54 | get => (ComplexReferenceParentType)this.Fields[(int)WixGroupSymbolFields.ParentType].AsNumber(); |
| 55 | set => this.Set((int)WixGroupSymbolFields.ParentType, value.ToString()); | 55 | set => this.Set((int)WixGroupSymbolFields.ParentType, (int)value); |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | public string ChildId | 58 | public string ChildId |
| @@ -63,8 +63,8 @@ namespace WixToolset.Data.Symbols | |||
| 63 | 63 | ||
| 64 | public ComplexReferenceChildType ChildType | 64 | public ComplexReferenceChildType ChildType |
| 65 | { | 65 | { |
| 66 | get => (ComplexReferenceChildType)Enum.Parse(typeof(ComplexReferenceChildType), (string)this.Fields[(int)WixGroupSymbolFields.ChildType], true); | 66 | get => (ComplexReferenceChildType)this.Fields[(int)WixGroupSymbolFields.ChildType].AsNumber(); |
| 67 | set => this.Set((int)WixGroupSymbolFields.ChildType, value.ToString()); | 67 | set => this.Set((int)WixGroupSymbolFields.ChildType, (int)value); |
| 68 | } | 68 | } |
| 69 | } | 69 | } |
| 70 | } \ No newline at end of file | 70 | } \ No newline at end of file |
