示例#1
0
        /// <summary>
        /// Add a rank task in complete format.
        /// </summary>
        /// <param name="task">The task to output.</param>
        private void AddCompleteTask(KeyValuePair <string, RankResults> task)
        {
            AddTaskLabel(task.Key);

            AddRankedOptions(task.Key);

            int index = 0;

            foreach (var winner in task.Value)
            {
                if (winner.Option == null)
                {
                    continue;
                }

                sb.Append("[b]");
                sb.Append(rankWinnerLabels[index++]);
                sb.Append(":[/b] ");
                sb.Append(VoteString.FormatBBCodeForOutput(winner.Option));

                if (AdvancedOptions.Instance.DebugMode)
                {
                    sb.AppendLine($" >>> {VoteString.FormatBBCodeForOutput(winner.Debug)}");
                }
                else
                {
                    sb.AppendLine();
                }

                if (index > 4)
                {
                    index = 4;
                }

                if (DisplayMode != DisplayMode.NormalNoVoters)
                {
                    AddRankedVoters(task.Key, winner.Option);
                }
                else
                {
                    sb.AppendLine();
                }
            }
        }
示例#2
0
 /// <summary>
 /// Trims the provided content string if TrimExtendedText option is set.
 /// Otherwise returns the original string.
 /// </summary>
 /// <param name="content">The content that is the basis for the display content.</param>
 /// <returns>Returns vote content suitable for display.</returns>
 private string GetDisplayContent(string content)
 {
     return(VoteString.FormatBBCodeForOutput(content));
 }
示例#3
0
 /// <summary>
 /// Adds the vote string as a full line to the string builder, after reformatting any BBCode.
 /// </summary>
 /// <param name="vote">The vote.</param>
 private void AddVoteStringLine(string vote)
 {
     sb.AppendLine(VoteString.FormatBBCodeForOutput(vote));
 }