Beispiel #1
0
        private string GetBotTypeString()
        {
            var classification = Tracker.Current.Contact.System.Classification;

            if (ContactClassification.IsMaliciousRobot(classification))
            {
                return($"Malicious robot ({classification})");
            }

            if (ContactClassification.IsAutoDetectedRobot(classification))
            {
                return($"Auto detected robot ({classification})");
            }

            if (ContactClassification.IsRobot(classification))
            {
                return($"Robot ({classification})");
            }

            if (ContactClassification.IsHuman(classification))
            {
                return($"Human ({classification})");
            }

            return(string.Empty);
        }
Beispiel #2
0
 public void Process(ValidateCommentArgs args)
 {
     if (ContactClassification.IsRobot(Tracker.Current.Contact.System.Classification))
     {
         var text = Translator.Text(Constants.TranslationPhrases.ErrorOccurredTryAgain);
         args.Errors.Add(text);
     }
 }
Beispiel #3
0
 /// <summary>
 /// Get the display string for an enum by it's value in enum form
 /// </summary>
 /// <param name="value">The enum value in enum form</param>
 /// <returns>The display string for the value or the default if one cannot be found</returns>
 public static string GetByEnum(ContactClassification value)
 {
     return(GetByEnum((int)value));
 }