public HalloDelegate() { EinfacheDelegate meineDelegate = EinfacheMethode; Action meinDeleAlsAction = EinfacheMethode; Action meinDeleAlsActionAno = delegate() { Console.WriteLine("Hallooo"); }; Action meinDeleAlsActionAno2 = () => { Console.WriteLine("Hallooo"); }; Action meinDeleAlsActionAno3 = () => Console.WriteLine("Hallooo"); DelegateMitParameter meinDeleMitPara = MethodeMitPara; Action <string> meinDeletMitParaAlsAction = MethodeMitPara; Action <string> meinDeleMitParaAno = (string txt) => { Console.WriteLine(txt); }; Action <string> meinDeleMitParaAno2 = (txt) => Console.WriteLine(txt); Action <string> meinDeleMitParaAno3 = x => Console.WriteLine(x); CalcDelegate calc = Minus; Func <int, int, long> calcAlsFunc = Sum; CalcDelegate calcAno = (int a, int b) => { return(a + b); }; CalcDelegate calcAno2 = (a, b) => { return(a + b); }; CalcDelegate calcAno3 = (a, b) => a + b; long result = calc.Invoke(3, 4); List <string> texte = new List <string>(); List <string> nurB = texte.Where(x => x.StartsWith("b")).ToList(); List <string> nurB2 = texte.Where(Filter).ToList(); foreach (var item in texte) { // if(item.StartsWith("b")) //... } }
public HalloDelegate() { EinfacheDelegate meineDele = EinfacheMethode; Action meineDeleAlsAction = EinfacheMethode; Action meineDeleAlsActionAno = delegate() { Console.WriteLine("Ich habe keinen Namen"); }; Action meineDeleAlsActionAno2 = () => { Console.WriteLine("Ich habe keinen Namen"); }; Action meineDeleAlsActionAno3 = () => Console.WriteLine("Ich habe keinen Namen"); DelegateMitPara deleMitPara = MethodePara; Action <string> paraAlsAction = MethodePara; DelegateMitPara deleMitParaAno = (string txt) => { Console.WriteLine(txt); }; Action <string> deleMitParaAno2 = (txt) => Console.WriteLine(txt); DelegateMitPara deleMitParaAno3 = x => Console.WriteLine(x); CalcDelegate calcDele = Minus; Func <int, int, long> calcFunc = Sum; CalcDelegate calcDeleAno = (int x, int y) => { return(x + y); }; CalcDelegate calcDeleAno2 = (x, y) => { return(x + y); }; CalcDelegate calcDeleAno3 = (x, y) => x + y; List <string> texte = new List <string>(); texte.Where(x => x.StartsWith("b")); texte.Where(Filter); long res = calcDele.Invoke(56, 23); }
public HalloDelegate() { EinfacheDelegate meineDele = EinfacheMethode; Action meineDeleAlsAction = EinfacheMethode; Action meineDeleAlsAction2 = delegate() { Console.WriteLine("Hallo"); }; Action meineDeleAlsAction3 = () => { Console.WriteLine("Hallo"); }; Action meineDeleAlsAction4 = () => Console.WriteLine("Hallo"); DelegateMitParameter meinDeleMitPara = MethodeMitPara; Action <string> meinDeleMitParaAlsAction = MethodeMitPara; Action <string> meinDeleMitParaAlsAction2 = (string x) => { Console.WriteLine(x); }; Action <string> meinDeleMitParaAlsAction3 = (x) => Console.WriteLine(x); Action <string> meinDeleMitParaAlsAction4 = x => Console.WriteLine(x); CalcDelegate calc = Minus; Func <int, int, long> calcAlsFunc = Summe; Func <int, int, long> calcAlsFunc2 = (x, y) => { return(x - y); }; Func <int, int, long> calcAlsFunc3 = (x, y) => x - y; List <string> texte = new List <string>(); texte.Where(x => x == "Hund"); texte.Where(Filter); }