1 public static implicit operator bool(Result p){
2 return p.Status == enResultStatus.OK;
3 }
4
5 private const string of = "\nResult:\n\tstatus:{0}\n\tdesc:{1}\n\tMsg:{2}\n\tException:{3}\n\tval:{4}\n\tSuggested:{5}";
6 public static implicit operator string(Result p) {
7 return String.Format(of, p.Status , p.Description, p.UserFriendlyErrorMsg,p.ExeptionHappend,p.Value,p.SuggestedValue);
8 }
Usage:
15 Result res;
16 if (res) {
17 Debug.WriteLine("Dump of result object :"+res )
18 }
more...
No comments:
Post a Comment