public ValidationResult Validate(IEnumerable <string> userAssemblies, params object[] options)
    {
        string           arguments         = this.BuildGendarmeCommandLineArguments(userAssemblies);
        ValidationResult validationResult  = default(ValidationResult);
        ValidationResult validationResult2 = validationResult;

        validationResult2.Success = true;
        validationResult2.Rule    = this;
        validationResult          = validationResult2;
        try
        {
            validationResult.Success = GendarmeValidationRule.StartManagedProgram(this._gendarmeExePath, arguments, new GendarmeOutputParser(), ref validationResult.CompilerMessages);
        }
        catch (Exception ex)
        {
            validationResult.Success          = false;
            validationResult.CompilerMessages = new CompilerMessage[]
            {
                new CompilerMessage
                {
                    file    = "Exception",
                    message = ex.Message
                }
            };
        }
        return(validationResult);
    }
    public ValidationResult Validate(IEnumerable <string> userAssemblies, params object[] options)
    {
        string           arguments = this.BuildGendarmeCommandLineArguments(userAssemblies);
        ValidationResult result    = new ValidationResult
        {
            Success          = true,
            Rule             = this,
            CompilerMessages = null
        };

        try
        {
            result.Success = GendarmeValidationRule.StartManagedProgram(this._gendarmeExePath, arguments, new GendarmeOutputParser(), ref result.CompilerMessages);
        }
        catch (Exception ex)
        {
            result.Success          = false;
            result.CompilerMessages = new CompilerMessage[]
            {
                new CompilerMessage
                {
                    file    = "Exception",
                    message = ex.Message,
                    line    = 0,
                    column  = 0,
                    type    = CompilerMessageType.Error
                }
            };
        }
        return(result);
    }
    private static bool StartManagedProgram(string exe, string arguments, CompilerOutputParserBase parser, ref IEnumerable <CompilerMessage> compilerMessages)
    {
        bool result;

        using (ManagedProgram managedProgram = GendarmeValidationRule.ManagedProgramFor(exe, arguments))
        {
            managedProgram.LogProcessStartInfo();
            try
            {
                managedProgram.Start();
            }
            catch
            {
                throw new Exception("Could not start " + exe);
            }
            managedProgram.WaitForExit();
            if (managedProgram.ExitCode == 0)
            {
                result = true;
                return(result);
            }
            compilerMessages = parser.Parse(managedProgram.GetErrorOutput(), managedProgram.GetStandardOutput(), true);
        }
        result = false;
        return(result);
    }
    public ValidationResult Validate(IEnumerable <string> userAssemblies, params object[] options)
    {
        string           arguments        = this.BuildGendarmeCommandLineArguments(userAssemblies);
        ValidationResult validationResult = new ValidationResult()
        {
            Success          = true,
            Rule             = (IValidationRule)this,
            CompilerMessages = (IEnumerable <CompilerMessage>)null
        };

        try
        {
            validationResult.Success = GendarmeValidationRule.StartManagedProgram(this._gendarmeExePath, arguments, (CompilerOutputParserBase) new GendarmeOutputParser(), ref validationResult.CompilerMessages);
        }
        catch (Exception ex)
        {
            validationResult.Success = false;
            // ISSUE: explicit reference operation
            // ISSUE: explicit reference operation
            (^ @validationResult).CompilerMessages = (IEnumerable <CompilerMessage>) new CompilerMessage[1]
            {
                new CompilerMessage()
                {
                    file    = "Exception",
                    message = ex.Message,
                    line    = 0,
                    column  = 0,
                    type    = CompilerMessageType.Error
                }
            };
        }
        return(validationResult);
    }