示例#1
0
        private void StartButton_Click(object sender, EventArgs e)
        {
            Ubit          = new Bitmap(myPictureBox.Size.Width, myPictureBox.Size.Height);
            LoadBar.Value = 0;

            for (int i = 0; i < 50; i++)
            {
                //while (true)
                //{
                CntrLbl.Text = poligonList.Count.ToString();
                try
                {
                    poligon = new Triangle(myPictureBox, Dbit);
                }
                catch (ArgumentOutOfRangeException)
                {
                    continue;
                }

                foreach (Triangle t in poligonList)
                {
                    PointF[] points = new PointF[3];
                    points = t.InitPoligon();

                    g = Graphics.FromImage(Ubit);
                    g.FillPolygon(new SolidBrush(t.color), points);
                }
                myPictureBox.Refresh();
                myPictureBox.Image = Ubit;


                //PixelCntr[1] = 0;
                //for (int x = 0; x < 574; x++)
                //    for (int y = 0; y < 558; y++)
                //    {
                //        try
                //        {
                //            if (Dbit.GetPixel(x, y) == Ubit.GetPixel(x, y))
                //            {
                //                PixelCntr[1]++;
                //            }
                //        }
                //        catch (ArgumentOutOfRangeException)
                //        {
                //            continue;
                //        }

                //    }

                //if (PixelCntr[0] <= PixelCntr[1])
                //{
                poligonList.Add(poligon);
                //    PixelCntr[0] = PixelCntr[1];
                LoadBar.Increment(1);

                //    break;
                //}
                //}
            }
        }
示例#2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            DoubleAnimation da = new DoubleAnimation
            {
                From     = 0,
                To       = 450,
                Duration = TimeSpan.FromSeconds(5)
            };

            LoadBar.BeginAnimation(Border.WidthProperty, da);

            DispatcherTimer timer = new DispatcherTimer();

            timer.Interval = TimeSpan.FromSeconds(0.045);
            int count = 0;
            int max   = 100;

            timer.Tick += new EventHandler((o, ev) => {
                count++;
                LoadText.Content = count + "%";

                if (count == max)
                {
                    LoadedText.Content = "Загрузка завершена!";
                    timer.Stop();
                }
            });
            timer.Start();
        }
示例#3
0
 private async void Download_btn_Click(object sender, EventArgs e)
 {
     music_list.Hide();
     if (account.IsAuthorized)
     {
         try
         {
             this.Hide();
             this.title_btn_general.Text = new string(' ', 4) + download_btn.Text;
             LoadBar bar = new LoadBar(Properties.Resources.WhileDownloadingText + " \n\r        Plaese Wait...");
             bar.Font         = new Font("Segoe UI", 24f);
             bar.TextPosition = new Point(154, 460);
             bar.Show();
             Task t = new Task(() =>
             {
                 Client.DownloadAllMusic();
             });
             t.Start();
             await t;
             bar.Close();
             MusicMessageBox box = new MusicMessageBox();
             box.ShowWindow(this, MessageFlags.Success);
             box.Show();
             downloaded = true;
         }
         catch (Exception ex)
         {
             MusicMessageBox box = new MusicMessageBox();
             box.Show();
             box.ShowWindow(this, ex.Message);
         }
     }
 }
        private void tbx_codigoPartida_TextChanged(object sender, EventArgs e)
        {
            if (tbx_codigoPartida.Text.Length == 4)
            {
                ds = objNegoListener.N_Listener_Comando(1);
                dt = ds.Tables[0];

                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["codigoProfe"].ToString() == tbx_codigoPartida.Text)
                    {
                        //empieza a detectar cuando el profesor inicia la partida
                        timer_waitingToStart.Start();

                        // optener los settings del PROFE
                        Get_SettingsFromDatabase();

                        objEntidadAlumno.Estado = "True";
                        objNegoAlumno.N_Editar(objEntidadAlumno, objEntidad);

                        circularProgressBar.ProgressColor = Color.FromArgb(252, 195, 26);
                        LoadBar.Start();

                        tbx_codigoPartida.Enabled = false;
                        cbx_codigo.Checked        = true;
                    }
                    else
                    {
                        objEntidadAlumno.Estado = "False";
                        objNegoAlumno.N_Editar(objEntidadAlumno, objEntidad);
                        cbx_codigo.Checked = false;
                    }
                }
            }
        }
        private void timer2Start_Tick(object sender, EventArgs e)
        {
            LoadBar.Stop(); // detener label Esperando
            circularProgressBar.Font = new Font(circularProgressBar.Font.Name, 40f, circularProgressBar.Font.Style, circularProgressBar.Font.Unit);

            if (countDown > 0)
            {
                countDown--;
                circularProgressBar.Text = countDown.ToString();
            }
            else
            {
                timer2Start.Stop();


                ds = objNegoListener.N_Listener_Comando(1);
                dt = ds.Tables[0];

                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["codigoProfe"].ToString() == tbx_codigoPartida.Text)
                    {
                        this.Hide();
                        P_focusedBible_SOLO_y_PARTIDA soloMain = new P_focusedBible_SOLO_y_PARTIDA(objEntidad, objEntidadAlumno);
                        soloMain.Show();
                    }
                    else
                    {
                        lab_anuncio_1.Text        = "SE ACABA DE QUEDAR FUERA DE LA PARTIDA";
                        lab_anuncio_2.Text        = "SE ACABA DE QUEDAR FUERA DE LA PARTIDA";
                        tbx_codigoPartida.Enabled = false;
                    }
                }
            }
        }
 private void timer1_Tick(object sender, EventArgs e)
 {
     LoadBar.Increment(1);
     if (LoadBar.Value == 100)
     {
         timer1.Stop(); // if progressbar reaches 100 timer will stop
     }
 }
