Ejemplo n.º 1
0
 public ModerationAction(ModerationActionTypeEnum moderationType, string username, string timeAmount)
     : this()
 {
     this.ModerationType = moderationType;
     this.UserName       = username;
     this.TimeAmount     = timeAmount;
 }
Ejemplo n.º 2
0
        private void ModerationActionTypeComboBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            this.UserNameTextBox.Visibility         = Visibility.Collapsed;
            this.TimeAmountTextBox.Visibility       = Visibility.Collapsed;
            this.ModerationReasonTextBox.Visibility = Visibility.Collapsed;

            if (this.ModerationActionTypeComboBox.SelectedIndex >= 0)
            {
                ModerationActionTypeEnum moderationType = EnumHelper.GetEnumValueFromString <ModerationActionTypeEnum>((string)this.ModerationActionTypeComboBox.SelectedItem);

                if (moderationType == ModerationActionTypeEnum.ChatTimeout || moderationType == ModerationActionTypeEnum.PurgeUser ||
                    moderationType == ModerationActionTypeEnum.BanUser || moderationType == ModerationActionTypeEnum.UnbanUser || moderationType == ModerationActionTypeEnum.InteractiveTimeout ||
                    moderationType == ModerationActionTypeEnum.AddModerationStrike || moderationType == ModerationActionTypeEnum.RemoveModerationStrike)
                {
                    this.UserNameTextBox.Visibility = Visibility.Visible;
                }

                if (moderationType == ModerationActionTypeEnum.ChatTimeout || moderationType == ModerationActionTypeEnum.InteractiveTimeout)
                {
                    this.TimeAmountTextBox.Visibility = Visibility.Visible;
                }

                if (moderationType == ModerationActionTypeEnum.AddModerationStrike)
                {
                    this.ModerationReasonTextBox.Visibility = Visibility.Visible;
                }
            }
        }
Ejemplo n.º 3
0
 public ModerationActionModel(ModerationActionTypeEnum actionType, string targetUsername = null, string timeoutAmount = null, string moderationReason = null)
     : base(ActionTypeEnum.Moderation)
 {
     this.ActionType       = actionType;
     this.TargetUsername   = targetUsername;
     this.TimeoutAmount    = timeoutAmount;
     this.ModerationReason = moderationReason;
 }
Ejemplo n.º 4
0
        public override ActionBase GetAction()
        {
            if (this.ModerationActionTypeComboBox.SelectedIndex >= 0)
            {
                ModerationActionTypeEnum moderationType = EnumHelper.GetEnumValueFromString <ModerationActionTypeEnum>((string)this.ModerationActionTypeComboBox.SelectedItem);

                if (moderationType == ModerationActionTypeEnum.ChatTimeout || moderationType == ModerationActionTypeEnum.InteractiveTimeout)
                {
                    if (string.IsNullOrEmpty(this.TimeAmountTextBox.Text))
                    {
                        return(null);
                    }
                }

                return(new ModerationAction(moderationType, this.UserNameTextBox.Text, this.TimeAmountTextBox.Text, this.ModerationReasonTextBox.Text));
            }
            return(null);
        }