public actionStatus turnOffProjector() { var l_objStatus = actionStatus.None; var l_strFunctionName = "turnOffProjector()"; m_objLogger.logToMemory(string.Format("{0}: {1}: Attempting to turn the Projector Off......", l_strFunctionName, projectorName)); try { if (m_objProjectorConnection == null) { connectToProjector(); //Connect now if not connected } //TODO:create a message bus so that these messages can be displayed real time m_objLogger.logToMemory(string.Format("{0}: {1}: Turning Projector Off", l_strFunctionName, projectorName)); m_objProjectorConnection.turnOff(); m_objLogger.logToMemory(string.Format("{0}: {1}: Projector is now: {2}", l_strFunctionName, projectorName, m_objProjectorConnection.powerQuery().ToString())); l_objStatus = actionStatus.Success; } catch (Exception e) { l_objStatus = actionStatus.Error; m_objLogger.logToMemory(string.Format("{0}: {1}: Error Turning Off the Projector: {2}", l_strFunctionName, projectorName, e.ToString()), l_objStatus); } finally { m_objLogger.writePendingToDB(l_objStatus, p_strFunctionName: l_strFunctionName); } return(l_objStatus); }
private void Off_Click(object sender, EventArgs e) { //turn off, update status Status.Text = "Turning Projector Off"; c.turnOff(); Status.Text = "Projector is now:" + c.powerQuery().ToString(); }
public void turnOff() { link.turnOff(); }