示例#1
0
        private void HandleResult(ControllerResult result)
        {
            switch (result)
            {
            case ControllerResult.Success:
                //everything is fine
                break;

            case ControllerResult.Nothing:
                //no error happened, the user just wanted nothing to happen
                break;

            case ControllerResult.Failure:
                MessageBox.Show("The add-in has run into an unexpected error.");
                break;

            case ControllerResult.SilentFailure:
                //keep the error invisible, maybe report it
                break;

            case ControllerResult.EmptyData:
                MessageBox.Show("Please add data by selecting \"Manage Data\".");
                break;

            case ControllerResult.NoLabels:
                MessageBox.Show("Please choose a label style by selecting \"Create Labels\".");
                break;

            case ControllerResult.NoTemplate:
                MessageBox.Show("Please select a label template by selecting \"Label Templates\".");
                break;

            default:
                MessageBox.Show($"\"{result.ToString()}\" is an unimplemented result case.");
                break;
            }
        }