directx - C# DX What is this param mean? -


i ran while using slimdx

messagepump.run(form, () => { }); 

what () => { } do?

the expression () => {} empty lambda expression. function messagepump.run defined as:

public static void run( form form, mainloop mainloop ) 

mainloop defined as:

public delegate void mainloop() 

so delegate not expects parameters. when pass () => {} method nothing like:

public void mainloopimpl() {     //empty method } 

now create mainloop instance:

var mloop = new mainloop(mainloopimpl); //or alternative syntax mainloop mloop = mainloopimpl;  //call run  messagepump.run(form, mloop); 

details declaring, creating , using delegates (including lambda expression declaration way) explained in detail on this msdn page.


Comments

Popular posts from this blog

Issues changing the value of an element in an array in matlab -

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -