Exemplo n.º 1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter != null)
            {
                comments = new List <CommentAPI>();

                if (e.Parameter as List <TaskCommentAPI> != null)
                {
                    foreach (CommentAPI comment in e.Parameter as List <TaskCommentAPI> )
                    {
                        comments.Add(comment);
                    }
                }
                else if (e.Parameter as List <RequirementCommentAPI> != null)
                {
                    foreach (CommentAPI comment in e.Parameter as List <RequirementCommentAPI> )
                    {
                        comments.Add(comment);
                    }
                }
                else
                {
                    foreach (CommentAPI comment in e.Parameter as List <TaskLogCommentAPI> )
                    {
                        comments.Add(comment);
                    }
                }

                currentComment      = comments[0];
                currentCommentIndex = 0;

                CommentText.Document.SetText(Windows.UI.Text.TextSetOptions.FormatRtf, currentComment.comment);
            }
        }
Exemplo n.º 2
0
        protected override void OnLoad(EventArgs e)
        {
            if (SiteConfig.EnableComments)
            {
                // implement the Comment API
                if (SiteConfig.EnableCommentApi &&
                    Request.ContentType == "text/xml" &&
                    Request.RequestType == "POST" &&
                    Request.QueryString["guid"] != null)
                {
                    CommentAPI commentAPI = new CommentAPI();
                    commentAPI.ProcessRequest(Context);
                }

                //Setup the Live Comment Preview with an allowed tags array "'a', 'b', 'p', 'strong', 'blockquote', 'i', 'em', 'u', 'strike', 'sup', 'sub', 'code'"
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "allowedHtmlTags", String.Format(@"
				<script type=""text/javascript"">
					var allowedHtmlTags = [{0}];
				</script>
				<script type=""text/javascript"" src=""scripts/LiveCommentPreview.js"" defer=""defer""></script>"                , SiteConfig.AllowedTags.ToJavaScriptArray()));
                base.OnLoad(e);
            }
            else
            {
                this.Redirect(SiteUtilities.GetPermaLinkUrl(Request.QueryString["guid"]));
            }
        }
Exemplo n.º 3
0
        private void AppBarButton_Click_1(object sender, RoutedEventArgs e)
        {
            if (currentCommentIndex > 0)
            {
                currentCommentIndex--;
                currentComment = comments[currentCommentIndex];

                CommentText.Document.SetText(Windows.UI.Text.TextSetOptions.FormatRtf, currentComment.comment);
            }
        }
Exemplo n.º 4
0
		/// <summary>
		/// 构造函数
		/// </summary>
		/// <param name="client">操作类</param>
		public CommentInterface(Client client)
			: base(client)
		{
			api = new CommentAPI(client);
		}
Exemplo n.º 5
0
 /// <summary>
 ///     构造函数
 /// </summary>
 /// <param name="client">操作类</param>
 public CommentInterface(Client client)
     : base(client)
 {
     api = new CommentAPI(client);
 }