コード例 #1
0
        private BsInfo getSelectionInfo(string selection_id)
        {
            BsInfo info;

            if (!this.selectionInfoDict.TryGetValue(selection_id, out info))
            {
                info = new BsInfo();
                this.selectionInfoDict.Add(selection_id, info);
            }
            return(info);
        }
コード例 #2
0
        private BsInfo getBoardInfo(string board_id)
        {
            BsInfo info;

            if (!this.boardInfoDict.TryGetValue(board_id, out info))
            {
                info = new BsInfo();
                this.boardInfoDict.Add(board_id, info);
            }
            return(info);
        }
コード例 #3
0
        public BsMap()
        {
            StringWriter writer = new StringWriter();

            writer.WriteStartTag("nav");
            BoardInfoStore.GetBoards((board_id, board_name) =>
            {
                if (uint.Parse(board_id.Substring(1)) >= 1149)
                {
                    writer.WriteBoardAnchor(board_id, board_name);
                }

                getBoardInfo(board_id).Name = board_name;
            });
            writer.WriteEndTag("nav");
            //
            writer.WriteStartTag("aside");
            SelectionInfoStore.GetSelections((selection_id, selection_name, board_list) =>
            {
                if (uint.Parse(selection_id.Substring(1)) >= 1027)
                {
                    writer.WriteStartTag("nav");

                    writer.WriteBoardAnchor(selection_id, selection_name);
                    writer.WriteForCrawler("footer", board_list);

                    writer.WriteEndTag("nav");
                }
                //
                BsInfo sel_info = getSelectionInfo(selection_id);
                sel_info.Name   = selection_name;

                SandId.SplitWithCallback2(board_list, ',', board_id =>
                {
                    this.boardInfoDict[board_id].IdList.Add(selection_id);                              // if the board id does not exist, throw exception.
                    sel_info.IdList.Add(board_id);
                });
            });
            writer.WriteEndTag("aside");

            this.Output = writer.ToString();
        }