예제 #1
0
        public MessageResult ProcessMessage(InstallMessage messageType, Record messageRecord, MessageButtons buttons, MessageIcon icon, MessageDefaultButton defaultButton)
        {
            if (_controller.IsCanceled)
            {
                this.ViewModel.ClosingModel.Installed = ClosingResult.Cancelled;
                return(MessageResult.Cancel);
            }

            var indicator = _progressCounter.ProcessMessage(messageType, messageRecord);

            _controller.UpdateProgress(indicator);

            // Have we finished?
            if (messageType == InstallMessage.InstallEnd)
            {
                try
                {
                    var returnCode = messageRecord.GetInteger(3);
                    this.ViewModel.ClosingModel.Installed = returnCode == 1 ? ClosingResult.Success : ClosingResult.Failed;
                }
                catch (Exception)
                {
                    this.ViewModel.ClosingModel.Installed = ClosingResult.Failed;
                }
            }

            return(MessageResult.OK);
        }