示例#1
0
        private void OnBuildDone(vsBuildScope Scope, vsBuildAction Action)
        {
            FartOptions options = (FartOptions)GetDialogPage(typeof(FartOptions));

            if (!options.Enabled)
            {
                return;
            }

            bool isSuccess = _dte.Solution.SolutionBuild.LastBuildInfo == 0;

            if (isSuccess)
            {
                _successfulBuilds++;

                if (_hasBuildFailed)
                {
                    SetBuildMessage();
                }
            }
            else
            {
                FartPlayer.PlayFart(options.SelectedErrorFart);
                _hasBuildFailed   = true;
                _successfulBuilds = 0;
            }
        }
示例#2
0
        private void OnFartButtonClick(object sender, EventArgs e)
        {
            FartPlayer.PlayFart(Farts.RandomFart);

            Random rn    = new Random();
            int    index = rn.Next(0, _messages.Count);

            _dte.StatusBar.Text = _messages[index];
        }
示例#3
0
        private void Fart(bool isSuccess, FartOptions options)
        {
            bool hasWarnings = _dte.ToolWindows.ErrorList.ErrorItems.Count > 0;

            if (!isSuccess)
            {
                FartPlayer.PlayFart(options.SelectedErrorFart);
            }

            else if (isSuccess && hasWarnings)
            {
                FartPlayer.PlayFart(options.SelectedWarningFart);
            }
        }