OperationResult
发布日期:2025-04-29 07:42:50 浏览次数:16 分类:精选文章

本文共 1216 字,大约阅读时间需要 4 分钟。

public class OperationResult{    private readonly ConcurrentDictionary
_values = new ConcurrentDictionary
(); public OperationResult() { } public OperationResult(bool success) : this(success, String.Empty) { } public OperationResult(string message) : this(false, message) { } public OperationResult(bool success, string message) : this() { Success = success; Message = message; } public int Count { get { return _values.Count; } } public T this[string key] { get { return _values[key]; } set { _values[key] = value; } } public string Message { get; set; } public bool Success { get; set; } public override string ToString() { return String.Format("{0}:{1}{2}", Success ? "PASS" : "FAIL", Message, Count == 0 ? String.Empty : String.Format("({0})", String.Join(";", _values.OrderBy(o => o.Key).Select(s => String.Format("{0}:\"{1}\"", s.Key, s.Value)))); }}

???????C#????????????????????????????????????????????ConcurrentDictionary??????????????????????????????ConcurrentDictionary????????????????

上一篇:Operations Manager 2007 R2系列之仪表板(多)视图
下一篇:Operation not supported on read-only collection 的解决方法 - [Windows Phone开发技巧系列1]

发表评论

最新留言

能坚持,总会有不一样的收获!
[***.219.124.196]2026年06月10日 06时19分25秒