Esempio n. 1
0
 public void runUpdateText()
 {
     mydelegate md = new mydelegate(updateText);
     while (progress<100)
     {
         Thread.Sleep(1000);
         this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, md);
     }
 }
Esempio n. 2
0
        public void runMyThreadMain()
        {
            mydelegate myd = new mydelegate(ThreadMain);
            for (; progress < 100;++progress )
            {
                Thread.Sleep(1000); //simulate some time-consuming work
                this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Input, myd);
            }

            //The calling thread cannot access this object because a different thread owns it.
            //mytext.Text += "The work is done~\n";
        }
        private void AddNewTaskTab()
        {
            TabHeaderText = "Task to Action";

            mydelegate inst = new mydelegate(DrawTaskURLTab);
            this.Invoke(inst);
        }
        private void AddNewViewFlowTab(string headertext, int procinst)
        {
            TabHeaderText = headertext;
            TabProcInst = procinst;

            mydelegate inst = new mydelegate(DrawViewFlowURLTab);
            this.Invoke(inst);
        }
 private void AddResult(string txt)
 {
     newstring = txt;
     mydelegate inst = new mydelegate(WriteResult);
     this.Invoke(inst);
 }