Ejemplo n.º 1
0
 public static void SaveConfig()
 {
     using (FileStream fs = new FileStream(FILE_NAME, FileMode.Create, FileAccess.Write))
     {
         BinaryFormatter bf = new BinaryFormatter();
         bf.Serialize(fs, data);
         LogPanel.Log(FILE_NAME + " Saved");
     }
 }
Ejemplo n.º 2
0
        private void OnThreadStop()
        {
            if (Config.data.shutdown)
            {
                System.Diagnostics.Process.Start("shutdown.exe", "-s -t 0");
                LogPanel.Log("시스템 종료");
            }

            SetButtonActive();
        }
Ejemplo n.º 3
0
 public static void LoadConfig()
 {
     try
     {
         using (FileStream fs = new FileStream(FILE_NAME, FileMode.Open, FileAccess.Read))
         {
             BinaryFormatter bf = new BinaryFormatter();
             data = bf.Deserialize(fs) as ConfigData;
             LogPanel.Log(FILE_NAME + " Loaded");
         }
     }
     catch (Exception e)
     {
         Reset();
         SaveConfig();
     }
 }
Ejemplo n.º 4
0
        private static Bitmap LoadImage(string path)
        {
            bool exists = File.Exists(path);

#if SINGLE_COLOR_LOG
            LogPanel.LogNonReturn("Load[", Color.Black);
            LogPanel.LogNonReturn(exists, exists == false ? Color.Red : Color.Green);
            LogPanel.Log($"]: {path}\r\n");
#else
            LogPanel.Log($"Load[{exists}]: {path}\r\n", exists == false ? Color.Red : Color.Green);
#endif
            if (!exists)
            {
                return(null);
            }
            else
            {
                return(new Bitmap(path));
            }
        }
Ejemplo n.º 5
0
        private void Form_Shown(object sender, EventArgs e)
        {
            string[] enum_names = Enum.GetNames(typeof(StudyState));
            foreach (string name in enum_names)
            {
                comboBox_startState.Items.Add(name);
            }
            comboBox_startState.SelectedIndex = 0;

            m_logPanel = new LogPanel(textbox_logpanel);
            bool CMComplete;

            m_captureMachine = new CaptureMachine(out CMComplete);
            m_stateMachine   = new StateMachine(m_captureMachine, threadStopEvent);

            Config.LoadConfig();

            if (Config.data.start_IE)
            {
                Process.Start("iexplore.exe", "http://www.hakjum.com/");
            }
        }
Ejemplo n.º 6
0
 public static void Reset()
 {
     data = new ConfigData();
     LogPanel.Log(FILE_NAME + " Initalized");
 }
Ejemplo n.º 7
0
 public LogPanel(RichTextBox textBox)
 {
     g_instance     = this;
     this.m_textBox = textBox;
     fLog("log panel initalized\r\n", Color.Green);
 }