public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { RemoteClient element = value as RemoteClient; if (element == null || element.RInfo is EmptyInfo) { return(null); } string ret = "别名:" + element.RInfo.Alias + "\r\n地址:" + element.RInfo.Ip + "\r\n协议:" + element.RInfo.Protocol; if (string.IsNullOrWhiteSpace(element.RInfo.Memo)) { return(ret); } const int mode = 13; int yu = element.RInfo.Memo.Length % mode; int count = element.RInfo.Memo.Length / mode; if (yu > 0) { count++; } string memo = string.Empty; for (int i = 0; i < count; i++) { int len = element.RInfo.Memo.Length - i * mode; memo += element.RInfo.Memo.Substring(i * mode, len > mode ? mode : len) + "\r\n "; } memo = memo.Trim(); memo = memo.TrimEnd('\n'); memo = memo.TrimEnd('\r'); ret += "\r\n备注:" + memo; return(ret); }