public actionStatus turnOnProjector() { var l_objStatus = actionStatus.None; var l_strFunctionName = "turnOnProjector()"; m_objLogger.logToMemory(string.Format("{0}: {1}: Attempting to turn the projector On", l_strFunctionName, projectorName)); try { if (m_objProjectorConnection == null) { connectToProjector(); //Connect now if not connected } m_objLogger.logToMemory(string.Format("{0}: {1}: Turning Projector On", l_strFunctionName, projectorName)); m_objProjectorConnection.turnOn(); 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.logToDB(string.Format("{0}: {1}: Error Turning the Projector On: {2}", l_strFunctionName, projectorName, e.ToString()), l_objStatus); } finally { m_objLogger.writePendingToDB(l_objStatus, p_strFunctionName: l_strFunctionName); } return(l_objStatus); }
private void On_Click(object sender, EventArgs e) { //turn on, update status Status.Text = "Turning Projector On"; c.turnOn(); Status.Text = "Projector is now:" + c.powerQuery().ToString(); }
public void turnOn() { link.turnOn(); }