Exemplo n.º 1
0
        private bool DllCheck()
        {
            DllManager dllManager = new DllManager();

            //bool newDll = false;

            LogUtil.Log("***** Checking for new dll.. *****");

            bool exist = dllManager.checkIfNewDllExist();

            if (exist)
            {
                LogUtil.Log("******** NEW DLL *********");
                //NewDllExist = true;
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        public int Run(EventLog eventLog)
        {
            eventLogInstance = eventLog;

            ConcurrentDictionary <string, bool> runningThreads = new ConcurrentDictionary <string, bool>();

            DllManager dllManager = new DllManager();

            Thread helloThread = new Thread(() => CheckForNewDll(runningThreads));

            helloThread.IsBackground = true;
            helloThread.Start();


            Thread exportThread = new Thread(() => DoingSomething("export 11", runningThreads));

            exportThread.IsBackground = true;
            exportThread.Start();


            Thread importThread = new Thread(() => DoingSomething("import 11", runningThreads));

            importThread.IsBackground = true;
            importThread.Start();


            while (true)
            {
                Thread.Sleep(5000);

                bool areAllThreadsStopped = runningThreads.All(x => x.Value == false);

                if (areAllThreadsStopped)
                {
                    LogUtil.Log("***** ALL THREADS HAVE BEEN STOPPED *****");
                    return(1);
                }
            }
        }