private actionStatus change_Input(rv.InputCommand.InputType p_objInputType, int p_intPort, string p_strInputName) { var l_objStatus = actionStatus.None; var l_strFunctionName = "change_Input()"; try { if (m_objProjectorConnection == null) { connectToProjector(); //Connect now if not connected } m_objLogger.logToMemory(string.Format("{0}: {1}: Attempting to Change the Projector Input to {2}", l_strFunctionName, projectorName, p_strInputName)); InputCommand l_objInputCommand = new InputCommand(p_objInputType, p_intPort); if (m_objProjectorConnection.sendCommand(l_objInputCommand) == Command.Response.SUCCESS) { l_objStatus = actionStatus.Success; m_objLogger.logToMemory(l_objInputCommand.dumpToString()); } else { throw new Exception("Communication Error"); } } catch (Exception e) { l_objStatus = actionStatus.Error; m_objLogger.logToMemory(string.Format("{0}: {1}: Error Changing the Projector Input to {2}. Error: {3}", l_strFunctionName, projectorName, p_strInputName, e.ToString()), l_objStatus); } finally { m_objLogger.writePendingToDB(l_objStatus, p_strFunctionName: l_strFunctionName); } return(l_objStatus); }
private void change_Input(rv.InputCommand.InputType x, int i) { InputCommand ic2 = new InputCommand(x, i); if (c.sendCommand(ic2) == Command.Response.SUCCESS) { Console.WriteLine(ic2.dumpToString()); } else { Console.WriteLine("Communication Error"); } }