示例#7
0
    void IniciarCarregamento(Scene cena, LoadSceneMode mode)
    {
        loadBar = FindObjectOfType <LoadBar>();

        SceneManager.LoadSceneAsync("comunsDeFase", LoadSceneMode.Additive);
        SceneManager.sceneLoaded -= IniciarCarregamento;
        SceneManager.sceneLoaded += CarregouComuns;
    }
示例#8
0
 private void Login_Load(object sender, EventArgs e)
 {
     Buscar_Registro();
     circularProgressBar.Value   = 0;
     circularProgressBar.Minimum = 0;
     circularProgressBar.Maximum = 100;
     reproducirSonido("system_Load.wav", false);
     LoadBar.Start();
 }
示例#9
0
 void Awake()
 {
     Color color = Color.white;
     color.a = 0;
     logo.GetComponent<SpriteRenderer>().color = color;
     loadBarScript = loadBar.GetComponent<LoadBar>();
     button.enabled = false;
     //Screen.SetResolution(900, 600, false);
 }
示例#10
0
        private static void FakeLoad(LoadBar loadBar)
        {
            while (!loadBar.IsFinished)
            {
                loadBar.CurrentValue++;
                Thread.Sleep(_random.Next(10, 100));
            }

            Console.WriteLine("Done loading!");
        }
示例#11
0
    void Awake()
    {
        Color color = Color.white;

        color.a = 0;
        logo.GetComponent <SpriteRenderer>().color = color;
        loadBarScript  = loadBar.GetComponent <LoadBar>();
        button.enabled = false;
        //Screen.SetResolution(900, 600, false);
    }
示例#12
0
    void Awake()
    {
        Color color = Color.white;

        color.a = 0;
        logo.GetComponent <SpriteRenderer>().color = color;

        loadbarClass   = loadBar.GetComponent <LoadBar>();
        button.enabled = false;

        loadingLayer.SetActive(false);
    }
示例#13
0
    private void IniciarCarregamento(Scene arg0, LoadSceneMode arg1)
    {
        if (SceneManager.GetSceneByName(NomesCenasEspeciais.menuInicial.ToString()).isLoaded)
        {
            SceneManager.UnloadSceneAsync(NomesCenasEspeciais.menuInicial.ToString());
        }

        loadBar = FindObjectOfType <LoadBar>();

        AditiveLoadScene(NomesCenasEspeciais.ComunsDeFase);
        SceneManager.sceneLoaded -= IniciarCarregamento;
        SceneManager.sceneLoaded += CarregouComuns;
    }
