Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApplication1
  12. {
  13.     public partial class DebugWin : Form
  14.     {
  15.         private bool myWindowClosed = true;
  16.         private bool debugOn = false;
  17.         private string myLogMsg = "";
  18.    
  19.         public DebugWin(bool debugState)
  20.         {
  21.             InitializeComponent();
  22.             debugOn = debugState;
  23.         }
  24.  
  25.         public void logMe(string myLogLine)
  26.         {
  27.             if (debugOn && windowOpen())
  28.             {
  29.                 textBox1.AppendText(myLogLine + "\n");
  30.             }
  31.         }
  32.  
  33.         private bool windowOpen()
  34.         {
  35.                 if (myWindowClosed)
  36.                 {
  37.                     this.Show();
  38.                     myWindowClosed = false;
  39.                 }
  40.    
  41.                 return true;
  42.           }
  43.  
  44.         private void closed(object sender, FormClosedEventArgs e)
  45.         {
  46.             myWindowClosed = true;
  47.         }
  48.  
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement