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.
Afficher le fichier Open project: vikramkarthikeyan/voice-over-unity Class Usage Examples

Méthodes publiques

Свойство Type Description
Success fsResult

Méthodes publiques

Méthode 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 méthode

Adds a new message to this result.
public AddMessage ( string message ) : void
message string
Résultat void

AddMessages() public méthode

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
Résultat void

AssertSuccess() public méthode

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

AssertSuccessWithoutWarnings() public méthode

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
Résultat fsResult

Fail() public static méthode

Create a result that failed.
public static Fail ( string warning ) : fsResult
warning string
Résultat fsResult

Merge() public méthode

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
Résultat fsResult

Warn() public static méthode

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

operator() public static méthode

Only use this as +=!
public static operator ( ) : fsResult
Résultat fsResult

Property Details

Success public_oe static_oe property

A successful result.
public static fsResult Success
Résultat fsResult