示例#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)
                {
                }

                _campaigns    = null;
                _delete       = null;
                _history      = null;
                _report       = null;
                _summary      = null;
                disposedValue = true;
            }
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="campaignType"></param>
        public void Delete(CampaignType campaignType = null)
        {
            try
            {
                if (_delete == null)
                {
                    var req = new DeleteCampaignReq()
                    {
                        header = Client.RequestHeader
                    };

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

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

                if (_delete != null && _delete.errorCode == (int)errorCode.No_error)
                {
                    return;
                }
                else
                if (_delete != null)
                {
                    throw new FlexMailException(FlexMail.Resources.Campaign.ResourceManager.GetString("Delete_" + _delete.errorCode), _delete.errorCode);
                }

                throw new FlexMailException(FlexMail.Resources.Blacklist.ResourceManager.GetString("Delete_" + _delete.errorCode), _delete.errorCode);
            }
            catch (Exception ex)
            {
                //telemetry.TrackException(ex, new Dictionary<string, string> { { "Flexmail", "Campaign.Delete" } });
                if (ex is FlexMailException)
                {
                    throw (ex);
                }
            }
            finally
            {
                _delete = null;
            }
            return;
        }