Ejemplo n.º 1
0
        public ClearFilesControlServiceTask(Log log)
        {
            this.log = log;

            SystemDataIsLoaded = false;

            Worker            = new SaleThread();
            Worker.ThreadName = "ClearOldFilesControl";
            Worker.Priority   = ThreadPriority.BelowNormal;
            Worker.Work      += Worker_Work;

            Start();
        }
Ejemplo n.º 2
0
        void Worker_Work(object sender, ThreadWorkEventArgs e)
        {
            while (!e.Cancel)
            {
                try
                {
                    DeleteOldFiles(Globals.GetPath(PathEnum.Logs), "*." + Globals.LogExtention, 30, SearchOption.TopDirectoryOnly);
                }
                catch
                {
                }

                // Период - 10 минут
                if (!e.Cancel)
                {
                    SaleThread.Sleep(600000);
                }
            }
        }
Ejemplo n.º 3
0
 public ThreadWorkEventArgs(SaleThread thread)
 {
     Thread = thread;
 }