private void _update() { string s = null; lock (m_sendlog) { while (m_sendlog.Count > 0) { if (m_bReqAbort) { break; } if (s != null) { s += Environment.NewLine; } s += m_sendlog.Dequeue(); } } if (!m_bReqAbort) { if (s != null) { m_pipe.Write(s, m_toname); } } }
private void textBox3_input_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\r') { string cmd = null; var topindex = textBox3_input.GetFirstCharIndexOfCurrentLine(); var buf = textBox3_input.Text.Substring(topindex); if (string.IsNullOrWhiteSpace(buf)) { return; } var endindex = buf.IndexOf('\xa'); if (endindex < 0) { cmd = buf.TrimStart('>').TrimEnd(); } else { cmd = buf.Substring(0, endindex).TrimStart('>').TrimEnd(); e.KeyChar = '\x00'; } if (!string.IsNullOrWhiteSpace(cmd)) { string newcmd = null; if (_get_load_inc(cmd, out newcmd)) { textBox1_log.AppendText("[展開 :" + cmd + "]" + Environment.NewLine); cmd = newcmd; } textBox1_log.AppendText("Send Command : " + cmd + Environment.NewLine); _if_help_add(cmd); m_pipe.Write(cmd, "unity"); _loadScriptWhenCmdHas(cmd); } } }