2024-07-20 23:44:59 -04:00

48 lines
1.4 KiB
C#

namespace MBS.Web;
public class CssClassList : List<string>
{
//
// Summary:
// Initializes a new instance of the System.Collections.Generic.List`1 class that
// is empty and has the default initial capacity.
public CssClassList() : base() { }
//
// Summary:
// Initializes a new instance of the System.Collections.Generic.List`1 class that
// contains elements copied from the specified collection and has sufficient capacity
// to accommodate the number of elements copied.
//
// Parameters:
// collection:
// The collection whose elements are copied to the new list.
//
// Exceptions:
// T:System.ArgumentNullException:
// collection is null.
public CssClassList(IEnumerable<string> collection) : base(collection) { }
//
// Summary:
// Initializes a new instance of the System.Collections.Generic.List`1 class that
// is empty and has the specified initial capacity.
//
// Parameters:
// capacity:
// The number of elements that the new list can initially store.
//
// Exceptions:
// T:System.ArgumentOutOfRangeException:
// capacity is less than 0.
public CssClassList(int capacity) : base(capacity) { }
public new void Add(string value)
{
string[] vals = value.Split(new char[] { ' ' });
foreach (string val in vals)
{
string v = val.Trim();
if (!String.IsNullOrEmpty(v))
base.Add(val.Trim());
}
}
}