Example #1
0
 public void DispatchChanged()
 {
     if (ChangedEvent != null)
     {
         ChangedEvent.Invoke();
     }
 }
        /// <summary>Adds an existing <see cref="VisualListViewColumn" /> to the collection.</summary>
        /// <param name="column">The <see cref="VisualListViewColumn" /> to add to the collection.</param>
        public virtual void Add(VisualListViewColumn column)
        {
            column.ListView      = _listView;
            column.ChangedEvent += Column_Changed;

            List.Add(column);
            ChangedEvent?.Invoke(this, new ListViewChangedEventArgs(ListViewChangedTypes.ColumnCollectionChanged, column, null, null));
        }
 /// <summary>Removes the item at the specified index within the collection.</summary>
 /// <param name="index">The zero-based index of the item to remove.</param>
 public new virtual void RemoveAt(int index)
 {
     if (List.IsValidIndex(index))
     {
         List.RemoveAt(index);
         ChangedEvent?.Invoke(this, new ListViewChangedEventArgs(ListViewChangedTypes.ColumnCollectionChanged, null, null, null));
     }
 }
Example #4
0
        /// <summary>Adds an existing <see cref="VisualListViewItem" /> to the collection.</summary>
        /// <param name="value">The <see cref="VisualListViewItem" /> to add to the collection.</param>
        /// <returns>The <see cref="VisualListViewItem" />.</returns>
        public virtual VisualListViewItem Add(VisualListViewItem value)
        {
            value.ListView      = _listView;
            value.ChangedEvent += Item_Changed;

            List.Add(value);
            ChangedEvent?.Invoke(this, new ListViewChangedEventArgs(ListViewChangedTypes.ItemCollectionChanged, null, null, null));
            return(value);
        }
Example #5
0
 public void AddDamage(float damage)
 {
     HP -= damage;
     ChangedEvent?.Invoke(this);
     if (HP < 0)
     {
         DeadEvent?.Invoke(this);
     }
 }
Example #6
0
        /// <summary>
        /// Смотри <see cref="IDataset"/>
        /// </summary>
        public IDatasetItem this[int index]
        {
            get { return(_DataSet[index]); }
            set
            {
                if (_DataSet[index] == value)
                {
                    return;
                }

                _DataSet[index] = (DatasetItem)value;
                ApplyDatasetElement();
                ChangedEvent?.Invoke(this, index);
            }
        }
        /// <summary>Inserts a subitem into the collection at the specified index.</summary>
        /// <param name="index">The zero-based index location where the item is inserted.</param>
        /// <param name="item">A <see cref="VisualListViewSubItem" /> representing the subitem to insert into the collection.</param>
        /// <returns>The <see cref="VisualListViewSubItem" />.</returns>
        public VisualListViewSubItem Insert(int index, VisualListViewSubItem item)
        {
            item.ListView      = _listView;
            item.ChangedEvent += SubItem_Changed;

            if (index < 0)
            {
                List.Add(item);
            }
            else
            {
                List.Insert(index, item);
            }

            ChangedEvent?.Invoke(this, new ListViewChangedEventArgs(ListViewChangedTypes.SubItemCollectionChanged, null, null, item));
            return(item);
        }
        /// <summary>Inserts an existing column header into the collection at the specified index.</summary>
        /// <param name="index">The zero-based index location where the column header is inserted.</param>
        /// <param name="value">The <see cref="VisualListViewColumn" /> to insert into the collection.</param>
        public void Insert(int index, VisualListViewColumn value)
        {
            value.ListView      = _listView;
            value.ChangedEvent += Column_Changed;
            value.Name          = nameof(VisualListViewColumn) + List.GetNextID();

            if (index < 0)
            {
                List.Add(value);
            }
            else
            {
                List.Insert(index, value);
            }

            ChangedEvent?.Invoke(this, new ListViewChangedEventArgs(ListViewChangedTypes.ColumnCollectionChanged, value, null, null));
        }
Example #9
0
        public void Damage(int damageAmount)
        {
            if (isInvulnerable)
            {
                return;
            }

            currentHealth -= damageAmount;
            ChangedEvent.Invoke(currentHealth, startingHealth);

            if (currentHealth <= 0)
            {
                DeathEvent.Invoke();
            }
            else
            {
                isInvulnerable = true;
                StartCoroutine(TemporaryInvulnerability());
            }
        }
