diff options
| author | Rob Mensching <rob@firegiant.com> | 2019-05-08 14:13:31 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2019-05-08 14:44:43 -0700 |
| commit | 75fd55d5a71c492c6ea904768858c51aa97da29f (patch) | |
| tree | 610047db1d5759a726ce88277bb2dfddcd01da45 /src/WixToolset.Core/Resolver.cs | |
| parent | d1dbe29f3856d012acf5f96e8e66c43b74ab490d (diff) | |
| download | wix-75fd55d5a71c492c6ea904768858c51aa97da29f.tar.gz wix-75fd55d5a71c492c6ea904768858c51aa97da29f.tar.bz2 wix-75fd55d5a71c492c6ea904768858c51aa97da29f.zip | |
Use new strongly typed tuples
Diffstat (limited to 'src/WixToolset.Core/Resolver.cs')
| -rw-r--r-- | src/WixToolset.Core/Resolver.cs | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/WixToolset.Core/Resolver.cs b/src/WixToolset.Core/Resolver.cs index c69c4f68..4bdc5815 100644 --- a/src/WixToolset.Core/Resolver.cs +++ b/src/WixToolset.Core/Resolver.cs | |||
| @@ -126,73 +126,72 @@ namespace WixToolset.Core | |||
| 126 | { | 126 | { |
| 127 | foreach (var section in context.IntermediateRepresentation.Sections) | 127 | foreach (var section in context.IntermediateRepresentation.Sections) |
| 128 | { | 128 | { |
| 129 | foreach (var row in section.Tuples.OfType<DialogTuple>()) | 129 | foreach (var tuple in section.Tuples.OfType<DialogTuple>()) |
| 130 | { | 130 | { |
| 131 | string dialog = row.Dialog; | 131 | if (context.VariableResolver.TryGetLocalizedControl(tuple.Id.Id, null, out var localizedControl)) |
| 132 | |||
| 133 | if (context.VariableResolver.TryGetLocalizedControl(dialog, null, out LocalizedControl localizedControl)) | ||
| 134 | { | 132 | { |
| 135 | if (CompilerConstants.IntegerNotSet != localizedControl.X) | 133 | if (CompilerConstants.IntegerNotSet != localizedControl.X) |
| 136 | { | 134 | { |
| 137 | row.HCentering = localizedControl.X; | 135 | tuple.HCentering = localizedControl.X; |
| 138 | } | 136 | } |
| 139 | 137 | ||
| 140 | if (CompilerConstants.IntegerNotSet != localizedControl.Y) | 138 | if (CompilerConstants.IntegerNotSet != localizedControl.Y) |
| 141 | { | 139 | { |
| 142 | row.VCentering = localizedControl.Y; | 140 | tuple.VCentering = localizedControl.Y; |
| 143 | } | 141 | } |
| 144 | 142 | ||
| 145 | if (CompilerConstants.IntegerNotSet != localizedControl.Width) | 143 | if (CompilerConstants.IntegerNotSet != localizedControl.Width) |
| 146 | { | 144 | { |
| 147 | row.Width = localizedControl.Width; | 145 | tuple.Width = localizedControl.Width; |
| 148 | } | 146 | } |
| 149 | 147 | ||
| 150 | if (CompilerConstants.IntegerNotSet != localizedControl.Height) | 148 | if (CompilerConstants.IntegerNotSet != localizedControl.Height) |
| 151 | { | 149 | { |
| 152 | row.Height = localizedControl.Height; | 150 | tuple.Height = localizedControl.Height; |
| 153 | } | 151 | } |
| 154 | 152 | ||
| 155 | row.Attributes = row.Attributes | localizedControl.Attributes; | 153 | tuple.RightAligned |= localizedControl.RightAligned; |
| 154 | tuple.RightToLeft |= localizedControl.RightToLeft; | ||
| 155 | tuple.LeftScroll |= localizedControl.LeftScroll; | ||
| 156 | 156 | ||
| 157 | if (!String.IsNullOrEmpty(localizedControl.Text)) | 157 | if (!String.IsNullOrEmpty(localizedControl.Text)) |
| 158 | { | 158 | { |
| 159 | row.Title = localizedControl.Text; | 159 | tuple.Title = localizedControl.Text; |
| 160 | } | 160 | } |
| 161 | } | 161 | } |
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | foreach (var row in section.Tuples.OfType<ControlTuple>()) | 164 | foreach (var tuple in section.Tuples.OfType<ControlTuple>()) |
| 165 | { | 165 | { |
| 166 | string dialog = row.Dialog_; | 166 | if (context.VariableResolver.TryGetLocalizedControl(tuple.Dialog_, tuple.Control, out var localizedControl)) |
| 167 | string control = row.Control; | ||
| 168 | |||
| 169 | if (context.VariableResolver.TryGetLocalizedControl(dialog, control, out LocalizedControl localizedControl)) | ||
| 170 | { | 167 | { |
| 171 | if (CompilerConstants.IntegerNotSet != localizedControl.X) | 168 | if (CompilerConstants.IntegerNotSet != localizedControl.X) |
| 172 | { | 169 | { |
| 173 | row.X = localizedControl.X; | 170 | tuple.X = localizedControl.X; |
| 174 | } | 171 | } |
| 175 | 172 | ||
| 176 | if (CompilerConstants.IntegerNotSet != localizedControl.Y) | 173 | if (CompilerConstants.IntegerNotSet != localizedControl.Y) |
| 177 | { | 174 | { |
| 178 | row.Y = localizedControl.Y; | 175 | tuple.Y = localizedControl.Y; |
| 179 | } | 176 | } |
| 180 | 177 | ||
| 181 | if (CompilerConstants.IntegerNotSet != localizedControl.Width) | 178 | if (CompilerConstants.IntegerNotSet != localizedControl.Width) |
| 182 | { | 179 | { |
| 183 | row.Width = localizedControl.Width; | 180 | tuple.Width = localizedControl.Width; |
| 184 | } | 181 | } |
| 185 | 182 | ||
| 186 | if (CompilerConstants.IntegerNotSet != localizedControl.Height) | 183 | if (CompilerConstants.IntegerNotSet != localizedControl.Height) |
| 187 | { | 184 | { |
| 188 | row.Height = localizedControl.Height; | 185 | tuple.Height = localizedControl.Height; |
| 189 | } | 186 | } |
| 190 | 187 | ||
| 191 | row.Attributes = row.Attributes | localizedControl.Attributes; | 188 | tuple.RightAligned |= localizedControl.RightAligned; |
| 189 | tuple.RightToLeft |= localizedControl.RightToLeft; | ||
| 190 | tuple.LeftScroll |= localizedControl.LeftScroll; | ||
| 192 | 191 | ||
| 193 | if (!String.IsNullOrEmpty(localizedControl.Text)) | 192 | if (!String.IsNullOrEmpty(localizedControl.Text)) |
| 194 | { | 193 | { |
| 195 | row.Text = localizedControl.Text; | 194 | tuple.Text = localizedControl.Text; |
| 196 | } | 195 | } |
| 197 | } | 196 | } |
| 198 | } | 197 | } |
