private void Form1_Load(object sender, EventArgs e) { CSerialPortCOM a = new CSerialPortCOM(true); bool b = true; ChatOrganization o = new ChatOrganization("Nico", null, "Hallo", a, ref b); MessageBox.Show(b.ToString()); }
//Konstruktor public ChatOrganization(string UserName, Image ProfilePic, string Comment, CSerialPortCOM current, ref bool check) { configured = current; //create the current User currentUser = new User(UserName, Comment, ProfilePic); waitAnswer = false; sendLock = false; //initialize the connection if (configured.Connect()) { check = true; //start Thread RefreshContent = new Thread(WaitForMessage); RefreshContent.Start(); } else { check = false; } }