Beispiel #1
0
    static int Main()
    {
        GetIntDelegate d = (GetIntDelegate)Delegate.CreateDelegate(typeof(GetIntDelegate), typeof(Derived), "GetInt");

        int result = d();

        if (result != 42)
        {
            return(-1);
        }

        return(100);
    }
 public InputSliderInt(string path, GetIntDelegate getValue, SetIntDelegate setValue)
     : base(path, () => getValue().ToString(), (val) => setValue(Convert.ToInt32(val)))
 {
 }
 public void Run()
 {
     GetIntFunc = GetInt;
     Console.WriteLine($"{GetIntFunc(10)}");
 }