전체 글36 this 생성 전 이벤트 방지 if(this.isHandleCreated) 2023. 1. 11. 이벤트 중복 방지 방법 Value.onValueChanged -= OnValueCallback; Value.onValueChanged += OnValueCallback; 출처 : https://mentum.tistory.com/602 2023. 1. 11. delegate BeginInvoke, EndInvoke using System; using System.Threading; using System.Runtime.Remoting.Messaging; namespace Examples.AdvancedProgramming.AsynchronousOperations { public class AsyncDemo { // The method to be executed asynchronously. public string TestMethod(int callDuration, out int threadId) { Console.WriteLine("Test method begins."); Thread.Sleep(callDuration); threadId = Thread.CurrentThread.ManagedThreadId; ret.. 2023. 1. 11. Task.WaitAll 없을 때 Task.Result 동작 방식 using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace app { class Program { static void Main(string[] args) { var task3 = Method3Async(); var task5 = Method5Async(); //Task.WaitAll(task3, task5); Console.WriteLine(task3.Result + task5.Result); //WaitAll 없이도 Result때문에 기다림 string s = Console.ReadLine(); Console.WriteLine(s); Console.ReadLin.. 2023. 1. 11. 이전 1 2 3 4 ··· 9 다음