コード例 #1
0
 /// <summary>
 ///     Check if the given account id have been previously notified for this spike.
 /// </summary>
 /// <param name="accountId"></param>
 /// <returns></returns>
 public bool HasAccount(int accountId)
 {
     if (accountId <= 0)
     {
         throw new ArgumentOutOfRangeException("accountId");
     }
     return(NotifiedAccounts.Contains(accountId));
 }
コード例 #2
0
        /// <summary>
        ///     Add an account that has been notified
        /// </summary>
        /// <param name="accountId">account id</param>
        public void AddNotifiedAccount(int accountId)
        {
            if (HasAccount(accountId))
            {
                throw new InvalidOperationException("Account have already been notified: " + accountId);
            }
            if (accountId <= 0)
            {
                throw new ArgumentOutOfRangeException("accountId");
            }

            NotifiedAccounts = NotifiedAccounts.Concat(new[] { accountId }).ToArray();
        }