Home > DeveloperSection > Forums > How to Callback Operation Using Delegate in c#.
Ankit Singh

Total Post:341

Posted on    January-24-2016 9:55 PM

 C# C# 

 1 Reply(s)
 441  View(s)
Rate this:
I want to use Callback Operation Using Delegate in c#. How to do this please help me.

aditya kumar Patel

Total Post:254

Posted on    January-24-2016 10:02 PM

call back design pattern executable code is passed as an argument to other code and it is expected to call back at some time.

using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
namespace program
    class Example
        static void Main(string[] args)
            CallBackdemo callBackdemo = new CallBackdemo();
    public class CallBackdemo
        public void Test()
            TaskCompletedCallBack callback = TestCallBack;
            CallBack testCallBack = new CallBack();
        public void TestCallBack(string result)
    public delegate void TaskCompletedCallBack(string Result);
    public class CallBack
        public void NewTask(TaskCompletedCallBack taskCompletedCallBack)
            Console.WriteLine("I have started new execution Task.");
            if (taskCompletedCallBack != null)
                taskCompletedCallBack("I have completed execution Task.");

Don't want to miss updates? Please click the below button!

Follow MindStick