Mercurial > repos > snowblizz-super-API-ideas
view api/FileLoadFailure.cs @ 20:b7c93a5821cd
* Remove unnecessary project dependency
* Change logging on invalid file exception on load
* Add logging when a non-native loader is asked to load a file it doesn't understand
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 01 Mar 2009 15:00:03 +0000 |
parents | 306558904c2a |
children | d7899f462d8c |
line wrap: on
line source
// This file (FileLoadFailure.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2009 IBBoard. // // The file and the library/program it is in are licensed under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING.LGPL for more information and the full license. using System; using System.IO; using IBBoard.Lang; using IBBoard.WarFoundry.API.Factories; namespace IBBoard.WarFoundry.API { public class FileLoadFailure { private FileInfo failedFile; private IWarFoundryFactory loadingFactory; private string defaultMessage; private string messageTranslationID; private string message; public FileLoadFailure(FileInfo file, string message) : this (file, message, "") { } public FileLoadFailure(FileInfo file, string message, string translationID) : this (file, null, message, "") { } public FileLoadFailure(FileInfo file, IWarFoundryFactory factory, string message) : this (file, factory, message, "") { } public FileLoadFailure(FileInfo file,IWarFoundryFactory factory, string message, string translationID) { failedFile = file; loadingFactory = factory; defaultMessage = message; messageTranslationID = translationID; } public FileInfo FailedFile { get { return failedFile; } } public string Message { get { if (message == null) { if (messageTranslationID == "") { message = String.Format(defaultMessage, FailedFile, loadingFactory); } else { message = Translation.GetTranslation(messageTranslationID, defaultMessage, failedFile, loadingFactory); } } return message; } } } }