CommandStatus GetOrElseAndLogAnalog(double value, ushort index, IDictionary<UInt16, CommandStatus> dictionary, Func<CommandStatus> action) { var result = GetOrElse(index, dictionary, action); if (result == CommandStatus.SUCCESS && AnalogCommandAccepted != null) { AnalogCommandAccepted(value, index); } return result; }