C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Success fsResult

Открытые методы

Метод Описание
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 +=!

Описание методов

AddMessage() публичный Метод

Adds a new message to this result.
public AddMessage ( string message ) : void
message string
Результат void

AddMessages() публичный Метод

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
Результат void

AssertSuccess() публичный Метод

A simply utility method that will assert that this result is successful. If it is not, then an exception is thrown.
public AssertSuccess ( ) : fsResult
Результат fsResult

AssertSuccessWithoutWarnings() публичный Метод

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
Результат fsResult

Fail() публичный статический Метод

Create a result that failed.
public static Fail ( string warning ) : fsResult
warning string
Результат fsResult

Merge() публичный Метод

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
Результат fsResult

Warn() публичный статический Метод

Create a result that is successful but contains the given warning message.
public static Warn ( string warning ) : fsResult
warning string
Результат fsResult

operator() публичный статический Метод

Only use this as +=!
public static operator ( ) : fsResult
Результат fsResult

Описание свойств

Success публичное статическое свойство

A successful result.
public static fsResult Success
Результат fsResult