示例#1
0
        public void SetMessage(BasecampAPI.Message message)
        {
            StopListeningToControls();

            this.Message = message;

            table.Controls.Clear();

            List<PostComment> comments = message.Comments;

            AddMessageControl(message);
            AddSeperator();

            foreach (PostComment comment in comments)
            {

                MessageControl c = new MessageControl();
                c.Height = 100;
                c.Width = 100;
                c.Visible = true;
                c.AutoSizeMode = AutoSizeMode.GrowAndShrink;
                table.Controls.Add(c);
                int row = table.GetCellPosition(c).Row;
                table.RowStyles.Add(new RowStyle(SizeType.AutoSize));
                c.SetComment(comment);
            }
        }
示例#2
0
        internal void SetComment(PostComment c)
        {
            this.message = null;

            if (c != null)
            {
                this.title.Text = string.Empty;
                this.body.Text = c.Body;

                string person = (c.Author != null ? c.Author.ToString() : "Unknown");

                info.Text = string.Format("Posted on {0} at {1} by {2}", c.PostedOn.ToShortDateString(), c.PostedOn.ToLongTimeString(), person);
                info.Top = body.Bottom + 5;
            }
        }
示例#3
0
        public void SetMessage(BasecampAPI.Message message)
        {
            this.message = message;

            if (message != null)
            {
                this.title.Text = message.Title;
                this.body.Text = message.Body;

                int n = message.CommentsCount;
                string commentDisplay = string.Format("{0} comment{1}.", n, n != 1 ? "s" : string.Empty);
                string person = (message.Author != null ? message.Author.ToString() : "Unknown");

                info.Text = string.Format("Posted on {0} by {1}.  {2}", message.PostedOn.ToShortDateString(),  person, commentDisplay);
                info.Top = body.Bottom + 5;
            }
        }
示例#4
0
 public MessageListEventArgs(BasecampAPI.Message message)
 {
     Message = message;
 }