Beispiel #1
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)
                {
                }

                _messages = null;
                _create   = null;
                _delete   = null;
                _update   = null;

                disposedValue = true;
            }
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="messageType"></param>
        /// <returns></returns>
        public int Create(MessageType messageType = null)
        {
            try
            {
                if (_create == null)
                {
                    var req = new CreateMessageReq()
                    {
                        header = Client.RequestHeader
                    };

                    if (messageType != null)
                    {
                        req.messageType = messageType;
                    }

                    _create = _client.API.CreateMessage(req);
                }

                if (_create.errorCode == (int)errorCode.No_error)
                {
                    return(_create.messageId);
                }

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

            finally
            {
                _create = null;
            }
            return(-1);
        }