Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Random random = new Random();
            dlg    mydlg  = (x, y, z) => { return((x + y + z) / 3); };

            Console.WriteLine("Среднее арифметическое: " + mydlg(random.Next(), random.Next(), random.Next()));
            Console.ReadKey();
        }
Exemplo n.º 2
0
 private void status_Load(object sender, EventArgs e)
 {
     progressBar1.Value             = 0;
     progressBar1.Minimum           = 0;
     progressBar1.Maximum           = 567777;
     progressBar1.Step              = 1;
     Worker.Instance.UpdateCounter += Instance_UpdateCounter;
     dlgFunc = Instance_UpdateCounter;
 }
Exemplo n.º 3
0
        public static int Initialize(dlg funcDelegate)
        {
            string resultValue = null;
            var    result      = new returnString((s) => {
                resultValue = s;
                return(120);
            });

            Console.WriteLine(funcDelegate(result));
            Console.WriteLine(resultValue);
            return(150);
        }
Exemplo n.º 4
0
        public void RunDelegateMethod()
        {
            dlg dlgObj = new dlg(DLG);

            dlgObj(100);
        }