public void SetData(YamlInstaller installer, bool useNullValues = true) { this.Model = installer; if (useNullValues || installer.Arch != default) { this.Architecture.CurrentValue = installer?.Arch ?? YamlArchitecture.none; } if (useNullValues || installer.SystemAppId != null) { this.SystemAppId.CurrentValue = installer?.SystemAppId; } if (useNullValues || installer.SignatureSha256 != null) { this.SignatureSha256.CurrentValue = installer?.SignatureSha256; } if (useNullValues || installer.Scope != default) { this.Scope.CurrentValue = installer?.Scope ?? YamlScope.none; } if (useNullValues || installer.Switches?.Silent != null) { this.SilentCommand.CurrentValue = installer?.Switches?.Silent; } if (useNullValues || installer.Switches?.Custom != null) { this.CustomCommand.CurrentValue = installer?.Switches?.Custom; } if (useNullValues || installer.InstallerType != default) { this.InstallerType.CurrentValue = installer?.InstallerType ?? YamlInstallerType.none; } if (useNullValues || installer.Arch != default) { this.SilentCommandWithProgress.CurrentValue = installer?.Switches?.SilentWithProgress; } this.Commit(); }
public void SetData(YamlInstaller installer, bool useNullValues = true) { this.Model = installer; if (useNullValues || installer.Architecture != default) { this.Architecture.CurrentValue = installer?.Architecture ?? YamlArchitecture.None; } if (useNullValues || installer.Platform != default) { this.PlatformUwp.CurrentValue = installer?.Platform?.Contains(YamlPlatform.WindowsUniversal) == true; this.PlatformWin32.CurrentValue = installer?.Platform?.Contains(YamlPlatform.WindowsDesktop) == true; } if (useNullValues || installer.ProductCode != null) { this.ProductCode.CurrentValue = installer?.ProductCode; } if (useNullValues || installer.PackageFamilyName != null) { this.PackageFamilyName.CurrentValue = installer?.PackageFamilyName; } if (useNullValues || installer.SignatureSha256 != null) { this.SignatureSha256.CurrentValue = installer?.SignatureSha256; } if (useNullValues || installer.Scope != default) { this.Scope.CurrentValue = installer?.Scope ?? YamlScope.None; } if (useNullValues || installer.InstallerSwitches?.Silent != null) { this.SilentCommand.CurrentValue = installer?.InstallerSwitches?.Silent; } if (useNullValues || installer.InstallerSwitches?.Custom != null) { this.CustomCommand.CurrentValue = installer?.InstallerSwitches?.Custom; } if (useNullValues || installer.InstallerSwitches?.SilentWithProgress != default) { this.SilentCommandWithProgress.CurrentValue = installer?.InstallerSwitches?.SilentWithProgress; } if (useNullValues || installer.InstallerSwitches?.Interactive != default) { this.InteractiveCommand.CurrentValue = installer?.InstallerSwitches?.Interactive; } if (useNullValues || installer.InstallerSwitches?.Upgrade != default) { this.UpgradeCommand.CurrentValue = installer?.InstallerSwitches?.Upgrade; } if (useNullValues || installer.InstallerSwitches?.Log != default) { this.LogCommand.CurrentValue = installer?.InstallerSwitches?.Log; } if (useNullValues || installer.InstallerType != default) { this.InstallerType.CurrentValue = installer?.InstallerType ?? YamlInstallerType.None; } this.Commit(); }