Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="emailAddressType"></param>
        /// <param name="mailingListId"></param>
        public void Delete(EmailAddressType emailAddressType = null, string mailingListId = null)
        {
            try
            {
                if (_delete == null)
                {
                    var req = new DeleteEmailAddressReq()
                    {
                        header = Client.RequestHeader
                    };

                    if (emailAddressType != null)
                    {
                        req.emailAddressType = emailAddressType;
                    }

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

                    _delete = _client.API.DeleteEmailAddress(req);
                }

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

                throw new FlexMailException(_delete.errorMessage, _delete.errorCode);
            }
            catch (Exception ex)
            {
                //telemetry.TrackException(ex, new Dictionary<string, string> { { "Flexmail", "EmailAddress.Delete" } });
                if (ex is FlexMailException)
                {
                    throw (ex);
                }
            }
            finally
            {
                _delete = null;
            }
            return;
        }
Esempio n. 2
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;
                _emailaddresses = null;
                _update         = null;
                _history        = null;
                _import         = null;

                disposedValue = true;
            }
        }