www.bitwix.com

Bitwix


Software

Snippets

Simple Threads

This is enough for a simple Windows app. When debugging, updating e.g. lblSayuser may fail.
	private Thread m_trd = null;
        private void RunLongProcess()
        {
            AbortThread();
            m_trd = new Thread(new ThreadStart(this.LongProcess));
            m_trd.IsBackground = true;
            m_trd.Start();
        }
        private void LongProcess()
        {
	}
        private void AbortThread()
        {
            if (m_trd != null)
            {
                if (m_trd.IsAlive)
                {
                    m_trd.Abort();
                    Sayuser("Aborted");
                }
                else
                    Sayuser("Thread had completed");
                m_trd = null;
            }
            else
                Sayuser("No thread to abort");
        }


Whitespace

Property Hawk

Projects

This layout has been adapted from an original design by Ruthsarian Layouts, downloaded from oswd.org