Form1.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace _04_1_Metody
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18. Robo r = new Robo();
  19. private void button1_Click(object sender, EventArgs e)
  20. {
  21. int i = 123;
  22. string s = "Ala ma kota";
  23. bool b = false;
  24. //MessageBox.Show($"Przed Met01: i: {i} s: {s} b: {b}");
  25. r.Met01(i, s, b);
  26. MessageBox.Show($"Po Met01: i: {i} s: {s} b: {b}");
  27. }
  28. private void button2_Click(object sender, EventArgs e)
  29. {
  30. int i = 123;
  31. string s = "Ala ma kota";
  32. bool b = false;
  33. MessageBox.Show($"Przed Met02: i: {i} s: {s} b: {b}");
  34. r.Met02(ref i, ref s, ref b);
  35. MessageBox.Show($"Po Met02: i: {i} s: {s} b: {b}");
  36. }
  37. private void button3_Click(object sender, EventArgs e)
  38. {
  39. int i = 123;
  40. string s = "Ala ma kota";
  41. bool b = false;
  42. MessageBox.Show($"Przed Met03: i: {i} s: {s} b: {b}");
  43. r.Met03(out i, out s, out b);
  44. MessageBox.Show($"Po Met03: i: {i} s: {s} b: {b}");
  45. }
  46. private void button4_Click(object sender, EventArgs e)
  47. {
  48. double[] d = new double[10];
  49. d[0] = Math.PI;
  50. Class1 c = new Class1();
  51. c.d = DateTime.Now;
  52. c.t = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  53. c.S = "Ala ma kota";
  54. DateTime dt = new DateTime(2025, 1, 1);
  55. MessageBox.Show($"Przed Met04: d[0]: {d[0]} c.t[0]: {c.t[0]} c.d: {c.d} dt: {dt}");
  56. r.Met04(d, c, dt);
  57. MessageBox.Show($"Po Met04: d[0]: {d[0]} c.t[0]: {c.t[0]} c.d: {c.d} dt: {dt}");
  58. }
  59. private void button5_Click(object sender, EventArgs e)
  60. {
  61. double[] d = new double[10];
  62. d[0] = Math.PI;
  63. Class1 c = new Class1();
  64. c.d = DateTime.Now;
  65. c.t = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  66. c.S = "Ala ma kota";
  67. DateTime dt = new DateTime(2025, 1, 1);
  68. MessageBox.Show($"Przed Met05: d[0]: {d[0]} c.t[0]: {c.t[0]} c.d: {c.d} dt: {dt}");
  69. r.Met05(ref d, ref c, ref dt);
  70. MessageBox.Show($"Po Met05: d[0]: {d[0]} c.t[0]: {c.t[0]} c.d: {c.d} dt: {dt}");
  71. }
  72. private void button6_Click(object sender, EventArgs e)
  73. {
  74. double r = 100;
  75. double P = Robo.ObliczPiRKwadrat(r);
  76. MessageBox.Show($"Pole okręgu o promieniu {r}: {P}");
  77. //Robo.metodaStat(0, 0, "", DateTime.Now, new decimal[] { 325, 2356, 21354 }, new Class1());
  78. }
  79. private void button7_Click(object sender, EventArgs e)
  80. {
  81. string s = "Ala ma kota";
  82. s = s.Bez3PierwszychiOstatnich();
  83. MessageBox.Show(s);
  84. Class1 c = new Class1();
  85. c.d = DateTime.Now;
  86. MessageBox.Show($"{Ext.DodajDoDtDni(c.d, 3)}");
  87. MessageBox.Show($"{c.DodajDoDtDni(3)}");
  88. }
  89. private void button8_Click(object sender, EventArgs e)
  90. {
  91. //Class2 c2 = new Class2();
  92. //Class2 c2b = new Class2("Ala ma kota...", new DateTime(1999,1,1), null, 667);
  93. Class2 c2c = new Class2("Ala ma kota...", new DateTime(1999, 1, 1), null, 667, 1975);
  94. }
  95. }
  96. }