// builds either the sing disk or, if given the complete hierarchy public void BakePie(bool isVisible) { Visible = isVisible; if (rootRecipe.subList != null && (rootRecipe.subList.Count > 0)) { // build full pie! for (int i = 0; i < rootRecipe.subList.Count; i++) { PieRecipeItem pieRecipeSlice = rootRecipe.subList[i]; PieMenuSlice slice = new PieMenuSlice(pieRecipeSlice); AddSlice(slice); if (pieRecipeSlice.subList != null && pieRecipeSlice.subList.Count > 0) { // this is a "group node" with another pie structure below PieDisk fullPie = new PieDisk(this, pieRecipeSlice); slice.subDisk = fullPie; subList.Add(fullPie); fullPie.BakePie(false); //subList[subList.Count - 1].BakePie(false); } } } else if (slices.Count == 0) { // something whent wrong.. we have nothing to build! return; } if (Visible) { BuildSlices(); } }
private void BuildAllSlices() { bool drawPie = false; Debug.Assert(rootDisk != null); if (CurrentDiskNo == 0) { drawPie = true; } activeDisk = rootDisk; // build pie slices rootDisk.BakePie(drawPie); }