示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <CategoryType> Categories()
        {
            try
            {
                if (_categories == null)
                {
                    _categories = _client.API.GetCategories(new GetCategoriesReq()
                    {
                        header = Client.RequestHeader
                    });
                }

                if (_categories.errorCode == (int)errorCode.No_error)
                {
                    return(_categories.categoryTypeItems.ToList <CategoryType>());
                }

                throw new FlexMailException(_categories.errorMessage, _categories.errorCode);
            }
            catch (Exception ex)
            {
                //telemetry.TrackException(ex, new Dictionary<string, string> { { "Flexmail", "Category.Categories" } });
                if (ex is FlexMailException)
                {
                    throw (ex);
                }
            }
            finally
            {
                _categories = null;
            }
            return(new List <CategoryType>());
        }
示例#2
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)
                {
                }

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

                disposedValue = true;
            }
        }