示例#1
0
文件: Group.cs 项目: hemrika/FlexMail
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <GroupType> Groups()
        {
            try
            {
                if (_groups == null)
                {
                    _groups = _client.API.GetGroups(new GetGroupsReq()
                    {
                        header = Client.RequestHeader
                    });
                }

                if (_groups.errorCode == (int)errorCode.No_error)
                {
                    return(_groups.groupTypeItems.ToList <GroupType>());
                }

                throw new FlexMailException(_groups.errorMessage, _groups.errorCode);
            }
            catch (Exception ex)
            {
                //telemetry.TrackException(ex, new Dictionary<string, string> { { "Flexmail", "Group.Groups" } });
                if (ex is FlexMailException)
                {
                    throw (ex);
                }
            }

            finally
            {
                _groups = null;
            }
            return(new List <GroupType>());
        }
示例#2
0
文件: Group.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)
                {
                }

                _create      = null;
                _createGroup = null;
                _delete      = null;
                _deleteGroup = null;
                _groups      = null;
                _update      = null;

                disposedValue = true;
            }
        }