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; } }
/// <summary> /// /// </summary> /// <param name="type"></param> /// <returns></returns> public async Task <List <CampaignType> > CampaignsAsync(campaignTypeType type = campaignTypeType.Campaign) { try { if (_campaigns == null) { var req = new GetCampaignsReq() { header = Client.RequestHeader }; req.type = type; req.typeSpecified = true; GetCampaignsResponse response = await _client.API.GetCampaignsAsync(req); _campaigns = response.GetCampaignsResp; } if (_campaigns != null && _campaigns.errorCode == (int)errorCode.No_error) { return(_campaigns.campaignTypeItems.ToList <CampaignType>()); } else if (_campaigns != null) { throw new FlexMailException(FlexMail.Resources.Campaign.ResourceManager.GetString("Campaigns_" + _campaigns.errorCode), _campaigns.errorCode); } throw new FlexMailException(FlexMail.Resources.Campaign.ResourceManager.GetString("Campaigns_" + _campaigns.errorCode), _campaigns.errorCode); } catch (Exception ex) { //telemetry.TrackException(ex, new Dictionary<string, string> { { "Flexmail", "Campaign.Campaigns" } }); if (ex is FlexMailException) { throw (ex); } } finally { _campaigns = null; } return(new List <CampaignType>()); }