private void CooldownTypeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (this.CooldownTypeComboBox.SelectedIndex >= 0)
     {
         CooldownTypeEnum type = EnumHelper.GetEnumValueFromString <CooldownTypeEnum>((string)this.CooldownTypeComboBox.SelectedItem);
         this.CooldownGroupsComboBox.Visibility = (type == CooldownTypeEnum.Group) ? Visibility.Visible : Visibility.Collapsed;
     }
 }
Exemple #2
0
 private void CooldownTypeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (this.CooldownTypeComboBox.SelectedIndex >= 0)
     {
         CooldownTypeEnum type = (CooldownTypeEnum)this.CooldownTypeComboBox.SelectedItem;
         this.CooldownGroupsComboBox.Visibility = (type == CooldownTypeEnum.Group) ? Visibility.Visible : Visibility.Collapsed;
     }
 }
        public CooldownRequirementViewModel(CooldownTypeEnum type, string groupName, int amount)
        {
            this.Type      = type;
            this.GroupName = groupName;

            if (!string.IsNullOrEmpty(this.GroupName) && ChannelSession.Settings != null)
            {
            }
        }
        public async Task <bool> Validate()
        {
            if (this.GetCooldownAmount() < 0)
            {
                await MessageBoxHelper.ShowMessageDialog("Cooldown must be 0 or greater");

                return(false);
            }

            CooldownTypeEnum type = EnumHelper.GetEnumValueFromString <CooldownTypeEnum>((string)this.CooldownTypeComboBox.SelectedItem);

            if (type == CooldownTypeEnum.Group && string.IsNullOrEmpty(this.CooldownGroupsComboBox.Text))
            {
                await MessageBoxHelper.ShowMessageDialog("A Cooldown Group must be specified");

                return(false);
            }

            return(true);
        }
 public CooldownRequirementViewModel GetCooldownRequirement()
 {
     if (this.CooldownTypeComboBox.SelectedIndex >= 0 && this.GetCooldownAmount() >= 0)
     {
         CooldownTypeEnum type = EnumHelper.GetEnumValueFromString <CooldownTypeEnum>((string)this.CooldownTypeComboBox.SelectedItem);
         if (type == CooldownTypeEnum.Group)
         {
             if (string.IsNullOrEmpty(this.CooldownGroupsComboBox.Text))
             {
                 return(null);
             }
             return(new CooldownRequirementViewModel(type, this.CooldownGroupsComboBox.Text, this.GetCooldownAmount()));
         }
         else
         {
             return(new CooldownRequirementViewModel(type, this.GetCooldownAmount()));
         }
     }
     return(new CooldownRequirementViewModel());
 }
 public CooldownRequirementModel(CooldownTypeEnum type, int amount, string groupName = null)
 {
     this.Type      = type;
     this.Amount    = amount;
     this.GroupName = groupName;
 }
Exemple #7
0
 public CooldownRequirementViewModel(CooldownTypeEnum type, int amount)
 {
     this.Type   = type;
     this.Amount = amount;
 }