Esempio n. 1
0
        private void HandleProcessExited(object sender)
        {
            if (m_filterForm != null)
            {
                m_filterForm.Close();
                m_filterForm = null;
            }

            GameFilePlayAdapter adapter = sender as GameFilePlayAdapter;
            DateTime            dtExit  = DateTime.Now;

            Directory.SetCurrentDirectory(m_workingDirectory);
            m_playInProgress = false;

            if (adapter.SourcePort != null)
            {
                IGameFile gameFile = adapter.GameFile;

                if (gameFile != null)
                {
                    SetMinutesPlayed(dtExit, gameFile);
                }

                if (!string.IsNullOrEmpty(adapter.RecordedFileName))
                {
                    HandleRecordedDemo(adapter, gameFile);
                }

                HandleDetectorFiles(adapter, gameFile);

                if (m_statsReader != null)
                {
                    m_statsReader.Stop();

                    if (m_statsReader.ReadOnClose)
                    {
                        m_statsReader.ReadNow();
                    }

                    if (m_statsReader.Errors.Length > 0)
                    {
                        HandleStatReaderErrors(m_statsReader);
                    }

                    m_statsReader = null;
                }
            }

            IGameFileView view = GetCurrentViewControl();

            view.UpdateGameFile(adapter.GameFile);
            HandleSelectionChange(view, true);
        }
Esempio n. 2
0
        public static FilterForm Instance(Mainform frmMain)
        {
            if (sForm == null)
            {
                sForm = new FilterForm(frmMain);
            }

            else
            {
                sForm.Close();
                sForm = null;
                sForm = new FilterForm(frmMain);
            }

            return(sForm);
        }