Пример #1
0
        private void AutoReleaseMCSCases()
        {
            bool createdNew = true;

            Mutex mutex = new Mutex(true, "DisableMCSArea", out createdNew);

            if (createdNew)
            {
                while (!m_Shutdown && AutoVerifyCaseEnabled)
                {
                    try
                    {
                        List <l3.cargo.corba.XCase> xcases =
                            m_CargoHostEndPoint.GetWorkstationAreaCases(l3.cargo.corba.WorkstationArea.MCS);

                        foreach (l3.cargo.corba.XCase xcase in xcases)
                        {
                            string caseId = xcase.getId();
                            if (!base.caseList.IsAssigned(caseId))
                            {
                                m_CargoHostEndPoint.ReleaseCase(caseId);
                            }
                            Thread.Sleep(500);
                        }

                        Thread.Sleep(1000);
                    }
                    catch
                    {
                        break;
                    }
                }

                mutex.Dispose();
            }
        }