delegate (1,450)


c# - What are the differences between delegates and events?

c# - What are the differences between delegates and events?

What are the differences between delegates and an events? Don't both hold references to functions that can be executed?…


oop - Where do I use delegates?

What are some real world places that call for delegates? I'm curious what situations or patterns are present where this method is the best solution. No code required.…


Java Delegates?

Does the Java language have delegate features, similar to how C# has support for delegates?…


.net - How often do you use System.Component.BackgroundWorker in your UIs ?(if ever)

I am sure a responsive UI is something that everyone strives for and the reccomended way to do stuff is to use the BackgroundWorker for this. Do you find it easy to work with ? Do you use it often ?…


c# - How do you declare a Predicate Delegate inline?

I'm using C#. So I have an object which has some fields, doesn't really matter what. I have a generic list of these objects. List<MyObject> myObjects=new List<MyObject>(); myObjects.Add(myObject…


c# - Convert this delegate to an anonymous method or lambda

I am new to all the anonymous features and need some help. I have gotten the following to work: public void FakeSaveWithMessage(Transaction t){t.Message="I drink goats blood";}public dele…


What is this delegate call doing in this line of code(C#)?

This is from an example accompanying the agsXMPP.Net assembly. I've read up on delegates, but am not sure how that fits in with this line of code(which waits for the logon to occur, and then sends…



c# - What is the difference between lambdas and delegates in the.NET Framework?

I get asked this question a lot and I thought I'd solicit some input on how to best describe the difference.…


c# - How to avoid garbage collection in real time.NET application?

I'm writting a financial C# application which receive messages from the network, translate them into different object according to the message type and finaly apply the application business logic on…


c# - Are delegates not just shorthand interfaces?

Suppose we have: interface Foo{bool Func(int x);}class Bar: Foo{bool Func(int x){return(x>0);}} class Baz: Foo{bool Func(int x){return(x<0);}} Now we can t…




swift example ios and objective with methods delegates method event