Class Result
Inheritance
System.Object
Result
Assembly: Eco.Core.dll
Syntax
public class Result : Object
Constructors
Result()
Declaration
Result(Result)
Declaration
protected Result(Result result)
Parameters
| Type |
Name |
Description |
| Result |
result |
|
Result(ResultType)
Declaration
public Result(ResultType type)
Parameters
Result(LocString, Boolean)
Declaration
public Result(LocString message, bool success = false)
Parameters
| Type |
Name |
Description |
| LocString |
message |
|
| System.Boolean |
success |
|
Result(String, Boolean)
Declaration
public Result(string message, bool success = false)
Parameters
| Type |
Name |
Description |
| System.String |
message |
|
| System.Boolean |
success |
|
Fields
Debug
Declaration
Field Value
| Type |
Description |
| System.String |
|
Value
Declaration
Field Value
Properties
Failed
Declaration
public bool Failed { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
FailedNoMessage
Declaration
public static Result FailedNoMessage { get; }
Property Value
Message
Declaration
public LocString Message { get; set; }
Property Value
NotificationCategory
Declaration
public Nullable<NotificationCategory> NotificationCategory { get; set; }
Property Value
NotificationStyle
Declaration
public Nullable<NotificationStyle> NotificationStyle { get; set; }
Property Value
Succeeded
Declaration
public static Result Succeeded { get; }
Property Value
Success
Declaration
public bool Success { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
ToStringStripped
Declaration
public string ToStringStripped { get; }
Property Value
| Type |
Description |
| System.String |
|
Methods
AnnotateIfFailed(Boolean, String, String)
Declaration
public static Result AnnotateIfFailed(bool result, string parameterName, string objectName)
Parameters
| Type |
Name |
Description |
| System.Boolean |
result |
|
| System.String |
parameterName |
|
| System.String |
objectName |
|
Returns
AppendDebug(String)
Declaration
public void AppendDebug(string debugText)
Parameters
| Type |
Name |
Description |
| System.String |
debugText |
|
Declaration
public void AppendDebugLoc(FormattableString debugText)
Parameters
| Type |
Name |
Description |
| System.FormattableString |
debugText |
|
AppendLine(LocString)
Declaration
public void AppendLine(LocString other)
Parameters
Declaration
public void AppendLine(FormattableString other)
Parameters
| Type |
Name |
Description |
| System.FormattableString |
other |
|
Fail(LocString)
Declaration
public static Result Fail(LocString s)
Parameters
Returns
Declaration
public static Result FailLoc(FormattableString s)
Parameters
| Type |
Name |
Description |
| System.FormattableString |
s |
|
Returns
FailLocStr(String)
Declaration
public static Result FailLocStr(string s)
Parameters
| Type |
Name |
Description |
| System.String |
s |
|
Returns
Declaration
public static Result FailNT(FormattableString s)
Parameters
| Type |
Name |
Description |
| System.FormattableString |
s |
|
Returns
FailNTStr(String)
Declaration
public static Result FailNTStr(string s)
Parameters
| Type |
Name |
Description |
| System.String |
s |
|
Returns
FixCaps()
Declaration
Returns
IsFailed(out LocString)
Check if result failed and saves fail message into output parameter.
Declaration
public bool IsFailed(out LocString message)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Declaration
public static Result Localize(FormattableString s, bool success = false)
Parameters
| Type |
Name |
Description |
| System.FormattableString |
s |
|
| System.Boolean |
success |
|
Returns
LocalizeStr(String, Boolean)
Declaration
public static Result LocalizeStr(string s, bool success = false)
Parameters
| Type |
Name |
Description |
| System.String |
s |
|
| System.Boolean |
success |
|
Returns
Merge(Result)
Declaration
public virtual Result Merge(Result other)
Parameters
| Type |
Name |
Description |
| Result |
other |
|
Returns
Merge(IEnumerable<Result>)
Declaration
public static Result Merge(IEnumerable<Result> others)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<Result> |
others |
|
Returns
MergeFail(String)
Declaration
public Result MergeFail(string other)
Parameters
| Type |
Name |
Description |
| System.String |
other |
|
Returns
Declaration
public Result MergeFailLoc(FormattableString other)
Parameters
| Type |
Name |
Description |
| System.FormattableString |
other |
|
Returns
None(String)
Declaration
public static Result None(string debugText)
Parameters
| Type |
Name |
Description |
| System.String |
debugText |
|
Returns
Prepend(LocString, String)
Declaration
public Result Prepend(LocString other, string spacer = " ")
Parameters
| Type |
Name |
Description |
| LocString |
other |
|
| System.String |
spacer |
|
Returns
Declaration
public Result Prepend(FormattableString other, string spacer = " ")
Parameters
| Type |
Name |
Description |
| System.FormattableString |
other |
|
| System.String |
spacer |
|
Returns
PrependNT(String, String)
Declaration
public Result PrependNT(string other, string spacer = " ")
Parameters
| Type |
Name |
Description |
| System.String |
other |
|
| System.String |
spacer |
|
Returns
RunAll(Func<Result>[])
Declaration
public static Result RunAll(params Func<Result>[] p)
Parameters
| Type |
Name |
Description |
| System.Func<Result>[] |
p |
|
Returns
Declaration
public static Result SetIfFailedLoc(FormattableString failMessage, bool success)
Parameters
| Type |
Name |
Description |
| System.FormattableString |
failMessage |
|
| System.Boolean |
success |
|
Returns
SetSucceed(Boolean, LocString)
Declaration
public static Result SetSucceed(bool success, LocString s = null)
Parameters
| Type |
Name |
Description |
| System.Boolean |
success |
|
| LocString |
s |
|
Returns
Succeed(LocString)
Declaration
public static Result Succeed(LocString s)
Parameters
Returns
Declaration
public static Result SucceedLoc(FormattableString s)
Parameters
| Type |
Name |
Description |
| System.FormattableString |
s |
|
Returns
Declaration
public static Result SucceedNT(FormattableString s)
Parameters
| Type |
Name |
Description |
| System.FormattableString |
s |
|
Returns
SucceedNTStr(String)
Declaration
public static Result SucceedNTStr(string s)
Parameters
| Type |
Name |
Description |
| System.String |
s |
|
Returns
TapToIfNotSet(ref Result)
Taps this to another result if result has no value and returns this.
Useful in workflow where you want to check multiple results sequentially and remember first result.
Declaration
public Result TapToIfNotSet(ref Result result)
Parameters
| Type |
Name |
Description |
| Result |
result |
|
Returns
Test(Func<Result>)
Declaration
public Result Test(Func<Result> p)
Parameters
| Type |
Name |
Description |
| System.Func<Result> |
p |
|
Returns
ToString()
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
|
Operators
Implicit(Result to Boolean)
Declaration
public static implicit operator bool (Result result)
Parameters
| Type |
Name |
Description |
| Result |
result |
|
Returns
| Type |
Description |
| System.Boolean |
|
Extension Methods