static bool gapFillCondition(exFile root, gapFillSets set) { if (!root.statNames.Contains("gap_fill")) return true; //neobsahuje zadny gapfill, pak je OK //obsahuje gapfill: return simpleGapFill_(root, set); //kontrola gafill atributu }
//*********************** simpleGapFill static bool simpleGapFill_(exFile root, gapFillSets set) { var gapFills = root.statControls.Where(e => e.Name.LocalName == "gap_fill").ToArray(); if (gapFills.Length == 0) return false; var atts = gapFills.SelectMany(gapFill => gapFill.Attributes()).Select(a => a.Name.LocalName).Distinct().ToArray(); return (atts.All(at => { //if (at == "group_eval" /*|| at == "width"*/) return false; if ((set & gapFillSets.dragSource) == 0 && at == "drag_source") return false; if ((set & gapFillSets.initExample) == 0 && (at == "init_value" || at == "example" || at == "width" || at == "group_eval")) return false; return true; })); }