コード例 #1
0
        /// <summary>
        /// delete alert by number
        /// удалить алерт по номеру
        /// </summary>
        /// <param name="number">alert number/номер алерта</param>
        public void DeleteFromNumber(int number)
        {
            try
            {
                if (_alertArray == null ||
                    number > _alertArray.Count ||
                    _alertArray.Count == 0)
                {
                    return;
                }

                IIAlert activAlert = _alertArray[number];

                activAlert.Delete();
                // 2 delete
                // 2 удаляем

                _alertArray.Remove(activAlert);

                Save();

                Paint();
            }
            catch (Exception error)
            {
                SendNewMessage(error.ToString(), LogMessageType.Error);
            }
        }
コード例 #2
0
        /// <summary>
        /// delete alert
        ///  удалить Алерт
        /// </summary>
        /// <param name="alert">alert/алерт</param>
        public void Delete(IIAlert alert)
        {
            try
            {
                if (_alertArray == null ||
                    alert == null || _alertArray.Count == 0)
                {
                    return;
                }

                alert.Delete();

                _alertArray.Remove(alert);

                Save();

                Paint();
            }
            catch (Exception error)
            {
                SendNewMessage(error.ToString(), LogMessageType.Error);
            }
        }