Salve,
nel seguente codice che ho inserito,
vorrei ricevere la risposta di "OK" sul Metodo Start(), per gestire la condizione if(??? == "OK")
solo che devo riceverlo dal metodo Test() che si trova su di un altro Thread.....
come posso passare quella risposta ??
codice:private void Start() { DataThread data = new DataThread("mario"); Thread t = new Thread(new ParameterizedThreadStart(Test)); t.Start(data); if(??? == "OK") { MessageBox.Show("Tutto OK!"); } } private void Test(object _data) { string nome = ((DataThread)_data).Nome; if (nome == "mario") { //Voglio comunicare a: Start() che è "OK" // // } } class DataThread { private string m_nome = ""; public DataThread(string _nome) { m_nome = _nome; } public string Nome { get { return m_nome; } set { m_nome = value; } } }

Rispondi quotando