Subtext.Framework.Components.FeedbackItem.SetStatus C# (CSharp) Method

SetStatus() protected method

Turns the specified status bit on or off depending on the setOn value.
protected SetStatus ( FeedbackStatusFlag status, bool setOn ) : void
status FeedbackStatusFlag
setOn bool
return void
        protected void SetStatus(FeedbackStatusFlag status, bool setOn)
        {
            if (setOn)
            {
                this.Status = Status | status;
            }
            else
            {
                this.Status = Status & ~status;
            }
        }

Usage Example

Example #1
0
        /// <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);
        }
All Usage Examples Of Subtext.Framework.Components.FeedbackItem::SetStatus