Пример #1
0
        public static Match ProjectWasNotImportedRegex(string message, out string reason)
        {
            reason = "";

            if (ProjectImportSkippedMissingFile.Match(message).Success)
            {
                reason = "the file not existing";
                return(ProjectImportSkippedMissingFile.Match(message));
            }
            else if (ProjectImportSkippedInvalidFile.Match(message).Success)
            {
                reason = "the file being invalid";
                return(ProjectImportSkippedInvalidFile.Match(message));
            }
            else if (ProjectImportSkippedEmptyFile.Match(message).Success)
            {
                reason = "the file being empty";
                return(ProjectImportSkippedEmptyFile.Match(message));
            }
            else if (ProjectImportSkippedNoMatches.Match(message).Success)
            {
                reason = "no matching files";
                return(ProjectImportSkippedNoMatches.Match(message));
            }
            else if (ProjectImportSkippedFalseCondition.Match(message).Success)
            {
                reason = "false condition; ";
                Match match = ProjectImportSkippedFalseCondition.Match(message);
                reason += match.Groups["Reason"].Value;
                reason += " was evaluated as " + match.Groups["Evaluated"].Value;
                return(match);
            }

            return(Match.Empty);

            //ProjectImportSkippedMissingFile $:$ Project "{0}" was not imported by "{1}" at ({2},{3}), due to the file not existing.
            //ProjectImportSkippedInvalidFile $:$ Project "{0}" was not imported by "{1}" at({ 2},{3}), due to the file being invalid.
            //ProjectImportSkippedEmptyFile $:$ Project "{0}" was not imported by "{1}" at ({2},{3}), due to the file being empty.
            //ProjectImportSkippedFalseCondition $:$ Project "{0}" was not imported by "{1}" at({ 2},{3}), due to false condition; ({4}) was evaluated as ({5}).
            //ProjectImportSkippedNoMatches $:$ Project "{0}" was not imported by "{1}" at({ 2},{3}), due to no matching files.
        }