private void OnMapViewDrawStatusChanged(object sender, DrawStatus e) { // Make sure that the UI changes are done in the UI thread BeginInvokeOnMainThread(() => { // Show the activity indicator if the map is drawing if (e == DrawStatus.InProgress) _activityIndicator.Hidden = false; else _activityIndicator.Hidden = true; }); }
protected void PaintStatus(Graphics g, Rectangle rect, DrawStatus drawStatus, string iconName, string caption) { var captionBrush = new SolidBrush(Color.White); Color captionColor; String iconPostfix; String barPostfix; switch (drawStatus) { case DrawStatus.On : captionColor = Color.White; iconPostfix = "_on"; barPostfix = "_on"; break; case DrawStatus.Off : captionColor = Color.DarkGray; iconPostfix = "_off"; barPostfix = "_off"; break; default: captionColor = Color.White; iconPostfix = "_on"; barPostfix = "_error"; break; } // draw status indicator DrawResourceImage(g, rect.Left, rect.Bottom - BarSize, rect.Width, BarSize, "bar" + barPostfix); var iconTop = rect.Top + (rect.Height - IconSize - BarSize)/2; // draw additional caption if (!String.IsNullOrEmpty(caption)) { var captionFont = new Font(MetroTheme.PhoneFontFamilySemiLight, 7.ToLogic(), FontStyle.Bold); captionBrush.Color = captionColor; var captionSize = g.MeasureString(caption, captionFont); g.DrawString(caption, captionFont, captionBrush, rect.Left + (rect.Width - captionSize.Width) / 2, iconTop + IconSize - 12.ToPixels()); iconTop -= ScreenRoutines.Scale(6); } // draw main status icon DrawResourceImage(g, (rect.Left + rect.Right - IconSize) / 2, iconTop, IconSize, IconSize, iconName + iconPostfix); }
private void OnDrawStatusChanged(object sender, DrawStatus e) { // Make sure that the UI changes are done in the UI thread RunOnUiThread(() => { // Show the activity indicator if the map is drawing if (e == DrawStatus.InProgress) { _activityIndicator.SetMessage("Drawing is in progress"); _activityIndicator.Show(); } else _activityIndicator.Hide(); }); }
private void OnDrawStatusChanged(object sender, DrawStatus e) { // Make sure that the UI changes are done in the UI thread Device.BeginInvokeOnMainThread(() => { // Show the activity indicator if the map is drawing if (e == DrawStatus.InProgress) { activityIndicator.IsRunning = true; } else { activityIndicator.IsRunning = false; } }); }
private void setDrawStatus() { if (chBoxDrawTerrain3D.Checked && chBoxDrawPoints.Checked) { drawStatus = DrawStatus.DRAW_TERRAIN_3D_POINTS; } else if (chBoxDrawTerrain3D.Checked) { drawStatus = DrawStatus.DRAW_TERRAIN_3D; } else if (chBoxDrawPoints.Checked) { drawStatus = DrawStatus.DRAW_POINTS; } else { drawStatus = DrawStatus.NOT_DRAW; } }
private void Update() { switch (status) { case DrawStatus.Idle: break; case DrawStatus.Ready: { speed.current += speed.value * Time.deltaTime; euler += speed.current * Time.deltaTime; Rotate(euler); if (speed.current > speed.destination) { speed.current = speed.destination; status = DrawStatus.Rotate; } } break; case DrawStatus.Rotate: { euler += speed.current * Time.deltaTime; if (360 > euler) { } else { euler %= 360; number++; } Rotate(euler); if (number > circle && euler > display.origin) { status = DrawStatus.Display; } } break; case DrawStatus.Display: { step.current += step.value * Time.deltaTime; euler = Mathf.Lerp(display.origin + display.value * step.current, display.destination, step.current); Rotate(euler); if (step.current > step.destination) { status = DrawStatus.Complete; } } break; case DrawStatus.Complete: { Complete(); status = DrawStatus.Idle; } break; } }
public void SetDrawStatus(DrawStatus s) { drawStatus = s; }
private void SelectWinner() { buttonStop.IsEnabled = false; //Random random = new Random(); //finalValue = random.Next(100000); Candidate cdt = _logic.DoDraw(); if (cdt != null) { finalValueDesc = cdt.Id.Trim() + " " + cdt.Name.Trim(); string winnerId = cdt.Id.Trim(); //i-user only has 7 chars isIUser = false; if (winnerId.Length == 7) { isIUser = true; winnerId += "0"; } //change user char to number string idChar = winnerId.Substring(0, 1).ToLower(); winnerId = dictIdChar[idChar] + winnerId.Substring(1); finalValue = Convert.ToInt32(winnerId); //remove first char //numberGroupMain.TurnStop(finalValue);//stop //stop the 2, 3 & 4 number immediatly //get the number TurnStopAt(2); TurnStopAt(3); TurnStopAt(4); stopTimer.Start(); winnerTimer.Start(); drawStatus = DrawStatus.STOPPING; } else { showCannotDrawMsg(); numberGroupMain.TurnStop(finalValue);//stop winnerTimer.Stop(); drawStatus = DrawStatus.STOPPED; } }
private void StartDraw() { if (!_logic.IsAbleToDraw()) { showCannotDrawMsg(); return; } numberGroupMain.HideNumberAt(lastNumberItem, false); buttonStart.IsEnabled = false; buttonStop.IsEnabled = true; numberGroupMain.TurnStart(); lbWinner.Content = ""; winnerTimer.Stop(); stopCounter = delayStopFrom; drawStatus = DrawStatus.RUNNING; }
//timer tick void timer_Tick(object sender, EventArgs e) { if (isAllTurnStopped && numberGroupMain.IsStoped()) { stopTimer.Stop(); lbWinner.Content = finalValueDesc; winnerTimer.Stop(); buttonStart.IsEnabled = true; //hide last number for i-user if (isIUser) { numberGroupMain.HideNumberAt(lastNumberItem, true); } ShowAnimation(); drawStatus = DrawStatus.STOPPED; isAllTurnStopped = false; LogHelper.INFO("End draw"); } }