Advertisement
Guest User

Untitled

a guest
Dec 1st, 2015
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. private void transitionConst(Corale.Colore.Core.Color col1, Corale.Colore.Core.Color col2, bool forward)
  2. {
  3. int i = 1;
  4. while (state == 1)
  5. {
  6. if (i == 1)
  7. {
  8. for (uint c = 0; c < Corale.Colore.Razer.Keyboard.Constants.MaxColumns; c++)
  9. {
  10. for (uint r = 0; r < Corale.Colore.Razer.Keyboard.Constants.MaxRows; r++)
  11. {
  12. if (state != 1) { break; }
  13. var row = (forward) ? r : Corale.Colore.Razer.Keyboard.Constants.MaxRows - r - 1;
  14. var colu = (forward) ? c : Corale.Colore.Razer.Keyboard.Constants.MaxColumns - c - 1;
  15. try {
  16. Keyboard.Instance[row, colu] = Corale.Colore.Core.Color.FromSystemColor(col1);
  17. }
  18. catch (Exception ex)
  19. {
  20. Debug.WriteLine(ex.Message);
  21. }
  22.  
  23. }
  24. Thread.Sleep(40);
  25. }
  26. i = 2;
  27. }
  28. else if (i == 2)
  29. {
  30. for (uint c = 0; c < Corale.Colore.Razer.Keyboard.Constants.MaxColumns; c++)
  31. {
  32. for (uint r = 0; r < Corale.Colore.Razer.Keyboard.Constants.MaxRows; r++)
  33. {
  34. if (state != 1) { break; }
  35. var row = (forward) ? r : Corale.Colore.Razer.Keyboard.Constants.MaxRows - r - 1;
  36. var colu = (forward) ? c : Corale.Colore.Razer.Keyboard.Constants.MaxColumns - c - 1;
  37. try
  38. {
  39. Keyboard.Instance[row, colu] = Corale.Colore.Core.Color.FromSystemColor(col2);
  40. }
  41. catch (Exception ex)
  42. {
  43. Debug.WriteLine(ex.Message);
  44. }
  45. }
  46. Thread.Sleep(40);
  47. }
  48. i = 1;
  49. }
  50. }
  51. if (RzWeatherCycle.IsAlive)
  52. {
  53. RzWeatherCycle.Abort();
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement