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; _createGroup = null; _delete = null; _deleteGroup = null; _groups = null; _update = null; disposedValue = true; } }
/// <summary> /// /// </summary> /// <param name="groupSubscriptionType"></param> /// <returns></returns> public int Create(GroupSubscriptionType groupSubscriptionType = null) { try { if (_createGroup == null) { var req = new CreateGroupSubscriptionReq() { header = Client.RequestHeader }; if (groupSubscriptionType != null) { req.groupSubscriptionType = groupSubscriptionType; } _createGroup = _client.API.CreateGroupSubscription(req); } if (_createGroup.errorCode == (int)errorCode.No_error) { return(_createGroup.groupSubscriptionId); } throw new FlexMailException(_createGroup.errorMessage, _create.errorCode); } catch (Exception ex) { //telemetry.TrackException(ex, new Dictionary<string, string> { { "Flexmail", "Group.Create" } }); if (ex is FlexMailException) { throw (ex); } } finally { _createGroup = null; } return(-1); }