/// <summary> /// 生成CSS字串 /// </summary> /// <returns></returns> public string Build() { CssList = CssAdd.Except(CssRemove).ToList(); var result = string.Join(" ", CssList); return(result); }
/// <summary> /// 生成CSS字串 /// </summary> /// <returns></returns> public CssBuild Build() { var list = CssAdd.Except(CssRemove).ToList(); CssList.Clear(); CssList.AddRange(list); return(this); }
/// <summary> /// 添加 css列表 /// </summary> /// <param name="css"></param> /// <returns></returns> public CssBuild Add(IList <string> css, bool condition = true) { if (!condition) { return(this); } var list = CssAdd.Union(css).ToList(); CssAdd.Clear(); CssAdd.AddRange(list); return(this); }
/// <summary> /// 开关 Css 项目 /// </summary> /// <param name="css"></param> /// <param name="condition"></param> /// <returns></returns> public CssBuild Toggle(IList <string> css, bool condition = true) { if (!condition) { return(this); } var cRemove = CssAdd.Intersect(css).ToList(); var cAdd = CssRemove.Intersect(css).ToList(); CssAdd.AddRange(cAdd); CssRemove.AddRange(cRemove); return(this); }
public CssBuild Reset() { CssAdd.Clear(); CssRemove.Clear(); return(this); }
/// <summary> /// 添加 css列表 /// </summary> /// <param name="css"></param> /// <returns></returns> public CssBuild Add(List <string> css) { CssAdd = CssAdd.Union(css).ToList(); return(this); }