protected override string WriteSelfStartTag(System.IO.TextWriter writer, IBootstrapContext context) { var tb = context.CreateTagBuilder("fieldset"); if (DisabledValue) { tb.MergeAttribute("disabled", "disabled"); } ApplyCss(tb); ApplyAttributes(tb); tb.WriteStartTag(writer); if (LegendValue != null) { LegendValue.WriteTo(writer, context); } return("</fieldset>"); }
private void UpdateFilterResultsForCategoryFromLegend(GameObject legendObject, string field, string category) { if (legendObject == null) { return; } List <string> visibleCategories = new List <string>(); for (int i = 0; i < legendObject.transform.childCount; i++) { LegendValue legendValue = legendObject.transform.GetChild(i).gameObject.GetComponent <LegendValue>(); if (legendValue != null) { Transform box = legendObject.transform.GetChild(i).Find("Title/CheckBox"); HoloToolkit.Examples.InteractiveElements.InteractiveToggle toggle = box.gameObject.GetComponent <HoloToolkit.Examples.InteractiveElements.InteractiveToggle>(); // BUG: HasSelection is not up-to-date upon calling this function!!! if (toggle.HasSelection) { visibleCategories.Add(legendValue.categoryName); } } } Debug.Log("Updating filter results for field, category " + field + ", " + category); List <bool> res = filterResults[field]; for (int b = 0; b < res.Count; b++) { if (visibleCategories.Contains(targetVis.markInstances[b].GetComponent <Mark>().datum[field])) { res[b] = true; } else { res[b] = false; } } filterResults[field] = res; if (targetVis.GetIsLinked()) { for (int i = 0; i < DxRVisObjects.Length; i++) { if (DxRVisObjects[i].GetComponent <Vis>().GetIsLinked()) { if (DxRVisObjects[i].GetComponent <Vis>().GetDataName() == targetVis.GetDataName()) { GameObject DxRInteraction = DxRVisObjects[i].transform.Find("DxRInteractions").gameObject; List <bool> t_res = new List <bool>(new bool[res.Count]); if (!DxRInteraction.GetComponent <Interactions>().filterResults.ContainsKey(field)) { DxRInteraction.GetComponent <Interactions>().filterResults.Add(field, t_res); } for (int b = 0; b < t_res.Count; b++) { if (visibleCategories.Contains(DxRVisObjects[i].GetComponent <Vis>().markInstances[b].GetComponent <Mark>().datum[field])) { t_res[b] = true; } else { t_res[b] = false; } } DxRInteraction.GetComponent <Interactions>().filterResults[field] = t_res; DxRVisObjects[i].GetComponent <Vis>().FiltersUpdated(); } } } } // if (targetVis.GetIsLinked()) Synchronize(field); }