Esempio n. 1
0
        void ButtonDown_Click(object sender, RoutedEventArgs e)
        {
            actionDemo = str => demoSource.StrInfo = str;

            ButtonDown.Content = "Downloading";
            DownLoadDel downMethod = DoDownLoad;

            TextBoxInfo.Text = "Current Thread:" + Thread.CurrentThread.ManagedThreadId;
            downMethod.BeginInvoke(TextBoxURL.Text, CallBack, downMethod);
        }
Esempio n. 2
0
        private void CallBack(IAsyncResult asy)
        {
            if (asy == null)
            {
                throw new ArgumentNullException("asy");
            }
            DownLoadDel del = asy.AsyncState as DownLoadDel;

            Trace.Assert(del != null, "Invalid object types");
            del.EndInvoke(asy);
        }