static ICssValue Extract(Tuple <ICssValue, ICssValue> src, Int32 index) { var hv = src.Item1; var vv = src.Item2; var h = hv as CssValueList; var v = vv as CssValueList; if (h != null) { hv = Find(h, index); } if (vv == null) { return(hv); } var value = new CssValueList(); value.Add(hv); if (v != null) { vv = Find(v, index); } value.Add(vv); return(value); }
static ICssValue Transform(Tuple <BgLayer[], FinalBgLayer> data, Func <BgLayer, ICssValue> selector) { var final = new BgLayer(data.Item2.Item1, data.Item2.Item2, data.Item2.Item3, data.Item2.Item4, data.Item2.Item5, data.Item2.Item6); if (data.Item1.Length == 0) { return(selector(final)); } var list = new CssValueList(); foreach (var item in data.Item1) { list.Add(selector(item)); } list.Add(selector(final)); return(list); }
protected static Boolean ExpandPeriodic(CssValueList list) { if (list.Length == 0 || list.Length > 4) { return(false); } if (list.Length == 1) { list.Add(list[0]); } if (list.Length == 2) { list.Add(list[0]); } if (list.Length == 3) { list.Add(list[1]); } return(true); }