C# Класс SWFProcessing.Swiffotron.Processor.SwiffotronContext

The context within which the current swiffotron job is running, so that we can create better log information.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Sentinel ( string sentinelLabel ) : SwiffotronContext

When an exception is thrown, we can pass a sentinel string into the context. This is a secret internal string that somehow marks the point that the code has reached. This can be picked up in unit tests to determine that not only was the right type of exception was thrown, but that it was thrown for the right reason. Secret sentinel strings have the advantages of being easy to make up on the spot and immunity to internationalisation, which makes them better than methods that compare error messages, which can change on a whim. To mark a moment in the code, access the context object via this method like this: myContext.Sentinel("My meaningful string"); // returns myContext

SwiffotronContext ( string name )
ToString ( ) : string

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

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

When an exception is thrown, we can pass a sentinel string into the context. This is a secret internal string that somehow marks the point that the code has reached. This can be picked up in unit tests to determine that not only was the right type of exception was thrown, but that it was thrown for the right reason. Secret sentinel strings have the advantages of being easy to make up on the spot and immunity to internationalisation, which makes them better than methods that compare error messages, which can change on a whim. To mark a moment in the code, access the context object via this method like this: myContext.Sentinel("My meaningful string"); // returns myContext
public Sentinel ( string sentinelLabel ) : SwiffotronContext
sentinelLabel string An arbitrary string.
Результат SwiffotronContext

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

public SwiffotronContext ( string name )
name string

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

public ToString ( ) : string
Результат string