コード例 #1
0
        private void ParseResults()
        {
            var results = JsonConvert.DeserializeObject <dynamic>(ResultsString);
            IList <InternalValidationResult> messages = results.messages.ToObject <List <InternalValidationResult> >();

            foreach (InternalValidationResult internalValidationResult in messages)
            {
                ValidationResult result = new ValidationResult()
                {
                    Message         = internalValidationResult.message,
                    LineNumber      = internalValidationResult.linenumber,
                    MessageCategory = internalValidationResult.messagecategory,
                    MessageType     = internalValidationResult.messagetype,
                    CharLocation    = internalValidationResult.charlocation
                };
                switch (internalValidationResult.messagetype)
                {
                case "ERROR":
                    Errors.Add(result);
                    break;

                case "WARNING":
                    Warnings.Add(result);
                    break;

                default:
                    OtherMessages.Add(result);
                    break;
                }
            }
        }
コード例 #2
0
 private AuditExecutor PipeMessages(List <AuditMessage> AuditMessages)
 {
     return((OtherMessages) =>
     {
         foreach (var message in AuditMessages)
         {
             OtherMessages.Add(message);
         }
         return OtherMessages;
     });
 }