示例#1
1
        public SUUpdateAlert(Window window, SUHost host, SUAppcastItem item)
            : base(window)
        {
            Window.TaskbarItemInfo = new System.Windows.Shell.TaskbarItemInfo();
            Window.Closing += WindowShouldClose;
            Window.Icon = host.Icon;
            Window.Topmost = true;

            status = WindowStatus.WaitingForInitialAction;

            mainViewController = new SUUpdateAlertWindowViewController(new SUUpdateAlertWindowView());
            ViewController = mainViewController;

            buttons = new SUUpdateAlertActionButtonsViewController(new SUUpdateAlertActionButtonsView());
            buttons.InstallButton.Click += DownloadButtonClicked;
            buttons.RemindLaterButton.Click += RemindLaterButtonClicked;
            buttons.SkipVersionButton.Click += SkipVersionButtonClicked;

            downloadingViewController = new SUUpdateAlertDownloadProgressViewController(new SUUpdateAlertDownloadProgressView());
            downloadingViewController.CancelButton.Click += CancelDownloadClicked;

            indeterminateViewController = new SUUpdateAlertIndeterminateProgressViewController(new SUUpdateAlertIndeterminateProgressView());
            readyToInstallViewController = new SUUpdateAlertReadyToInstallViewController(new SUUpdateAlertReadyToInstallView());

            readyToInstallViewController.InstallButton.Click += InstallButtonClicked;

            mainViewController.ActionViewController = buttons;
            mainViewController.Host = host;
            mainViewController.Item = item;
        }
        public SUUpdateAlert(Window window, SUHost host, SUAppcastItem item)
            : base(window)
        {
            Window.TaskbarItemInfo = new System.Windows.Shell.TaskbarItemInfo();
            Window.Closing        += WindowShouldClose;
            Window.Icon            = host.Icon;
            Window.Topmost         = true;

            status = WindowStatus.WaitingForInitialAction;

            mainViewController = new SUUpdateAlertWindowViewController(new SUUpdateAlertWindowView());
            ViewController     = mainViewController;

            buttons = new SUUpdateAlertActionButtonsViewController(new SUUpdateAlertActionButtonsView());
            buttons.InstallButton.Click     += DownloadButtonClicked;
            buttons.RemindLaterButton.Click += RemindLaterButtonClicked;
            buttons.SkipVersionButton.Click += SkipVersionButtonClicked;

            downloadingViewController = new SUUpdateAlertDownloadProgressViewController(new SUUpdateAlertDownloadProgressView());
            downloadingViewController.CancelButton.Click += CancelDownloadClicked;

            indeterminateViewController  = new SUUpdateAlertIndeterminateProgressViewController(new SUUpdateAlertIndeterminateProgressView());
            readyToInstallViewController = new SUUpdateAlertReadyToInstallViewController(new SUUpdateAlertReadyToInstallView());

            readyToInstallViewController.InstallButton.Click += InstallButtonClicked;

            mainViewController.ActionViewController = buttons;
            mainViewController.Host = host;
            mainViewController.Item = item;
        }