Пример #1
0
        public void addPosts()
        {
            this.wallScrollArea.clearControls();
            int y        = 0;
            int position = 0;

            this.lineList.Clear();
            int yourRank             = GameEngine.Instance.World.getYourFactionRank();
            ForumThreadInfoData data = (ForumThreadInfoData)this.threadArray[ThreadID];

            if (data != null)
            {
                foreach (ForumPostData data2 in data.forumPosts)
                {
                    if (y != 0)
                    {
                        y += 5;
                    }
                    FactionsPostLine control = new FactionsPostLine {
                        Position = new Point(0, y)
                    };
                    control.init(data2, position, this, yourRank);
                    this.wallScrollArea.addControl(control);
                    y += control.Height;
                    this.lineList.Add(control);
                    position++;
                }
            }
            this.wallScrollArea.Size = new Size(this.wallScrollArea.Width, y);
            if (y < this.wallScrollBar.Height)
            {
                this.wallScrollBar.Visible = false;
            }
            else
            {
                this.wallScrollBar.Visible         = true;
                this.wallScrollBar.NumVisibleLines = this.wallScrollBar.Height;
                this.wallScrollBar.Max             = y - this.wallScrollBar.Height;
            }
            this.update();
            base.Invalidate();
        }
 public void addPosts()
 {
     this.wallScrollArea.clearControls();
     int y = 0;
     int position = 0;
     this.lineList.Clear();
     int yourRank = GameEngine.Instance.World.getYourFactionRank();
     ForumThreadInfoData data = (ForumThreadInfoData) this.threadArray[ThreadID];
     if (data != null)
     {
         foreach (ForumPostData data2 in data.forumPosts)
         {
             if (y != 0)
             {
                 y += 5;
             }
             FactionsPostLine control = new FactionsPostLine {
                 Position = new Point(0, y)
             };
             control.init(data2, position, this, yourRank);
             this.wallScrollArea.addControl(control);
             y += control.Height;
             this.lineList.Add(control);
             position++;
         }
     }
     this.wallScrollArea.Size = new Size(this.wallScrollArea.Width, y);
     if (y < this.wallScrollBar.Height)
     {
         this.wallScrollBar.Visible = false;
     }
     else
     {
         this.wallScrollBar.Visible = true;
         this.wallScrollBar.NumVisibleLines = this.wallScrollBar.Height;
         this.wallScrollBar.Max = y - this.wallScrollBar.Height;
     }
     this.update();
     base.Invalidate();
 }