Exemple #1
0
 /// <summary>
 /// Adds a function that conditionally returns the string specified by 'name'
 /// </summary>
 /// <param name="m">The instance of the class</param>
 /// <param name="name">The string to be conditionally returned</param>
 /// <param name="func">The function to be executed to determine if the string is included</param>
 /// <returns>The instance of the class</returns>
 public static ClassAndStyleMapper AddIf(this ClassAndStyleMapper m, string name, Func <bool> func)
 {
     m.Items.Add(() => func() ? name : null);
     return(m);
 }
Exemple #2
0
 /// <summary>
 /// Removes all defined items from the list
 /// </summary>
 /// <param name="m">The instance of the class</param>
 /// <returns>The instance of the class</returns>
 public static ClassAndStyleMapper Clear(this ClassAndStyleMapper m)
 {
     m.Items.Clear();
     return(m);
 }
Exemple #3
0
 /// <summary>
 /// Adds a function that always returns the string specified by 'name'
 /// </summary>
 /// <param name="m">The instance of the class</param>
 /// <param name="name"></param>The string to be unconditionally returned
 /// <returns>The instance of the class</returns>
 public static ClassAndStyleMapper Add(this ClassAndStyleMapper m, string name)
 {
     m.Items.Add(() => name);
     return(m);
 }