示例#14
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Welcome.\r\nHere's the default load bar.");

            var loadBar = new LoadBar();

            FakeLoad(loadBar);

            var builder = LoadBarBuilder.Create()
                          .AddStyle(LoadBarStyles.Percentage);

            Console.WriteLine("This load bar only displays the progress percentage.");
            loadBar = new LoadBar(builder);
            FakeLoad(loadBar);


            builder = builder
                      .AddStyle(LoadBarStyles.All)
                      .SetClearWhenFinished(true);

            Console.WriteLine("This load bar has all styles applied, and clears when it is finished.");
            loadBar = new LoadBar(builder);
            FakeLoad(loadBar);

            builder = LoadBarBuilder.Create()
                      .SetStyles(LoadBarStyles.Bar | LoadBarStyles.Percentage)
                      .SetBarWidth(80)
                      .SetBarMaterial('-');

            Console.WriteLine("This bar has a custom width and material.");
            loadBar = new LoadBar(builder);
            FakeLoad(loadBar);

            builder = LoadBarBuilder.Create()
                      .SetBarMaterial('|')
                      .SetBarWidth(50)
                      .SetBracketStyle(LoadBarBracketStyle.Angle)
                      .SetClearWhenFinished(true)
                      .SetStartValue(100)
                      .SetFinishValue(300)
                      .SetCurrentValue(125)
                      .SetStyles(LoadBarStyles.All);

            Console.WriteLine("This bar is all sorts of customized.");
            loadBar = new LoadBar(builder);
            FakeLoad(loadBar);

            // TODO: Fix issue with min/max set, add styles to show actual value (maybe out of finish value)

            Console.Read();
        }
示例#15
0
 private async void login_btn_Click(object sender, EventArgs e)
 {
     music_list.Hide();
     if (!account.IsAuthorized)
     {
         BassCore.Stop();
         PlayerDefaultSet(true);
         play_btn.Image = Properties.Resources.play_gray;
         using (var stream = new FileStream(Properties.Resources.UserDataJSONPath, FileMode.Open))
         {
             using (var stream2 = new FileStream(Properties.Resources.SecretUserJSONDataPath, FileMode.Open))
             {
                 using (var reader = new StreamReader(stream))
                 {
                     UserDataJSON = reader.ReadToEnd();
                     if (string.IsNullOrEmpty(UserDataJSON))
                     {
                         var form = new Sign_in_form(this);
                         form.Show();
                         this.Hide();
                         form.BringToFront();
                     }
                     else
                     {
                         LoadBar bar = new LoadBar();
                         this.Hide();
                         bar.Show();
                         SecretUserJSON = new StreamReader(stream2).ReadToEnd();
                         Client         = new VKManager();
                         Task t = new Task(() =>
                         {
                             account = Client.AuthentificateFromFile(UserDataJSON, SecretUserJSON);
                         });
                         t.Start();
                         await t;
                         this.Show();
                         RefreshLoginPanel();
                         bar.Close();
                     }
                 }
             }
         }
     }
     if (account.IsAuthorized && closed)
     {
         login_btn.Location   = new Point(0, 0);
         userPicture.Location = new Point(5, 0);
     }
     Refresh();
 }
示例#16
0
    void IniciarCarregamento(Scene cena, LoadSceneMode mode)
    {
        loadBar = FindObjectOfType <LoadBar>();

        if (cenaComum != NomesCenas.nula)
        {
            SceneManager.LoadSceneAsync(cenaComum.ToString(), LoadSceneMode.Additive);
            SceneManager.sceneLoaded -= IniciarCarregamento;
            SceneManager.sceneLoaded += CarregouComuns;
        }
        else
        {
            ComunsCarregado();
        }
    }
