示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var api = new BasecampAPI();

            if (string.IsNullOrEmpty(QueryString))
            {
                rptProjects.DataSource = api.GetProjects();
                rptProjects.DataBind();
                projects.Visible = true;
            }
            else
            {
                to_do_timer.Visible = true;
                if (QueryString.StartsWith("P"))
                {
                    var proj = api.GetProject(int.Parse(QueryString.Substring(1)));
                    lblParent.Text = proj.Name;
                }
                else if (QueryString.StartsWith("T"))
                {
                    var proj = api.GetTodo(int.Parse(QueryString.Substring(1)));
                    lblParent.Text = proj.Name + " > " + proj.TodoLists.First().Name;
                }
                else
                {
                    var proj    = api.GetItem(int.Parse(QueryString.Substring(1)));
                    var tdoList = proj.TodoLists.First().ListItem.Where(x => x.ID == int.Parse(QueryString.Substring(1))).FirstOrDefault();
                    lblParent.Text = proj.Name + " > " + proj.TodoLists.First().Name + " > " + tdoList.Name;
                }
            }
        }
示例#2
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);
            }
        }
示例#3
0
        public AddMessageDialog(BasecampAPI.Message messageObj, string comment)
        {
            InitializeComponent();

            label.Visible = title.Visible = label1.Visible = category.Visible = false;

            int bottom = message.Bottom;
            message.Top = title.Top;
            message.Height = bottom - message.Top;
            label2.Location = label.Location;
            label2.Text = "Comment";
            message.Text = comment.Trim();
        }
示例#4
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;
            }
        }
示例#5
0
 private void ShowComments(BasecampAPI.Message message)
 {
     messages.Visible = false;
     comments.BringToFront();
     comments.SetMessage(message);
     comments.Visible = true;
     label3.Text = "Tap anywhere to go back to the list of messages.";
     label.Text = "Add a comment";
 }
示例#6
0
 private MessageControl AddMessageControl(BasecampAPI.Message m)
 {
     MessageControl c = new MessageControl();
     c.Height = Width;
     c.Width = 100;
     c.AutoSize = true;
     c.Visible = true;
     c.Dock = DockStyle.Fill;
     table.Controls.Add(c);
     c.SetMessage(m);
     c.Click += new EventHandler(Message_Click);
     return c;
 }
示例#7
0
 public MessageListEventArgs(BasecampAPI.Message message)
 {
     Message = message;
 }