From 8c27fbe1bc8a6d83859aead2105d6d528c307726 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 6 May 2021 18:55:18 -0500 Subject: Move WixToolset.WixBA into test/burn and use new PackageReferences. --- src/WixToolset.WixBA/RootViewModel.cs | 202 ---------------------------------- 1 file changed, 202 deletions(-) delete mode 100644 src/WixToolset.WixBA/RootViewModel.cs (limited to 'src/WixToolset.WixBA/RootViewModel.cs') diff --git a/src/WixToolset.WixBA/RootViewModel.cs b/src/WixToolset.WixBA/RootViewModel.cs deleted file mode 100644 index 8cff7274..00000000 --- a/src/WixToolset.WixBA/RootViewModel.cs +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.WixBA -{ - using System; - using System.Windows; - using System.Windows.Input; - using System.Windows.Threading; - using WixToolset.Mba.Core; - - /// - /// The errors returned from the engine - /// - public enum Error - { - UserCancelled = 1223, - } - - /// - /// The model of the root view in WixBA. - /// - public class RootViewModel : PropertyNotifyBase - { - private ICommand cancelCommand; - private ICommand closeCommand; - - private bool canceled; - private InstallationState installState; - private DetectionState detectState; - - /// - /// Creates a new model of the root view. - /// - public RootViewModel() - { - this.InstallationViewModel = new InstallationViewModel(this); - this.ProgressViewModel = new ProgressViewModel(this); - this.UpdateViewModel = new UpdateViewModel(this); - } - - public InstallationViewModel InstallationViewModel { get; private set; } - public ProgressViewModel ProgressViewModel { get; private set; } - public UpdateViewModel UpdateViewModel { get; private set; } - public Dispatcher Dispatcher { get; set; } - public IntPtr ViewWindowHandle { get; set; } - public bool AutoClose { get; set; } - - public ICommand CloseCommand - { - get - { - if (this.closeCommand == null) - { - this.closeCommand = new RelayCommand(param => WixBA.View.Close()); - } - - return this.closeCommand; - } - } - - public ICommand CancelCommand - { - get - { - if (this.cancelCommand == null) - { - this.cancelCommand = new RelayCommand(param => - { - this.CancelButton_Click(); - }, - param => !this.Canceled); - } - - return this.cancelCommand; - } - } - - public bool CancelAvailable - { - get { return InstallationState.Applying == this.InstallState; } - } - - public bool Canceled - { - get - { - return this.canceled; - } - - set - { - if (this.canceled != value) - { - this.canceled = value; - base.OnPropertyChanged("Canceled"); - } - } - } - - /// - /// Gets and sets the detect state of the view's model. - /// - public DetectionState DetectState - { - get - { - return this.detectState; - } - - set - { - if (this.detectState != value) - { - this.detectState = value; - - // Notify all the properties derived from the state that the state changed. - base.OnPropertyChanged("DetectState"); - } - } - } - - /// - /// Gets and sets the installation state of the view's model. - /// - public InstallationState InstallState - { - get - { - return this.installState; - } - - set - { - if (this.installState != value) - { - this.installState = value; - - // Notify all the properties derived from the state that the state changed. - base.OnPropertyChanged("InstallState"); - base.OnPropertyChanged("CancelAvailable"); - } - } - } - - /// - /// Gets and sets the state of the view's model before apply begins in order to return to that state if cancel or rollback occurs. - /// - public InstallationState PreApplyState { get; set; } - - /// - /// Gets and sets the path where the bundle is currently installed or will be installed. - /// - public string InstallDirectory - { - get - { - return WixBA.Model.InstallDirectory; - } - - set - { - if (WixBA.Model.InstallDirectory != value) - { - WixBA.Model.InstallDirectory = value; - base.OnPropertyChanged("InstallDirectory"); - } - } - } - - /// - /// The Title of this bundle. - /// - public string Title - { - get - { - return WixDistribution.ShortProduct; - } - } - - /// - /// Prompts the user to make sure they want to cancel. - /// This needs to run on the UI thread, use Dispatcher.Invoke to call this from a background thread. - /// - public void CancelButton_Click() - { - if (this.Canceled) - { - return; - } - - if (Display.Full == WixBA.Model.Command.Display) - { - this.Canceled = (MessageBoxResult.Yes == MessageBox.Show(WixBA.View, "Are you sure you want to cancel?", "WiX Toolset", MessageBoxButton.YesNo, MessageBoxImage.Error)); - } - else - { - this.Canceled = true; - } - } - } -} -- cgit v1.2.3-55-g6feb