public override string ToString() { string date = String.Format("--- Date : {0}\r\n", CreationDate.ToLocalTime()); string url = URL == null ? String.Empty : String.Format("URL : {0}\r\n", URL); string code = String.Format("Code : {0}\r\n", StatusCode); string description = String.Format("Error documentation description : {0}\r\n", TwitterDescription); string exceptionInfos = String.Empty; foreach (var twitterExceptionInfo in TwitterExceptionInfos) { exceptionInfos += String.Format("{0} ({1})\r\n", twitterExceptionInfo.Message, twitterExceptionInfo.Code); } return(String.Format("{0}{1}{2}{3}{4}", date, url, code, description, exceptionInfos)); }
public override string ToString() { var date = $"--- Date : {CreationDate.ToLocalTime()}\r\n"; var url = URL == null ? string.Empty : $"URL : {URL}\r\n"; var code = $"Code : {StatusCode}\r\n"; var description = $"Error documentation description : {TwitterDescription}\r\n"; var exceptionMessage = $"Error message : {Message}\r\n"; var exceptionInfos = string.Empty; if (TwitterExceptionInfos != null) { foreach (var twitterExceptionInfo in TwitterExceptionInfos) { exceptionInfos += $"{twitterExceptionInfo.Message} ({twitterExceptionInfo.Code})\r\n"; } } return($"{date}{url}{code}{description}{exceptionMessage}{exceptionInfos}"); }
private void RefreshResources() { var resources = PHAssetResource.GetAssetResources(Asset); var list = new List <PHAssetResource>(resources.Length); foreach (var resource in resources) { if (resource.ResourceType == PHAssetResourceType.Photo || resource.ResourceType == PHAssetResourceType.Video || resource.ResourceType == PHAssetResourceType.Audio) { var dtstr = CreationDate.ToLocalTime().ToString("yyyy-MM-dd HH_mm"); FileName = $"{dtstr} {resource.OriginalFilename}"; } list.Add(resource); } Resources = list.AsReadOnly(); }
public override string ToString() { var date = $"Date : {CreationDate.ToLocalTime()}\r\n"; var url = URL == null ? string.Empty : $"URL : {URL}\r\n"; var code = $"Code : {StatusCode}\r\n"; var twitterDescription = $"Twitter documentation description : {TwitterDescription}\r\n"; var exceptionMessage = _message == null ? "" : $"Reason : {_message}\r\n"; var exceptionInfos = string.Empty; if (TwitterExceptionInfos != null && TwitterExceptionInfos.Length > 0) { exceptionInfos = "Details : "; foreach (var twitterExceptionInfo in TwitterExceptionInfos) { exceptionInfos += $"{twitterExceptionInfo.Message} ({twitterExceptionInfo.Code})\r\n"; } } return($"{exceptionMessage}{exceptionInfos}{code}{date}{url}{twitterDescription}"); }
public string ToStringProtocol() => $"Comment={Message}$CreateDate={CreationDate.ToLocalTime()}";