private void RequestFarmButton_Click(object sender, EventArgs e) { // ### connect to farm if (thisClientID == "") { // the magic config settings are exchange/queue/port/uid/pwd // this should ask a running service for 4 engines of TestWorker.Worker // it should get an acknowledgement, and dialog up the results if (fs == null) { fs = ConnectionDetail.ConnectionDetailFactory()["local"]; } fs.clientID = thisClientID = Guid.NewGuid().ToString(); myFarmProxy = ComputeFarmProxy.ComputeFarmProxy.ConnectToFarm(fs); if (myFarmProxy != null && myFarmProxy.IsOpen) { MessageBox.Show("Farm Connected OK"); } else { MessageBox.Show("Could not connect to farm"); thisClientID = ""; myFarmProxy = null; } } else { MessageBox.Show("there is already an open connection to the farm..."); } }
private void InitFarmButton_Click(object sender, EventArgs e) { if (actFarm != null) { MessageBox.Show("there is already an open farm instance ..."); return; } try { if (fs == null) { fs = ConnectionDetail.ConnectionDetailFactory()["local"]; } actFarm = new ComputeFarm.ComputeFarm(fs, null); actFarm.Init(); } catch (Exception exc) { } if (actFarm != null && actFarm.IsOpen) { MessageBox.Show("Local Farm Instance Is OK"); } else { MessageBox.Show("Could not create local farm"); thisClientID = ""; actFarm = null; } }