/// <summary> /// Проголосовать за комментарий /// </summary> /// <param name="mark">Оценка</param> public void AddMark(CommentMark mark) { if (!CanVoted) { //уже проголосовал } else { switch (mark) { case CommentMark.LIKE: _like++; break; case CommentMark.DISLIKE: _dislike++; break; case CommentMark.SPAM: _spam++; break; } _mark = mark; } }
private static void smethod_3(Class581 A_0, Class584 A_1) { Comment comment = null; CommentMark commentMarkStart = null; if ((A_0.method_25().Count > 0) && A_0.method_25().ContainsKey(A_1.method_0())) { comment = A_0.method_25()[A_1.method_0()]; } else { comment = new Comment(A_0.Interface50.imethod_0()); A_0.method_25().Add(A_1.method_0(), comment); } if (comment.CommentMarkStart != null) { commentMarkStart = A_0.method_25()[A_1.method_0()].CommentMarkStart; } else { commentMarkStart = new CommentMark(A_0.Interface50.imethod_0(), A_1.method_0(), CommentMarkType.CommentStart); comment.CommentMarkStart = commentMarkStart; } A_0.method_6(commentMarkStart); }
public void Replace(string text) { int num = 13; string str = this.method_42(text); TextRange entity = new TextRange(base.m_doc) { Text = text }; if (this.Format.CommentId == -1) { this.Format.method_6(); } if (str.IndexOf(BookmarkStart.b("㸲", num)) != -1) { this.Clear(); this.bool_7 = false; int commentId = this.Format.CommentId; int index = base.method_5(); CommentMark mark = new CommentMark(base.Document, commentId, CommentMarkType.CommentStart); CommentMark mark2 = new CommentMark(base.Document, commentId, CommentMarkType.CommentEnd); base.OwnerParagraph.Items.Insert(index, mark2); base.OwnerParagraph.Items.Insert(index, entity); base.OwnerParagraph.Items.Insert(index, mark); } else { this.Clear(); this.bool_7 = true; this.Items.Add(entity); } }
void Interface28.imethod_28(int A_0) { CommentMark mark = new CommentMark(this.document_0, A_0, CommentMarkType.CommentEnd); this.method_14(mark); this.stack_3.Push(mark); }
public void ProcessCommentAsync(TagHelperContext context, TagHelperOutput output, User user) { output.TagName = "div"; output.Attributes.Add("class", "btn-group"); output.Attributes.Add("role", "group"); Comment comment = _repository.Comments.FirstOrDefault(am => am.ID == InstanceId); String liked = "secondary", disliked = liked; if (user != null) { CommentMark mark = user.CommentMarks.FirstOrDefault(am => am.CommentID == InstanceId); if (mark != null && mark.Mark > 0) { liked = "success"; } else if (mark != null && mark.Mark < 0) { disliked = "danger"; } } output.Content.SetHtmlContent( $"<a type=\"\" class=\"btn btn-outline-{liked}\"" + $" href=\"/Comments/Mark?commentId={InstanceId}&mark=3\">" + $"<i class=\"fas fa-heart\"></i> {comment.PositiveMarksCount}</a>" + $"<a type=\"\" class=\"btn btn-outline-{disliked}\"" + $" href=\"/Comments/Mark?commentId={InstanceId}&mark=1\">" + $"<i class=\"fas fa-heart-broken\"></i> {comment.NegativeMarksCount}</a>" ); output.TagMode = TagMode.StartTagAndEndTag; }
private void imethod_25(int A_0, string A_1, string A_2, DateTime A_3, CharacterFormat A_4) { Comment comment = new Comment(this.document_0) { CharacterFormat = A_4 }; comment.Format.CommentId = A_0; comment.Format.Initial = A_1; comment.Format.Author = A_2; comment.Format.DateTime = A_3; this.method_11(comment); if (this.stack_3.Count > 0) { CommentMark mark = this.stack_3.Peek(); if (mark.CommentId == comment.Format.CommentId) { comment.CommentMarkEnd = mark; } this.stack_3.Pop(); mark = this.stack_3.Peek(); if (mark.CommentId == comment.Format.CommentId) { comment.CommentMarkStart = mark; } this.stack_3.Pop(); } }
private static void smethod_4(Class581 A_0, Class584 A_1) { if (((A_0.method_25().Count != 0) && A_0.method_25().ContainsKey(A_1.method_0())) && (A_0.method_25()[A_1.method_0()].CommentMarkEnd == null)) { CommentMark mark = new CommentMark(A_0.Interface50.imethod_0(), A_1.method_0(), CommentMarkType.CommentEnd); A_0.method_25()[A_1.method_0()].CommentMarkEnd = mark; A_0.method_6(mark); } }
public Comment(string text, string authName, DateTime date, byte ranking, int like, int dislike, int spam, CommentMark mark) { _text = text; _authName = authName; _date = date; _ranking = ranking; _like = like; _dislike = dislike; _spam = spam; _mark = mark; }
public void AddItem(IParagraphBase paraItem) { if ((base.OwnerParagraph != null) && ((this.paragraphItemCollection_1 == null) || !this.paragraphItemCollection_1.Contains(paraItem))) { Paragraph ownerParagraph = base.OwnerParagraph; int index = base.method_5(); if (this.m_format.CommentId == -1) { int num4 = Class323.smethod_0().Next(); this.m_format.CommentId = num4; CommentMark entity = new CommentMark(base.m_doc, num4) { Type = CommentMarkType.CommentStart }; CommentMark mark3 = new CommentMark(base.m_doc, num4) { Type = CommentMarkType.CommentEnd }; ownerParagraph.Items.Insert(index, mark3); ownerParagraph.Items.Insert(index, entity); } index = base.method_5(); if (ownerParagraph.Items[index - 1] is CommentMark) { int commentId = this.m_format.CommentId; if (paraItem.OwnerParagraph == null) { this.method_32(ownerParagraph, index - 1, paraItem); } else if ((ownerParagraph.Items.Count > (index + 1)) && (paraItem == ownerParagraph.Items[index + 1])) { ownerParagraph.Items.RemoveAt(index + 1); this.method_32(ownerParagraph, index - 1, paraItem); } else { CommentMark mark = this.method_33(index, commentId, ownerParagraph.Items); if ((mark != null) && (paraItem == ownerParagraph.Items[mark.method_5() - 1])) { int num = mark.method_5(); ownerParagraph.Items.RemoveAt(num - 1); this.method_32(ownerParagraph, num, paraItem); } else { ParagraphBase base2 = paraItem.Clone() as ParagraphBase; this.method_32(ownerParagraph, index - 1, base2); } } } } }
private CommentMark method_33(int A_0, int A_1, ParagraphItemCollection A_2) { ParagraphBase base2 = null; for (int i = A_0; i > 0; i--) { base2 = A_2[i]; if (base2 is CommentMark) { CommentMark mark2 = base2 as CommentMark; if ((mark2.Type == CommentMarkType.CommentStart) && (mark2.CommentId == A_1)) { return(mark2); } } } return(null); }
public void method_3(CommentMark A_0) { this.commentMark_0 = A_0; }
public void method_1(CommentMark A_0) { this.commentMark_1 = A_0; }
public Class821(CommentMark A_0, CommentMark A_1) { this.commentMark_0 = A_0; this.commentMark_1 = A_1; }
internal virtual VisitorAction vmethod_33(CommentMark A_0) { return(VisitorAction.Continue); }