Ejemplo n.º 1
0
        private bool disposedValue = false; // To detect redundant calls

        /// <summary>
        ///
        /// </summary>
        /// <param name="disposing"></param>
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                }

                _create       = null;
                _delete       = null;
                _mailingLists = null;
                _truncate     = null;
                _update       = null;

                disposedValue = true;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="mailingListId"></param>
        public void Truncate(string mailingListId = null)
        {
            try
            {
                if (_truncate == null)
                {
                    var req = new TruncateMailingListReq()
                    {
                        header = Client.RequestHeader
                    };

                    if (!string.IsNullOrWhiteSpace(mailingListId))
                    {
                        req.mailingListId = int.Parse(mailingListId);
                    }

                    _truncate = _client.API.TruncateMailingList(req);
                }

                if (_truncate.errorCode == (int)errorCode.No_error)
                {
                    return;
                }

                throw new FlexMailException(_truncate.errorMessage, _truncate.errorCode);
            }
            catch (Exception ex)
            {
                //telemetry.TrackException(ex, new Dictionary<string, string> { { "Flexmail", "MailingList.Truncate" } });
                if (ex is FlexMailException)
                {
                    throw (ex);
                }
            }

            finally
            {
                _truncate = null;
            }
            return;
        }