Inheritance: ObservableObject
Ejemplo 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);
        }
Ejemplo n.º 2
0
        public void AddModifiers(SpellLineModifiers modifiers)
        {
            if (modifiers == null)
            throw new ArgumentNullException("modifiers");

              lineModifiers.Add(modifiers);
              OnModifiersAdded(modifiers);
        }
Ejemplo 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;
 }
Ejemplo n.º 4
0
        public void AddModifiers(SpellLineModifiers modifiers)
        {
            if (modifiers == null)
            {
                throw new ArgumentNullException("modifiers");
            }

            lineModifiers.Add(modifiers);
            OnModifiersAdded(modifiers);
        }
Ejemplo n.º 5
0
        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";
        }
Ejemplo n.º 7
0
 public void ChangeModifiers(SpellLineModifiers target, SpellLineModifiers source)
 {
     source.CopyTo(target);
     OnModifiersChanged(target);
 }
Ejemplo n.º 8
0
 void OnModifiersRemoved(SpellLineModifiers modifiers)
 {
     ModifiersRemoved?.Invoke(this, new SpellLineModifiersEventArgs(modifiers));
 }
Ejemplo n.º 9
0
 public SpellLineModifiersEventArgs(SpellLineModifiers modifiers)
 {
     this.modifiers = modifiers;
 }
 public SpellLineModifiersEventArgs(SpellLineModifiers modifiers)
 {
     this.modifiers = modifiers;
 }
Ejemplo 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;
 }
Ejemplo n.º 12
0
        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);
        }
Ejemplo 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;
        }
Ejemplo n.º 16
0
 void OnModifiersRemoved(SpellLineModifiers modifiers)
 {
     ModifiersRemoved?.Invoke(this, new SpellLineModifiersEventArgs(modifiers));
 }
Ejemplo 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;
        }