C# Class FullSerializer.fsResult

The result of some sort of operation. A result is either successful or not, but if it is successful then there may be a set of warnings/messages associated with it. These warnings describe the performed error recovery operations.
Exibir arquivo Open project: vikramkarthikeyan/voice-over-unity Class Usage Examples

Public Properties

Property Type Description
Success fsResult

Public Methods

Method Description
AddMessage ( string message ) : void

Adds a new message to this result.

AddMessages ( fsResult result ) : void

Adds only the messages from the other result into this result, ignoring the success/failure status of the other result.

AssertSuccess ( ) : fsResult

A simply utility method that will assert that this result is successful. If it is not, then an exception is thrown.

AssertSuccessWithoutWarnings ( ) : fsResult

A simple utility method that will assert that this result is successful and that there are no warning messages. This throws an exception if either of those asserts are false.

Fail ( string warning ) : fsResult

Create a result that failed.

Merge ( fsResult other ) : fsResult

Merges the other result into this one. If the other result failed, then this one too will have failed.

Note that you can use += instead of this method so that you don't bury the actual method call that is generating the other fsResult.

Warn ( string warning ) : fsResult

Create a result that is successful but contains the given warning message.

operator ( ) : fsResult

Only use this as +=!

Method Details

AddMessage() public method

Adds a new message to this result.
public AddMessage ( string message ) : void
message string
return void

AddMessages() public method

Adds only the messages from the other result into this result, ignoring the success/failure status of the other result.
public AddMessages ( fsResult result ) : void
result fsResult
return void

AssertSuccess() public method

A simply utility method that will assert that this result is successful. If it is not, then an exception is thrown.
public AssertSuccess ( ) : fsResult
return fsResult

AssertSuccessWithoutWarnings() public method

A simple utility method that will assert that this result is successful and that there are no warning messages. This throws an exception if either of those asserts are false.
public AssertSuccessWithoutWarnings ( ) : fsResult
return fsResult

Fail() public static method

Create a result that failed.
public static Fail ( string warning ) : fsResult
warning string
return fsResult

Merge() public method

Merges the other result into this one. If the other result failed, then this one too will have failed.
Note that you can use += instead of this method so that you don't bury the actual method call that is generating the other fsResult.
public Merge ( fsResult other ) : fsResult
other fsResult
return fsResult

Warn() public static method

Create a result that is successful but contains the given warning message.
public static Warn ( string warning ) : fsResult
warning string
return fsResult

operator() public static method

Only use this as +=!
public static operator ( ) : fsResult
return fsResult

Property Details

Success public_oe static_oe property

A successful result.
public static fsResult Success
return fsResult