1. The underlined gerund is directly related to the verb "enjoy" and, therefore, works as a direct object.
2. The underlined gerund is not related to the verb as the sentence "She has finished several things" has standalone meaning without the underlined part. In this scenario, the gerund relates to the preposition "by" and, therefore, is an object of a preposition.