Exemplo n.º 1
0
        //public void ConsoleTest()
        //{
        //    Console.WriteLine("start-------------------------------------------------------");
        //    Console.WriteLine("Current stack trace");
        //    Console.WriteLine(m_sysInfo.ToString());
        //    Console.WriteLine(m_projectinfo.ToString());
        //    Console.WriteLine(m_exceptioninfo.ToString());
        //    Console.WriteLine(m_callstackinfo.ToString());
        //    Console.WriteLine("end--------------------------------------------------------");
        //}
        #endregion

        #region Constructor        
        public SMECollector(Exception exception, StackTrace stack, SMEProjectInformation smeproinfo)
        {
            XMLFolderPath = string.Format("C:\\Dumps\\CS");
            m_projectinfo = smeproinfo;
            m_ErrorCallStack = stack;
            m_CollectThread = new Thread(new ParameterizedThreadStart(CollectErrorInformation));
            m_CollectThread.Name = "CollectThread";
            m_SaveXMLThread = new Thread(new ThreadStart(SaveToXML));
            m_SaveXMLThread.Name = "SaveThread";

            // collect Thread 안에서 semaphore를 초기화 할 경우 세마포어가 초기화 되기 전
            // Save Thread 안에서 초기화 되지 않은 세마포어를 가지고 wait를 진행하는 경우가 발생.
            CollectSemaphore = new Semaphore(0, 1);
            SaveSemaphore = new Semaphore(0, 1);
            m_CollectThread.Start(exception);
            m_SaveXMLThread.Start();
        }
Exemplo n.º 2
0
        void IDisposable.Dispose()
        {
            m_sysInfo = null;
            m_projectinfo = null;
            m_exceptioninfo = null;
            m_callstackinfo = null;
            m_ErrorCallStack = null;

            m_smexmlwriter = null;
            XMLFilePath = null;

            if (m_CollectThread != null)
            {
                m_CollectThread.Abort();
                m_CollectThread = null;
            }
            if(CollectSemaphore != null)
            {
                CollectSemaphore.Close();
                CollectSemaphore.Dispose();
            }
            
            if(m_SaveXMLThread != null)
            {
                m_SaveXMLThread.Abort();
                m_SaveXMLThread = null;
            }
                
        }
Exemplo n.º 3
0
 private void CollectProjectInfo()
 {
     //fixme//
     //프로젝트의 이름과 버전을 받아둘 방법 생각
     m_projectinfo = new SMEProjectInformation("testApp", null);
     
 }