當前位置: 首頁>>代碼示例>>C#>>正文


C# FeedbackItem.SetStatus方法代碼示例

本文整理匯總了C#中Subtext.Framework.Components.FeedbackItem.SetStatus方法的典型用法代碼示例。如果您正苦於以下問題:C# FeedbackItem.SetStatus方法的具體用法?C# FeedbackItem.SetStatus怎麽用?C# FeedbackItem.SetStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Subtext.Framework.Components.FeedbackItem的用法示例。


在下文中一共展示了FeedbackItem.SetStatus方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Delete

        /// <summary>
        /// Confirms the feedback as spam and moves it to the trash.
        /// </summary>
        /// <param name="feedback">The feedback.</param>
        public static void Delete(this ObjectRepository repository, FeedbackItem feedback)
        {
            if (feedback == null)
            {
                throw new ArgumentNullException("feedback");
            }

            feedback.SetStatus(FeedbackStatusFlag.Approved, false);
            feedback.SetStatus(FeedbackStatusFlag.Deleted, true);

            repository.Update(feedback);
        }
開發者ID:rhoadsce,項目名稱:Subtext,代碼行數:16,代碼來源:FeedbackExtensions.cs

示例2: Approve

        /// <summary>
        /// Approves the comment, and removes it from the SPAM folder or from the 
        /// Trash folder.
        /// </summary>
        /// <param name="feedback"></param>
        /// <param name="spamService"></param>
        /// <returns></returns>
        public static void Approve(this ObjectRepository repository, FeedbackItem feedback, ICommentSpamService spamService)
        {
            if (feedback == null)
            {
                throw new ArgumentNullException("feedback");
            }

            feedback.SetStatus(FeedbackStatusFlag.Approved, true);
            feedback.SetStatus(FeedbackStatusFlag.Deleted, false);
            if (spamService != null)
            {
                spamService.SubmitGoodFeedback(feedback);
            }

            repository.Update(feedback);
        }
開發者ID:rhoadsce,項目名稱:Subtext,代碼行數:23,代碼來源:FeedbackExtensions.cs

示例3: ConfirmSpam

        /// <summary>
        /// Confirms the feedback as spam and moves it to the trash.
        /// </summary>
        /// <param name="feedback">The feedback.</param>
        public static void ConfirmSpam(FeedbackItem feedback)
        {
            if (feedback == null)
                throw new ArgumentNullException("feedback", "Cannot approve a null comment.");

            feedback.SetStatus(FeedbackStatusFlag.Approved, false);
            feedback.SetStatus(FeedbackStatusFlag.ConfirmedSpam, true);

            if (Config.CurrentBlog.FeedbackSpamService != null)
            {
                Config.CurrentBlog.FeedbackSpamService.SubmitGoodFeedback(feedback);
            }

            Update(feedback);
        }
開發者ID:ayende,項目名稱:Subtext,代碼行數:19,代碼來源:FeedbackItem.cs

示例4: Delete

        /// <summary>
        /// Confirms the feedback as spam and moves it to the trash.
        /// </summary>
        /// <param name="feedback">The feedback.</param>
        public static void Delete(FeedbackItem feedback)
        {
            if (feedback == null)
                throw new ArgumentNullException("feedback", "Cannot delete a null comment.");

            feedback.SetStatus(FeedbackStatusFlag.Approved, false);
            feedback.SetStatus(FeedbackStatusFlag.Deleted, true);

            Update(feedback);
        }
開發者ID:ayende,項目名稱:Subtext,代碼行數:14,代碼來源:FeedbackItem.cs

示例5: ConfirmSpam

        /// <summary>
        /// Confirms the feedback as spam and moves it to the trash.
        /// </summary>
        /// <param name="feedback">The feedback.</param>
        /// <param name="spamService"></param>
        public static void ConfirmSpam(FeedbackItem feedback, ICommentSpamService spamService)
        {
            if(feedback == null)
            {
                throw new ArgumentNullException("feedback");
            }

            feedback.SetStatus(FeedbackStatusFlag.Approved, false);
            feedback.SetStatus(FeedbackStatusFlag.ConfirmedSpam, true);

            if(spamService != null)
            {
                spamService.SubmitGoodFeedback(feedback);
            }

            Update(feedback);
        }
開發者ID:ChrisPelatari,項目名稱:SubText,代碼行數:22,代碼來源:FeedbackItem.cs


注:本文中的Subtext.Framework.Components.FeedbackItem.SetStatus方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。