コード例 #1
0
        /// <summary>
        /// Parses a line from the RC bot.
        /// </summary>
        /// <param name="rcItem">The rc item.</param>
        /// <returns></returns>
        private static RcPageChange rcParser(string rcItem)
        {
            const string colorCodeControlChar = "\x03";
            string[] colorCodes = {
                                      colorCodeControlChar + "4",
                                      colorCodeControlChar + "5",
                                      colorCodeControlChar + "07",
                                      colorCodeControlChar + "10",
                                      colorCodeControlChar + "14",
                                      colorCodeControlChar + "02",
                                      colorCodeControlChar + "03",
                                      colorCodeControlChar
                                  };

            string[] parts = rcItem.Split(colorCodes, StringSplitOptions.RemoveEmptyEntries);
            if (parts.Length < 12)
            {
                return new RcPageChange();
            }
            if (parts[1].Contains("Special:"))
            {
                return new RcPageChange();
            }

            RcPageChange ret = new RcPageChange
                                   {
                                       title = parts[ 1 ],
                                       flags = parts[ 3 ].Trim( ),
                                       diffUrl = parts[ 5 ],
                                       user = parts[ 9 ],
                                       byteDiff = parts[ 12 ].Trim( '(', ')' )
                                   };
            if (parts.Length > 13)
            {
                ret.comment = parts[13];
            }
            return ret;
        }
コード例 #2
0
 // TODO: what's the point in this function? is it to prevent a nullref on the event calls?
 private static void pageWatcherControllerPageWatcherNotificationEvent(RcPageChange rcItem)
 {
 }