Beispiel #1
0
 public static string Read(string path)
 {
     try
     {
         System.IO.StreamReader reader = new System.IO.StreamReader(
             @path,
             System.Text.Encoding.GetEncoding("shift_jis"));
         string text = reader.ReadToEnd();
         reader.Close();
         return(text);
     }
     catch (Exception exception)
     {
         DebugPrint.output("file", exception.Message);
         return(null);
     }
 }
Beispiel #2
0
 public static bool Write(string path, bool append, string text)
 {
     try
     {
         System.IO.StreamWriter writer = new System.IO.StreamWriter(
             @path,
             append,
             System.Text.Encoding.GetEncoding("utf-8"));
         writer.Write(text);
         writer.Close();
         return(true);
     }
     catch (Exception exception)
     {
         DebugPrint.output("file", exception.Message);
         return(false);
     }
 }
        private void timerEvent(object sender, EventArgs e)
        {
            timer.Stop();
            switch (m_LatestRequst)
            {
            case CuiHelperRequest.DragAndDrop:
                m_app.DragAndDrop(m_files, m_inputTextBox.Text);
                break;

            case CuiHelperRequest.TextBox:
                m_app.TextBoxEvent(m_text);
                m_inputTextBox.Text = "";
                break;

            case CuiHelperRequest.Button:
                m_app.ComboBoxEvent(m_Command, m_inputTextBox.Text);
                break;

            default:
                DebugPrint.output("EVENT", "timer: undefined request!");
                break;
            }
        }
        private bool settingThisApplication()
        {
            bool success = m_jsonParser.StartJson(m_settingFile);

            if (!success)
            {
                MessageBox.Show("設定ファイルが読めません!", "ERROR");
                return(false);
            }

            dynamic item = m_jsonParser.SearchItem(SETTING_ITEM_NAME);

            if (item == null)
            {
                MessageBox.Show("設定ファイルが正しくありません!", "ERROR");
                return(false);
            }

            m_imagePath    = item.ImagePath;
            m_contentsPath = item.ContentsPath;
            DebugPrint.output("factory", "ImagePath=" + item.ImagePath);
            DebugPrint.output("factory", "ContentsPath=" + item.ContentsPath);
            return(true);
        }