123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace _07_1_Delegacje
- {
- public partial class Form1 : Form
- {
- Robocza r = new Robocza();
- p1 ppp;
- funS fff;
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- ppp = r.ProxX;
- }
- private void button2_Click(object sender, EventArgs e)
- {
- ppp = r.ProxY;
- }
- private void button3_Click(object sender, EventArgs e)
- {
- ppp = Robocza.ProxZ;
- }
- private void button4_Click(object sender, EventArgs e)
- {
- if (ppp != null)
- ppp();
- else
- MessageBox.Show("ppp jest null'em!");
- }
- private void button5_Click(object sender, EventArgs e)
- {
- ppp?.Invoke();
- }
- private void button8_Click(object sender, EventArgs e)
- {
- ppp = new p1(r.ProxX);
- }
- private void button7_Click(object sender, EventArgs e)
- {
- ppp = new p1(r.ProxY);
- }
- private void button6_Click(object sender, EventArgs e)
- {
- ppp = new p1(Robocza.ProxZ);
- }
- private void button11_Click(object sender, EventArgs e)
- {
- ppp += r.ProxX;
- }
- private void button10_Click(object sender, EventArgs e)
- {
- ppp += r.ProxY;
- }
- private void button9_Click(object sender, EventArgs e)
- {
- ppp += Robocza.ProxZ;
- }
- private void button14_Click(object sender, EventArgs e)
- {
- ppp -= r.ProxX;
- }
- private void button13_Click(object sender, EventArgs e)
- {
- ppp -= r.ProxY;
- }
- private void button12_Click(object sender, EventArgs e)
- {
- ppp -= Robocza.ProxZ;
- }
- Random rnd = new Random((int)DateTime.Now.Ticks);
- private void button15_Click(object sender, EventArgs e)
- {
- if (rnd.NextDouble() < 0.5)
- fff = r.fs1;
- else
- fff = r.fs2;
- }
- private void button17_Click(object sender, EventArgs e)
- {
- if (rnd.NextDouble() < 0.5)
- fff += r.fs1;
- else
- fff += r.fs2;
- }
- private void button16_Click(object sender, EventArgs e)
- {
- int i = rnd.Next(1000);
- double d = rnd.NextDouble() * 100;
- DateTime t = new DateTime(2024, 4, rnd.Next(31));
- string s = $"Ala ma kota ({new DateTime(rnd.Next(2000000000))})";
- label1.Text = fff?.Invoke(i, d, t, s );
- }
-
- }
- }
|