コード例 #1
0
ファイル: Category.cs プロジェクト: hemrika/FlexMail
        private bool disposedValue = false; // To detect redundant calls

        /// <summary>
        ///
        /// </summary>
        /// <param name="disposing"></param>
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                }

                _categories = null;
                _create     = null;
                _delete     = null;
                _update     = null;

                disposedValue = true;
            }
        }
コード例 #2
0
ファイル: Category.cs プロジェクト: hemrika/FlexMail
        /// <summary>
        ///
        /// </summary>
        /// <param name="categoryId"></param>
        public void Delete(string categoryId = null)
        {
            try
            {
                if (_delete == null)
                {
                    var req = new DeleteCategoryReq()
                    {
                        header = Client.RequestHeader
                    };

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

                    _delete = _client.API.DeleteCategory(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", "Category.Create" } });
                if (ex is FlexMailException)
                {
                    throw (ex);
                }
            }
            finally
            {
                _delete = null;
            }
            return;
        }