/// <summary>
 /// When the tab control is selecting the preview tab page, we must process
 /// the user input and display the processed text to the browser.
 /// </summary>
 private void TabControl_Selecting(object sender, TabControlCancelEventArgs e)
 {
     if (e.TabPage == this.mTabPagePreview)
     {
         this.mHtmlPanel.Text = MarkdownHelper.TranslateWithStyle(this.mTextBoxUserInput.Text);
     }
 }
Exemple #2
0
        private void ButtonUpdate_Click(object sender, EventArgs e)
        {
            using (var lDataContext = new IssueTrackerDataContext())
            {
                this.Issue = lDataContext.Issues.Single(x => x.Id == this.Issue.Id);
                this.Issue.LastUpdatedDateTime = DateTime.UtcNow;
                this.Issue.Title = this.mTextBoxTitle.Text;
                this.Issue.Body  = this.mTextPreviewViewBody.Text;
                lDataContext.SubmitChanges();
            }

            this.mLabelTitle.Text   = this.Issue.Title;
            this.mHtmlPanel.Text    = MarkdownHelper.TranslateWithStyle(this.Issue.Body);
            this.mHtmlPanel.Visible = true;
        }
Exemple #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            using (var lDataContext = new IssueTrackerDataContext())
            {
                this.Issue = lDataContext.Issues.Single(x => x.Id == this.Issue.Id);

                this.mLabelAuthor.Text       = this.Issue.OpenedByUser.FullName;
                this.mLabelAuthorFooter.Text = "opened this issue " + (DateTime.UtcNow - this.Issue.CreationDateTime).ToRelativePastTimeString();
                this.mLabelTitle.Text        = this.Issue.Title;
                this.mLabelAssignedUser.Text = this.Issue.AssignedUser.Get(x => x.FullName, string.Empty);
                this.mLabelMilestone.Text    = this.Issue.Milestone.Get(x => x.Title, string.Empty);
                this.mHtmlPanel.Text         = MarkdownHelper.TranslateWithStyle(this.Issue.Body);

                this.mListBoxLabels.Items.AddRange(
                    this.Issue.IssueLabels.Select(x => x.Label).OrderBy(x => x.Name).ToArray());
            }
        }