コード例 #1
0
        // Layout thread----------------------------------------------------------------------------
        private void StartLayoutThread()
        {
            if (_photoListUpdateEvent == null)
            {
                _photoListUpdateEvent = new ManualResetEvent(false);
            }

            _layoutThreadState     = LayoutThreadState.Working;
            _layoutThread          = new Thread(new ThreadStart(LayoutThreadMain));
            _layoutThread.Name     = "Layout Thread";
            _layoutThread.Priority = ThreadPriority.Lowest;
            _layoutThread.Start();
        }
コード例 #2
0
        private void StopLayoutThread()
        {
            if (_layoutThread != null)
            {
                _photoListUpdateEvent.Set();

                _layoutThreadState = LayoutThreadState.Stop;
                Trace.WriteLine("Waiting for layout thread stop.");
                _layoutThread.Join();
                _layoutThread = null;

                _photoListUpdateEvent.Close();
                _photoListUpdateEvent = null;
            }
        }