コード例 #1
0
 public static Error.Types OnSetSiteSettings(
     Context context, SiteSettings ss, out string data)
 {
     data = null;
     if (!context.CanManageSite(ss: ss))
     {
         return(Error.Types.HasNotPermission);
     }
     foreach (var formData in Forms.All())
     {
         switch (formData.Key)
         {
         case "Format":
             try
             {
                 0.ToString(formData.Value, Sessions.CultureInfo());
             }
             catch (System.Exception)
             {
                 data = formData.Value;
                 return(Error.Types.BadFormat);
             }
             break;
         }
     }
     return(Error.Types.None);
 }
コード例 #2
0
        public void AddForms(IEnumerable <string> forms, VerbType verbType)
        {
            switch (verbType)
            {
            case VerbType.Infinitive: _formInfinitiveList.AddRange(forms); break;

            case VerbType.Past: _formPastList.AddRange(forms); break;

            case VerbType.PastParticiple: _formPastParticipleList.AddRange(forms); break;

            case VerbType.PresentParticiple: _formPresentParticipleList.AddRange(forms); break;
            }

            Forms.AddRange(forms.Where(x => Forms.All(y => !y.Equals(x, StringComparison.InvariantCultureIgnoreCase))));
        }