Beispiel #1
0
        public void SetProgressbarState(Bunifu.Framework.UI.BunifuCircleProgressbar target, bool value)
        {
            foreach (var progressbar in this.progressbars)
            {
                if (target != progressbar && value == false)
                {
                    continue;
                }

                progressbar.Invoke(new MethodInvoker(delegate()
                {
                    var old = progressbar.animated;
                    progressbar.animated = false;

                    if (progressbar == target)
                    {
                        progressbar.animated = value;
                    }
                    else
                    {
                        progressbar.animated = old;
                    }
                }));
            }
        }
        public void Read_Excel(string Path, int NumberOFTrail, int NumberOfStages = 16)
        {
            Excel  excel_File  = new Excel(Path, 1);
            string Cell_value  = "";
            string Circle_Name = "bunifuCircleProgressbar";
            string Label_Name  = "Class_";

            if (NumberOfStages == 16)
            {
                for (int j = 0; j < 18; j++)
                {
                    Cell_value = excel_File.Read_Cell(j, NumberOFTrail);
                    double d = Convert.ToDouble(Cell_value);
                    if (j < 16)
                    {
                        Bunifu.Framework.UI.BunifuCircleProgressbar Circle = (BunifuCircleProgressbar)this.Controls[Circle_Name + j];
                        Circle.Value = Convert.ToInt32(d);
                    }
                    this.Controls[Label_Name + (j + 1)].Text = string.Format("{0:0.00}", d) + "%";
                }
            }

            else
            {
                First_Stage_Label.Visible = true;
                Cat1.Visible    = true;
                Cat2.Visible    = true;
                Cat3.Visible    = true;
                Cat4.Visible    = true;
                Cat5.Visible    = true;
                Cat6.Visible    = true;
                Cat7.Visible    = true;
                label21.Visible = true;
                label22.Visible = true;
                label23.Visible = true;
                label24.Visible = true;
                label25.Visible = true;
                label26.Visible = true;
                label18.Visible = true;

                for (int j = 0; j < 18; j++)
                {
                    Cell_value = excel_File.Read_Cell(j, (NumberOFTrail * 2) + 1);
                    double d = Convert.ToDouble(Cell_value);
                    if (j < 16)
                    {
                        Bunifu.Framework.UI.BunifuCircleProgressbar Circle = (BunifuCircleProgressbar)this.Controls[Circle_Name + j];
                        Circle.Value = Convert.ToInt32(d);
                    }
                    this.Controls[Label_Name + (j + 1)].Text = string.Format("{0:0.00}", d) + "%";
                }
                string Cat_Label = "Cat";
                for (int k = 0; k < 7; k++)
                {
                    Cell_value = excel_File.Read_Cell(k, NumberOFTrail * 2);
                    double d = Convert.ToDouble(Cell_value);
                    string l = Cat_Label + (k + 1).ToString();
                    //MessageBox.Show(l);
                    this.Controls[l].Text = string.Format("{0:0.00}", d) + "%";
                }
            }
            excel_File.Wb.Close();
            // bunifuCircleProgressbar10.Value =Convert.ToInt32(excel_File.Read_Cell(1, 0));
        }