Use Imap.MarkMessageSeenByUID and Imap.MarkMessageUnseenByUID methods.
-or-
Don't use negative flags (such as Flag.Unseen) when you invoke FlagMessageByUID and UnflagMessageByUID.
Correct way to do it is to use Flag.Seen:
Imap.FlagMessageByUID(uid, Flag.Seen),
Imap.UnflagMessageByUID(uid, Flag.Seen)