示例#17
0
        private void LoadBar_Tick_1(object sender, EventArgs e)
        {
            circularProgressBar.Text = Convert.ToString(circularProgressBar.Value) + "%";
            circularProgressBar.Increment(14);
            circularProgressBar.Update();

            i = i + 11;
            if (i >= 100)
            {
                LoadBar.Stop();
                Gbx_Login.Visible           = true;
                circularProgressBar.Visible = false;
                Tbx_User.Focus();
            }
        }
        //TODO: update options of select to
        //case OTHER = "Прочее"
        //case IT_COMPANY = "ИТ-Компания"
        //case PARTICIPANT = "Участник"
        //case MEDIA = "СМИ"

        //TODO: register user in conferecion

        private async void OnSubmit(object sender, RoutedEventArgs e)
        {
            _vm.Model.ValidateAll();
            if (_vm.Model.HasValidationMessages())
            {
                return;
            }

            try
            {
                LoadBar.SetProgressIndicator(true);
                await _vm.CreateUser();
            }
            finally
            {
                LoadBar.SetProgressIndicator(false);
            }
        }
示例#19
0
        private async void ButtonInversion_Click(object sender, EventArgs e)
        {
            // Will be called everyone inversion step
            var progressIndecator = new Progress <int>(i =>
            {
                LoadBar.Increment(1);

                var percent           = (int)(((double)(LoadBar.Value - LoadBar.Minimum) / (double)(LoadBar.Maximum - LoadBar.Minimum)) * 100);
                labelLoadPercent.Text = percent == 100 ? "" : $"{percent} %";

                if (LoadBar.Value == LoadBar.Maximum)
                {
                    LoadBar.Value = 0;
                }
            });

            await _invert.ChangePictureAsync(progressIndecator);
        }
        private int counter = 0; // contador para saber que tiempo esperar con la palabra "Esperando"


        private void P_Debate_Main_Load(object sender, EventArgs e)
        {
            SetDoubleBuffered(tableLayoutPanel6);
            SetDoubleBuffered(tableLayoutPanel7);
            SetDoubleBuffered(tableLayoutPanel8);
            SetDoubleBuffered(tableLayoutPanel10);
            SetDoubleBuffered(tableLayoutPanel8);
            SetDoubleBuffered(tableLayoutPanel19);
            SetDoubleBuffered(tableLayoutPanel20);
            SetDoubleBuffered(tableLayoutPanel21);


            LoadBar.Start();
            timer_waitingForFinalResults.Start(); // empieza a detectar si todos han terminado de jugar


            // Actualizar Estado Jugador en base de datos
            objEntidadAlumno.NombreUsuario = E_Usuario.Nombreusuario;
            objEntidadAlumno.Estado        = "True";
            objEntidadAlumno.Terminado     = "True";

            // actualiza y en caso de no existir lo inserta
            if (objNegoAlumno.N_Editar(objEntidadAlumno, objEntidad) == 0)
            {
                objNegoAlumno.N_Insertar(objEntidadAlumno, objEntidad);
            }

            dtListar = objNegoAlumno.N_listado();


            this.BackgroundImage  = Properties.Resources.Focused_bible_landing_01;
            BackgroundImageLayout = ImageLayout.Stretch;


            //actualizar imagen sonido
            if (objEntidad.enableButtonSound == true)
            {
                pbx_Sound.BackgroundImage = Properties.Resources.Sound_MouseLeave_ON;
            }
            else
            {
                pbx_Sound.BackgroundImage = Properties.Resources.Sound_MouseLeave_OFF;
            }
        }
 protected async override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     try
     {
         LoadBar.SetProgressIndicator(true);
         if (LoginButton.CurrentUser != null)
         {
             FetchUser(LoginButton.CurrentUser);
         }
         else if (Session.ActiveSession != null && Session.ActiveSession.CurrentAccessTokenData.State != null)
         {
             await RetriveUserInfo();
         }
     }
     finally
     {
         LoadBar.SetProgressIndicator(false);
     }
 }
示例#22
0
 private void IniciarCarregamentoComComuns(Scene arg0, LoadSceneMode arg1)
 {
     SceneManager.sceneLoaded -= IniciarCarregamentoComComuns;
     loadBar = FindObjectOfType <LoadBar>();
     ComunsCarregado();
 }