Exemplo n.º 1
0
 /// <summary>
 /// Constructor to reconstruct a comment object based on the content of the index.
 /// </summary>
 /// <param name="cursor">The cursor from which to retrieve the comment data</param>
 /// <param name="currentUserId">Current user requesting this comment</param>
 public Comment(Cursor cursor, string currentUserId)
 {
     commentid   = cursor.GetColumn("id");
     docid       = cursor.GetColumn("docid");
     message     = cursor.GetColumn("message");
     userid      = cursor.GetColumn("userid");
     username    = cursor.GetColumn("username");
     creation    = Sys.ToDat(cursor.GetColumn("creation")); // Dates in the index are UTC dates!
     modified    = Sys.ToDat(cursor.GetColumn("modified"));
     likes       = ListStr.ListFromStr(cursor.GetColumn("likes"), ';');
     likedByUser = likes.Contains(currentUserId);
     replyto     = cursor.GetColumn("replyto") ?? "";
     deleted     = Sys.ToBoo(cursor.GetColumn("deleted"));
 }