http://csharp-video-tutorials.blogspo...
Slides
http://csharp-video-tutorials.blogspo...
All C# Text Articles
http://csharp-video-tutorials.blogspo...
All C# Slides
http://csharp-video-tutorials.blogspo...
All Dot Net and SQL Server Tutorials
https://www.youtube.com/user/kudvenka...
In this video we will discuss, retrieving data from Thread function using callback method. This is continuation to Part 90. Please watch Part 90 before proceeding. We will be working with the same example we worked with in Part 90.
using System;
using System.Threading;
namespace ThreadStartDelegateExample
{ // Step 1: Create a callback delegate. The actual callback method // signature should match with the signature of this delegate. public delegate void SumOfNumbersCallback(int sumOfNumbers); // Step 2: Create Number class to compute the sum of numbers and // to call the callback method class Number { // The traget number this class needs to compute the sum of numbers int _target; // Delegate to call when the the Thread function completes computing the sum of numbers SumOfNumbersCallback _callbackMethod; // Constructor to initialize the target number and the callback delegateinitialize public Number(int target, SumOfNumbersCallback callbackMethod) { this._target = target; this._callbackMethod = callbackMethod; } // This thread function computes the sum of numbers and then invokes // the callback method passing it the sum of numbers public void ComputeSumOfNumbers() { int sum = 0; for (int i = 1; i [= _target; i++) { sum = sum + i; } if (_callbackMethod != null) { _callbackMethod(sum); } } } // Step 3: This class consumes the Number class created in Step 2 class Program { // Callback method that will receive the sum of numbers public static void PrintSumOfNumbers(int sum) { Console.WriteLine("Sum of numbers is " + sum); } public static void Main() { // Prompt the user for the target number Console.WriteLine("Please enter the target number"); // Read from the console and store it in target variable int target = Convert.ToInt32(Console.ReadLine()); // Create an instance of callback delegate and to it's constructor // pass the name of the callback function (PrintSumOfNumbers) SumOfNumbersCallback callbackMethod = new SumOfNumbersCallback(PrintSumOfNumbers); // Create an instance of Number class and to it's constrcutor pass the target // number and the instance of callback delegate Number number = new Number(target, callbackMethod); // Create an instance of Thread class and specify the Thread function to invoke Thread T1 = new Thread(new ThreadStart(number.ComputeSumOfNumbers)); T1.Start(); } }
}
asp.net core docker Part 91 Retrieving data from Thread function using callback method | |
294 Likes | 294 Dislikes |
86,780 views views | 524K followers |
Education | Upload TimePublished on 13 Mar 2014 |
Related keywords
delegated proof of stake,wcf vs web api,sql server management studio,c#.net versions,webkinz,methodology definition,webadvisor,methodist careers,craigslist nj,threadripper,asp.net core 3,ajax players,csharp corner,asp.net machine account,asp.net core dependency injection,c#.net developer,ajax ontario,methodist mychart,c#.net online compiler,asp.net mvc tutorial,methodist dallas,tutorialspoint python,c#.net interview questions,services briefcase,ajax jquery,craigslist ny,thread safe,server memes,services online,threadripper 2950x,threadpool,server resume,tutorialspoint javascript,mvcc connect,delegated act v2x,services technologies gps,server jobs,functional disorder,website,mvc tutorial,costco hours,wcf service application,.net 3.5,tutorialspoint spring,serverless,threadlocal,wcf cat,method homes,services & training hse colombia sas,citibank,ajax parking,sql database,mvconnect,asp.net guida,cunyfirst,csharp online,c#.net notes pdf,http://asp.net,server 2019,ado.net descargar,chernobyl,ado.net visual studio 2019,ado.net visual studio 2017,sql like,wcfm,tutorial gateway,thread c++,asp.net core mvc,functional resume,ajax soccer,delegate swift,wcfi,craigslist,tutorialspoint python 3,sql developer,webster,functional groups,functional neurological disorder,services transmission company sas,method man wife,sql group by,mvc near me,c#.net framework,mvc map,asp.net download,sql between,ado.net c# pdf,wcf 2019 nba,ado.net ventajas y desventajas,wcf tutorial,threadripper 2990wx,tutorials dojo,central park 5,ado.net c#,server status,server jobs nyc,asp.net core swagger,server error in '/' application,.net que es,methodist,services windows,asp.net core 3.0,sql injection,tutorialspoint c#,functionalism,c#.net vs asp.net,ado.net entity data model,sql insert,tutorialspoint tableau,sqlyog,sql server,tutorials by a,servicenow,.net framework 4.7,.net framework 4.8,.net framework 4.5,.net framework 4.6,c#.net to vb.net,c#.net w3schools,csharp array,.net framework 4.0,c#.net projects,csharp enum,asp.net core 2. guida completa per lo sviluppatore,.net framework 3.5 sp1,server status ffxiv,c#.net basics,cheap flights,asp.net core hosting,functionality,functional dyspepsia,method man,tutorialspoint java,webmd,.net framework,ado.net dataset,tutorial meaning,cnn,website builder,asp.net web api,weber grills,sql server 2017,asp.net core download,function of pancreas,webster bank,methodist hospital,.net framework 3.5,tutorial teacher,ajax post,delegatewastebasketstyle,services fms publish announcement,services.msc no abre,csharp operator,server duties,tutorial on variational autoencoders,delegatesentitemsstyle,csharp random,thread.sleep,c#.net latest version,mvcsd,mvcsc,ado.net pdf,asp.net core configuration,mvc medical,wcfs international curriculum,wcf api,function of beauty,server jobs near me,webex,.net framework 2.0,sql meaning,sql tutorial,sql commands,ado.net entity framework,.net framework 4,c#.net pdf,delegate deutsch,ajax greek,thread java,csharp tutorial,ado.net connection,asp.net identity,wcf web service,method body wash,mvc webadvisor,web store,mvctc,ado.net core,wcf one piece,c#.net core,weber grill parts,webtoon,tutorials by hugo,threadpoolexecutor python,mvc design pattern,servers for minecraft,ado.net tutorial,thread join,delegate ip,services angular,function junction,tutorial definition,tutorial on excel,.net framework 4.6.1,asp.net cos'è,.net framework 4.6.2,csharp assembly,sql join,asp.net core web api,wccftech,asp.net zero,csharp foreach,functional medicine,methodjosh,sql date format,chase,c#.net tutorial pdf,serverless architecture,wcf c#,server books,ado.net mysql,ajax deadpool,cvs,delegate function,delegatee,wcf soap,delegates,thread 1 signal sigabrt,.net framework 4.5.2,wcf test client,cool math games,servicestack,function calculator,asp.net core identity,sql union,asp.net core logging,functional programming,wcf nba,csharp download,wcfi foundation,wcf authentication,tutorials near me,web of dreams,serverminer,ajax cleaner,tutorial for windows 10,delegated,webassign,ado.net vs entity framework,csharp list,asp.net mvc,asp.net core tutorial,sqlite,ajax roster,mvc architecture,http://ado.net,server hosting,delegated regulation,ajax dish soap,threadpoolexecutor,capital one,server rack,tutorialspoint html,csharp interface,function of liver,methodjosh banned,webroot,tutorialspoint reactjs,ajax request,wcf dragon ball,asp.net core 2.2,asp.net core signalr,services manager,mvc framework,ajax paving,methodist health system,tutorialspoint spring boot,c#.net concatenate strings,.net framework 4.7.2,csharp online compiler,services tag dell,csharp switch,c#.net mvc,csharpstar,tutorialspoint,function definition,ajax meaning,csharp-video-tutorials.blogspot,tutorial mission gta online,csharp string format,asp.net core github,ajax fc,threadripper 3000,sql formatter,credit karma,services group,wcf ria services,calculator,delegate c#,services google play apk,delegate software,asp.net core 3 release date,method wheels,c#.net tutorial,server job description,.net core 3,webcam,mvc hours,webmd symptom,ajax call,asp.net core,server pro,webcrims,delegated voting,services sas,functional medicine doctor,tutorialspoint java compiler,threading python,csharp to json,college football,csharp dictionary,methodist university,tutorial.mc-complex,tutorialspoint sql,server side rendering,mvc nj,tutorialspoint spark,ado.net oracle,csharp to vb.net,threading,methodist hospital jobs,webstaurant,tutorial systems,tutorialsystems,ajax jersey,asp.net core razor pages,asp.net core environment variables,century 21,.net framework 3.5 windows 10,services consultores,services consulting,services.msc,ajax marvel,tutorial synonym,sql update,asp.net tutorial,delegated act,ado.net entity data model visual studio 2019,mvc2,ado.net entity data model visual studio 2017,c#.net tutorialspoint,function notation,chase online,.net core,costco,delegate pattern,method acting,ajax tavern,methodist church,tutorialsteacher,delegatecommand,ajax javascript,c#.net programs,services desk,methodical,functional medicine kansas city,threadripper zen2,functional region,mvc pattern,ado.net sql server,delegate java,mvcu,threads,.netflix,asp.net core middleware,delegated monitoring,threadx,function of beauty reviews,tutorial music,mvcc,webmail,mvci,threaded,methodology,
Không có nhận xét nào:
Đăng nhận xét