private ApiDoneSentence EnsureDoneResponse(ApiSentence responseSentence) { ApiDoneSentence doneSentence = responseSentence as ApiDoneSentence; if (doneSentence == null) throw new TikConnectionException("!done sentence expected as result.", this, responseSentence); return doneSentence; }