예제 #1
0
 public static PlayThread GetInstance()
 {
     if (instance == null)
     {
         instance = new PlayThread();
     }
     return(instance);
 }
예제 #2
0
        protected void playButton_Click(object sender, EventArgs e)
        {
            PlayThread pt = PlayThread.GetInstance();

            pt.SetOwner(this);
            ThreadStart ts         = new ThreadStart(pt.RunPlayThread);
            Thread      playThread = new Thread(ts);

            playThread.Start();
            Thread.Sleep(2000);
            playThread.Abort();
        }