Inheritance: ObservableObject
Esempio n. 1
0
        public bool RemoveModifiers(SpellLineModifiers modifiers)
        {
            if (modifiers == null)
            {
                throw new ArgumentNullException("modifiers");
            }

            SpellLineModifiers removedModifiers = null;

            foreach (var modifier in lineModifiers)
            {
                if (modifier == modifiers)
                {
                    removedModifiers = modifier;
                    break;
                }
            }

            var wasRemoved = lineModifiers.Remove(modifiers);

            if (removedModifiers != null && wasRemoved)
            {
                OnModifiersRemoved(removedModifiers);
            }

            return(wasRemoved);
        }
Esempio n. 2
0
        public void AddModifiers(SpellLineModifiers modifiers)
        {
            if (modifiers == null)
            throw new ArgumentNullException("modifiers");

              lineModifiers.Add(modifiers);
              OnModifiersAdded(modifiers);
        }
Esempio n. 3
0
 public void CopyTo(SpellLineModifiers other)
 {
     other.Action       = Action;
     other.Scope        = Scope;
     other.ScopeName    = ScopeName;
     other.Value        = Value;
     other.MinThreshold = MinThreshold;
     other.MaxThreshold = MaxThreshold;
 }
Esempio n. 4
0
        public void AddModifiers(SpellLineModifiers modifiers)
        {
            if (modifiers == null)
            {
                throw new ArgumentNullException("modifiers");
            }

            lineModifiers.Add(modifiers);
            OnModifiersAdded(modifiers);
        }
        void OnStaffModifiersChanged(StaffMetadata staff, SpellLineModifiers modifiers)
        {
            RecalculateAllSpells(staff);

            var handler = StaffModifiersChanged;

            if (handler != null)
            {
                handler(staff, new SpellLineModifiersEventArgs(modifiers));
            }
        }
        public LineModifiersEditorWindow(SpellLineModifiers modifiers, bool isEditMode = true)
            : this()
        {
            actionComboBox.SelectedItem = modifiers.Action;
              scopeComboBox.SelectedItem = modifiers.Scope;
              scopeNameTextBox.Text = modifiers.ScopeName;
              valueUpDown.Value = modifiers.Value;
              minThresholdUpDown.Value = modifiers.MinThreshold;
              maxThresholdUpDown.Value = modifiers.MaxThreshold;

              this.IsEditMode = isEditMode;

              if (this.IsEditMode)
            this.Title = "Edit Modifiers";
        }
Esempio n. 7
0
 public void ChangeModifiers(SpellLineModifiers target, SpellLineModifiers source)
 {
     source.CopyTo(target);
     OnModifiersChanged(target);
 }
Esempio n. 8
0
 void OnModifiersRemoved(SpellLineModifiers modifiers)
 {
     ModifiersRemoved?.Invoke(this, new SpellLineModifiersEventArgs(modifiers));
 }
Esempio n. 9
0
 public SpellLineModifiersEventArgs(SpellLineModifiers modifiers)
 {
     this.modifiers = modifiers;
 }
 public SpellLineModifiersEventArgs(SpellLineModifiers modifiers)
 {
     this.modifiers = modifiers;
 }
Esempio n. 11
0
 public void CopyTo(SpellLineModifiers other)
 {
     other.Action = Action;
       other.Scope = Scope;
       other.ScopeName = ScopeName;
       other.Value = Value;
       other.MinThreshold = MinThreshold;
       other.MaxThreshold = MaxThreshold;
 }
        void OnStaffModifiersChanged(StaffMetadata staff, SpellLineModifiers modifiers)
        {
            RecalculateAllSpells(staff);

              var handler = StaffModifiersChanged;

              if (handler != null)
            handler(staff, new SpellLineModifiersEventArgs(modifiers));
        }
        void EditModifiers(StaffMetadata staff, SpellLineModifiers modifiers)
        {
            var modifiersWindow = new LineModifiersEditorWindow(modifiers);
              modifiersWindow.Owner = this;

              var result = modifiersWindow.ShowDialog();
              if (!result.HasValue || !result.Value)
            return;

              staff.ChangeModifiers(modifiers, modifiersWindow.Modifiers);
              lineModifiersListBox.Items.Refresh();

              lineModifiersListBox.SelectedItem = modifiers;
              lineModifiersListBox.ScrollIntoView(modifiers);
        }
Esempio n. 14
0
 public void ChangeModifiers(SpellLineModifiers target, SpellLineModifiers source)
 {
     source.CopyTo(target);
       OnModifiersChanged(target);
 }
        bool RemoveModifiers(SpellLineModifiers modifiers)
        {
            var staff = stavesListBox.SelectedItem as StaffMetadata;
              if (staff == null)
            return false;

              var wasRemoved = staff.RemoveModifiers(modifiers);

              if (wasRemoved)
            lineModifiersListBox.Items.Refresh();

              return wasRemoved;
        }
Esempio n. 16
0
 void OnModifiersRemoved(SpellLineModifiers modifiers)
 {
     ModifiersRemoved?.Invoke(this, new SpellLineModifiersEventArgs(modifiers));
 }
Esempio n. 17
0
        public bool RemoveModifiers(SpellLineModifiers modifiers)
        {
            if (modifiers == null)
            throw new ArgumentNullException("modifiers");

              SpellLineModifiers removedModifiers = null;

              foreach (var modifier in lineModifiers)
            if (modifier == modifiers)
            {
              removedModifiers = modifier;
              break;
            }

              var wasRemoved = lineModifiers.Remove(modifiers);

              if (removedModifiers != null && wasRemoved)
            OnModifiersRemoved(removedModifiers);

              return wasRemoved;
        }