static void Main(string[] args) { DelegateNotify dlg = new DelegateNotify(fnNotify); SetNotifyCallBack(dlg); for (Int32 i = 1; ; i++) { Console.WriteLine("*** Iteration {0}", i); fnc2(i); Thread.Sleep(3000); } Console.WriteLine("Press any key..."); Console.ReadLine(); }
public virtual void Notify(object controller, Dictionary <string, Parameter> parameters, View view, Dictionary <string, object> values, DataRow prevRow, string pk, string connectionString, int currentUserId, string currentUserRole, IDbCommand command) { DelegateNotify delegateNotify = new DelegateNotify(NotifyAsync); // call the BeginInvoke function! string siteWithoutQueryString = ((INotifier)controller).GetSiteWithoutQueryString(); string mainSiteWithoutQueryString = ((INotifier)controller).GetMainSiteWithoutQueryString(); string urlAction = ((INotifier)controller).GetUrlAction(view, pk); IAsyncResult tag = delegateNotify.BeginInvoke(controller, parameters, view, values, prevRow, pk, siteWithoutQueryString, mainSiteWithoutQueryString, urlAction, connectionString, currentUserId, view.Database.GetCurrentUsername(), currentUserRole, command, null, null); }
public static extern void SetNotifyCallBack(DelegateNotify callback);