Example #10
0
        /// <summary>Inserts an existing <see cref="VisualListViewItem" /> into the collection at the specified index.</summary>
        /// <param name="index">The zero-based index location where the item is inserted.</param>
        /// <param name="item">The <see cref="VisualListViewItem" /> that represents the item to insert.</param>
        /// <returns>The <see cref="VisualListViewItem" />.</returns>
        public VisualListViewItem Insert(int index, VisualListViewItem item)
        {
            if ((index < 0) || (index > Count))
            {
                throw new ArgumentOutOfRangeException("index=" + index);
            }

            item.ListView      = _listView;
            item.ChangedEvent += Item_Changed;

            if (index < 0)
            {
                List.Add(item);
            }
            else
            {
                List.Insert(index, item);
            }

            ChangedEvent?.Invoke(this, new ListViewChangedEventArgs(ListViewChangedTypes.ItemCollectionChanged, null, null, null));
            return(item);
        }
Example #11
0
 internal void Notify()
 {
     Volatile.Write(ref _changed, true);
     ChangedEvent?.Invoke();
 }
 /// <summary>The columns header collection has been cleared event.</summary>
 protected override void OnClear()
 {
     ChangedEvent?.Invoke(this, new ListViewChangedEventArgs(ListViewChangedTypes.ColumnCollectionChanged, null, null, null));
 }
Example #13
0
        private void Excees_Changed(bool visibility)
        {
            _allExcessVisibilityImage.color = _exceeses.All(e => e.IsChecked) ? _checkedColor : _uncheckedColor;

            Changed.Invoke();
        }
 /// <summary>The sub item has changed.</summary>
 /// <param name="source">The source.</param>
 /// <param name="e">The event args.</param>
 public void SubItem_Changed(object source, ListViewChangedEventArgs e)
 {
     ChangedEvent?.Invoke(source, e);
 }
Example #15
0
 public void SetBoundaryCenter(Vector2Int _center)
 {
     boundary.position = new Vector2Int(_center.x - boundary.width / 2, _center.y - boundary.height / 2);
     ChangedEvent?.Invoke(boundary);
 }
Example #16
0
 public override Task <int> SaveChangesAsync(CancellationToken cancellationToken)
 {
     ChangedEvent?.Invoke();
     return(base.SaveChangesAsync(cancellationToken));
 }
Example #17
0
        private void Slider_OnValueChanged(float value)
        {
            _timeText.text = $"{value}/18";

            Changed.Invoke((int)value);
        }
Example #18
0
 /// <summary>The sub item has changed.</summary>
 /// <param name="source">The source.</param>
 /// <param name="e">The event args.</param>
 public void SubItem_Changed(object source, ListViewChangedEventArgs e)
 {
     DebugTraceManager.WriteDebug("VisualListViewSubItemCollection::SubItem_Changed", DebugTraceManager.DebugOutput.TraceListener);
     ChangedEvent?.Invoke(source, e);
 }
Example #19
0
 private void DatasetItemOnEventChanged(IDatasetItem o)
 {
     ChangedEvent?.Invoke(this, _DataSet.IndexOf((DatasetItem)o));
     ApplyDatasetElement();
 }
Example #20
0
 /// <summary>The sub item has changed.</summary>
 /// <param name="source">The source.</param>
 /// <param name="e">The event args.</param>
 public void SubItem_Changed(object source, ListViewChangedEventArgs e)
 {
     ConsoleEx.WriteDebug("VisualListViewSubItemCollection::SubItem_Changed");
     ChangedEvent?.Invoke(source, e);
 }
Example #21
0
 public override int SaveChanges()
 {
     ChangedEvent?.Invoke();
     return(base.SaveChanges());
 }
 /// <summary>The column has changed. Pass event up the chain.</summary>
 /// <param name="source">The source.</param>
 /// <param name="e">The event args.</param>
 public void Column_Changed(object source, ListViewChangedEventArgs e)
 {
     ChangedEvent?.Invoke(source, e);
 }
Example #23
0
 public override Task <int> SaveChangesAsync()
 {
     ChangedEvent?.Invoke();
     return(base.SaveChangesAsync());
 }
 public void OnChanged()
 {
     ChangedEvent?.Invoke();
 }
Example #25
0
 /// <summary>Removes the specified item from the collection.</summary>
 /// <param name="item">The <see cref="VisualListViewItem" /> representing the item to remove from the collection.</param>
 public virtual void Remove(VisualListViewItem item)
 {
     List.Remove(item);
     ChangedEvent?.Invoke(this, new ListViewChangedEventArgs(ListViewChangedTypes.ItemCollectionChanged, null, null, null));
 }