Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
400 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Wabbajack.Common.StatusFeed | ||
{ | ||
public abstract class AErrorMessage : Exception, IError | ||
{ | ||
public DateTime Timestamp { get; } = DateTime.Now; | ||
public abstract string ShortDescription { get; } | ||
public abstract string ExtendedDescription { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Wabbajack.Common.StatusFeed | ||
{ | ||
public abstract class AStatusMessage : IStatusMessage | ||
{ | ||
public DateTime Timestamp { get; } = DateTime.Now; | ||
public abstract string ShortDescription { get; } | ||
public abstract string ExtendedDescription { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Wabbajack.Common.StatusFeed.Errors | ||
{ | ||
public class _7zipReturnError : AStatusMessage, IError | ||
{ | ||
private string _destination; | ||
private string _filename; | ||
private int _code; | ||
private string _7zip_output; | ||
public override string ShortDescription => $"7Zip returned an error while executing"; | ||
|
||
public override string ExtendedDescription => | ||
$@"7Zip.exe should always return 0 when it finishes executing. While extracting {_filename} 7Zip encountered some error and | ||
instead returned {_code} which indicates there was an error. The archive might be corrupt or in a format that 7Zip cannot handle. Please verify the file is valid and that you | ||
haven't run out of disk space in the {_destination} folder. | ||
7Zip Output: | ||
{_7zip_output}"; | ||
|
||
public _7zipReturnError(int code, string filename, string destination, string output) | ||
{ | ||
_code = code; | ||
_filename = filename; | ||
_destination = destination; | ||
_7zip_output = output; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Wabbajack.Common.StatusFeed.Errors | ||
{ | ||
class FileExtractionError : AStatusMessage, IError | ||
{ | ||
private string _filename; | ||
private string _destination; | ||
public override string ShortDescription { get; } | ||
public override string ExtendedDescription { get; } | ||
|
||
public FileExtractionError(string filename, string destination) | ||
{ | ||
_filename = filename; | ||
_destination = destination; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Wabbajack.Common.StatusFeed.Errors | ||
{ | ||
public class UnconvertedError : AErrorMessage | ||
{ | ||
private string _msg; | ||
|
||
public UnconvertedError(string msg) | ||
{ | ||
_msg = msg; | ||
} | ||
|
||
public override string ShortDescription { get => _msg; } | ||
public override string ExtendedDescription { get; } = ""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Wabbajack.Common.StatusFeed | ||
{ | ||
public class GenericInfo : AStatusMessage, IInfo | ||
{ | ||
public override string ShortDescription { get; } | ||
public override string ExtendedDescription { get;} | ||
|
||
public GenericInfo(string short_description, string long_description = "") | ||
{ | ||
ShortDescription = short_description; | ||
ExtendedDescription = long_description; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return ShortDescription; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Wabbajack.Common.StatusFeed | ||
{ | ||
public interface IError : IStatusMessage | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Wabbajack.Common.StatusFeed | ||
{ | ||
public interface IInfo : IStatusMessage | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Wabbajack.Common.StatusFeed | ||
{ | ||
public interface IStatusMessage | ||
{ | ||
DateTime Timestamp { get; } | ||
string ShortDescription { get; } | ||
string ExtendedDescription { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Wabbajack.Common.StatusFeed | ||
{ | ||
/// <summary> | ||
/// Defines a message that requires user interaction. The user must perform some action | ||
/// or make a choice. | ||
/// </summary> | ||
public interface IUserIntervention<T> : IStatusMessage | ||
{ | ||
/// <summary> | ||
/// The user didn't make a choice, so this action should be aborted | ||
/// </summary> | ||
void Cancel(); | ||
|
||
/// <summary> | ||
/// The user has provided the required information. | ||
/// </summary> | ||
/// <param name="result"></param> | ||
void Resume(T result); | ||
} | ||
|
||
/// <summary> | ||
/// Defines a message that requires user interaction. The user must perform some action | ||
/// or make a choice. | ||
/// </summary> | ||
public interface IUserIntervention : IStatusMessage | ||
{ | ||
/// <summary> | ||
/// The user didn't make a choice, so this action should be aborted | ||
/// </summary> | ||
void Cancel(); | ||
|
||
/// <summary> | ||
/// Resume without any further information | ||
/// </summary> | ||
void Resume(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
using System; | ||
using System.Reactive.Subjects; | ||
using Wabbajack.Common.StatusFeed; | ||
|
||
namespace Wabbajack.Common | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.