Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApplication1
- {
- public partial class DebugWin : Form
- {
- private bool myWindowClosed = true;
- private bool debugOn = false;
- private string myLogMsg = "";
- public DebugWin(bool debugState)
- {
- InitializeComponent();
- debugOn = debugState;
- }
- public void logMe(string myLogLine)
- {
- if (debugOn && windowOpen())
- {
- textBox1.AppendText(myLogLine + "\n");
- }
- }
- private bool windowOpen()
- {
- if (myWindowClosed)
- {
- this.Show();
- myWindowClosed = false;
- }
- return true;
- }
- private void closed(object sender, FormClosedEventArgs e)
- {
- myWindowClosed = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement