Exemple #1
0
        private void setUpDoughnut(string param)
        {
            String[] ShapeParam = param.Split(' ');
            double   degree     = double.Parse(ShapeParam[2]);
            double   height     = double.Parse(ShapeParam[3]);
            double   centerPos  = double.Parse(ShapeParam[5]);

            this.testDoughnut = new Doughnut(centerPos - degree / 2, centerPos + degree / 2, height, false);
            this.testDoughnut.SetValue(Canvas.LeftProperty, (double)150);
            this.testDoughnut.SetValue(Canvas.TopProperty, (double)100);
            this.mycanvas.Children.Add(testDoughnut);
        }
Exemple #2
0
        List <Doughnut> buildDonuts(int numofDonuts)
        {
            List <Doughnut> Doughnutlist = new List <Doughnut>();

            for (int i = 1; i <= numofDonuts; i++)
            {
                Doughnut myDonut = new Doughnut((i - 1) * 360.0 / numofDonuts, i * 360.0 / numofDonuts, 20, true);
                myDonut.SetValue(Canvas.LeftProperty, (double)150);
                myDonut.SetValue(Canvas.TopProperty, (double)100);
                mycanvas.Children.Add(myDonut);
                Doughnutlist.Add(myDonut);
            }
            return(Doughnutlist);
        }