/// <summary> /// Adds a sequence of Css classes to a <see cref="UserControl"/> if it is not specified. /// </summary> /// <param name="control">The control to check.</param> /// <param name="cssClasses">Sequence of Css classes to add.</param> /// <exception cref="ArgumentNullException">thrown if <paramref name="cssClasses"/> is <c>Null</c> or <c>Empty</c>.</exception> public static void AddCssClasses(this UserControl control, params string[] cssClasses) { if (cssClasses.IsNullOrEmpty()) { throw new ArgumentNullException("cssClasses"); } cssClasses.Distinct().ForEachAsParallel(cssClass => control.AddCssClass(cssClass)); }