コード例 #1
0
 protected void ValidateNameContainsOnlyValidChars(PluginProfileErrorCollection errors)
 {
     if (!ProfileDtoValidator.IsValid(Name))
     {
         errors.Add(new PluginProfileError
         {
             FieldName = NameField,
             Message   = "You can only use letters, numbers, space and underscore symbol in Mashup name"
         });
     }
 }
コード例 #2
0
 private static void FixName(PluginProfileDto pluginProfile)
 {
     foreach (var profileNameChar in pluginProfile.Name.Distinct())
     {
         if (ProfileDtoValidator.IsValid(profileNameChar.ToString()))
         {
             continue;
         }
         pluginProfile.Name = pluginProfile.Name.Replace(profileNameChar, '_');
     }
 }