예제 #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="campaignId"></param>
        /// <returns></returns>
        public CampaignSummaryType Summary(string campaignId = null)
        {
            try
            {
                if (_summary == null)
                {
                    var req = new GetCampaignSummaryReq()
                    {
                        header = Client.RequestHeader
                    };

                    if (!string.IsNullOrWhiteSpace(campaignId))
                    {
                        req.campaignId = campaignId;
                    }

                    _summary = _client.API.GetCampaignSummary(req);
                }

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

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