예제 #1
0
 void ThreadStart()
 {
     Logger.Instance().Log("void ThreadStart()");
     // State becomes null only after ExitState do his finalizing job
     while (State != null)
     {
         State = State.Work();
     }
 }
예제 #2
0
        public FileSearcher()
        {
            Context = new SearcherStateContext();
            Context.SearcherThread = new Thread(ThreadStart);

            ProgressTimer          = new System.Timers.Timer(200);
            ProgressTimer.Elapsed += OnProgress;

            Context.SearcherThread.IsBackground = true;
            Context.SearcherThread.Start();

            SearchFinishedEvent += FileSearcher_SearchFinishedEvent;

            State = new IdleState(Context);
        }