本文整理汇总了C#中MessageDirection.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# MessageDirection.ToString方法的具体用法?C# MessageDirection.ToString怎么用?C# MessageDirection.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageDirection
的用法示例。
在下文中一共展示了MessageDirection.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetList
/// <summary>
/// Gets the messages log
/// </summary>
/// <param name="StartDate">FROM this date</param>
/// <param name="EndDate">TO this date</param>
/// <param name="Start">From this message on the list</param>
/// <param name="Limit">Maximun number of records</param>
/// <param name="Msisdn">Country code and phone number</param>
/// <param name="ShortName">Filter all messages sent to specified group's short_name</param>
/// <param name="Include_Recipients">If true it will include the list of recipients for each message</param>
/// <returns>Object with the message list</returns>
public ResponseObjects.ApiResponse<List<MessageResponse>> GetList(DateTime? StartDate = null, DateTime? EndDate = null, Int32 Start = -1, Int32 Limit = -1, String Msisdn = null, String ShortName = null, Boolean IncludeRecipients = false, MessageDirection Direction = MessageDirection.MT, String Username = null)
{
Dictionary<string, string> UrlParameters = new Dictionary<string, string>();
if( StartDate.HasValue)
{
UrlParameters.Add("start_date", StartDate.Value.ToString("yyyy-MM-dd HH:mm:ss"));
}
if (EndDate.HasValue)
{
UrlParameters.Add("end_date", EndDate.Value.ToString("yyyy-MM-dd HH:mm:ss"));
}
if ( Start != -1)
UrlParameters.Add("start", Start.ToString());
if ( Limit != -1)
UrlParameters.Add("limit", Limit.ToString());
if ( Msisdn != null)
UrlParameters.Add("msisdn", Msisdn);
if ( ShortName != null)
UrlParameters.Add("short_name", ShortName);
if (Username != null)
UrlParameters.Add("user", Username);
UrlParameters.Add("direction", Direction.ToString().ToUpper());
UrlParameters.Add("include_recipients", IncludeRecipients.ToString().ToLower());
ResponseObjects.ApiResponse<List<MessageResponse>> serverResponse = this.RequestToApi<List<MessageResponse>>("messages", request.get, UrlParameters, null, true);
return serverResponse;
//object serverResponse = this.RequestToApi("messages", request.get, UrlParameters, null, true);
//if (serverResponse.GetType() == typeof(List<string>))
// return serverResponse;
//else
// return JsonConvert.DeserializeObject<List<MessageResponse>>((string)serverResponse);
}