Beispiel #1
0
        private void button_GetExceptionContent_Click(object sender, EventArgs e)
        {
            try
            {
                int number1 = 0,
                    number2 = 1;

                var result = number2 / number1;
            }
            catch (Exception exception)
            {
                textBoxService.SafeAppend(exception.ToExceptionString());
                textBoxService.SafeAppend("ToString:");
                textBoxService.SafeAppend(exception.ToString());
            }
        }
        private void button_Locker_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 10; i++)
            {
                BaseAppService service = new Service.MultiThreads.LockerService(i);
                service.AppTextBoxService = textBoxService;

                System.Threading.ThreadStart threadStart = new System.Threading.ThreadStart(service.Start);
                System.Threading.Thread      thread      = new System.Threading.Thread(threadStart);
                thread.Start();
            }

            textBoxService.SafeAppend("Over!");
        }
Beispiel #3
0
 private void SendCallback(bool isSucceeded, string result, object callbackData)
 {
     textBoxService.SafeAppend(string.Format("IsSucceeded: {0}", isSucceeded ? "成功" : "失败"));
     textBoxService.SafeAppend(string.Format("Result: {0}", result));
     textBoxService.SafeAppend(string.Format("CallbackData: {0}", callbackData.ToString()));
 }