diff --git a/Wabbajack.Common/Error States/ErrorResponse.cs b/Wabbajack.Common/Error States/ErrorResponse.cs index a2b1962b..a9bfec46 100644 --- a/Wabbajack.Common/Error States/ErrorResponse.cs +++ b/Wabbajack.Common/Error States/ErrorResponse.cs @@ -16,25 +16,25 @@ namespace Wabbajack { get { - if (this.Exception != null) + if (Exception != null) { - return this.Exception.ToString(); + return Exception.ToString(); } return _reason; } } - bool IErrorResponse.Succeeded => this.Succeeded; - Exception IErrorResponse.Exception => this.Exception; + bool IErrorResponse.Succeeded => Succeeded; + Exception IErrorResponse.Exception => Exception; private ErrorResponse( bool succeeded, string reason = null, Exception ex = null) { - this.Succeeded = succeeded; - this._reason = reason; - this.Exception = ex; + Succeeded = succeeded; + _reason = reason; + Exception = ex; } public override string ToString() @@ -76,7 +76,7 @@ namespace Wabbajack public static ErrorResponse Convert(IErrorResponse err, bool nullIsSuccess = true) { - if (err == null) return ErrorResponse.Create(nullIsSuccess); + if (err == null) return Create(nullIsSuccess); return new ErrorResponse(err.Succeeded, err.Reason, err.Exception); } } diff --git a/Wabbajack.Common/Error States/GetResponse.cs b/Wabbajack.Common/Error States/GetResponse.cs index ad70fb9f..fc78dacd 100644 --- a/Wabbajack.Common/Error States/GetResponse.cs +++ b/Wabbajack.Common/Error States/GetResponse.cs @@ -16,16 +16,16 @@ namespace Wabbajack { get { - if (this.Exception != null) + if (Exception != null) { - return this.Exception.ToString(); + return Exception.ToString(); } return _reason; } } - bool IErrorResponse.Succeeded => this.Succeeded; - Exception IErrorResponse.Exception => this.Exception; + bool IErrorResponse.Succeeded => Succeeded; + Exception IErrorResponse.Exception => Exception; private GetResponse( bool succeeded, @@ -33,16 +33,16 @@ namespace Wabbajack string reason = null, Exception ex = null) { - this.Value = val; - this.Succeeded = succeeded; - this._reason = reason; - this.Exception = ex; + Value = val; + Succeeded = succeeded; + _reason = reason; + Exception = ex; } public bool Equals(GetResponse other) { - return this.Succeeded == other.Succeeded - && object.Equals(this.Value, other.Value); + return Succeeded == other.Succeeded + && Equals(Value, other.Value); } public override bool Equals(object obj) @@ -66,26 +66,26 @@ namespace Wabbajack { return new GetResponse( succeeded: false, - reason: this._reason, - ex: this.Exception); + reason: _reason, + ex: Exception); } public GetResponse Bubble(Func conv) { return new GetResponse( - succeeded: this.Succeeded, - val: conv(this.Value), - reason: this._reason, - ex: this.Exception); + succeeded: Succeeded, + val: conv(Value), + reason: _reason, + ex: Exception); } public T EvaluateOrThrow() { - if (this.Succeeded) + if (Succeeded) { - return this.Value; + return Value; } - throw new ArgumentException(this.Reason); + throw new ArgumentException(Reason); } #region Factories diff --git a/Wabbajack.Common/Utils.cs b/Wabbajack.Common/Utils.cs index 8fcb753a..bfe3d8a5 100644 --- a/Wabbajack.Common/Utils.cs +++ b/Wabbajack.Common/Utils.cs @@ -210,7 +210,7 @@ namespace Wabbajack.Common public static DateTime AsUnixTime(this long timestamp) { - System.DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc); + DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); dtDateTime = dtDateTime.AddSeconds(timestamp).ToLocalTime(); return dtDateTime; } @@ -751,7 +751,7 @@ namespace Wabbajack.Common { return ErrorResponse.Fail(ex.Message); } - catch (System.IO.PathTooLongException ex) + catch (PathTooLongException ex) { return ErrorResponse.Fail(ex.Message); } @@ -776,7 +776,7 @@ namespace Wabbajack.Common { return ErrorResponse.Fail(ex.Message); } - catch (System.IO.PathTooLongException ex) + catch (PathTooLongException ex) { return ErrorResponse.Fail(ex.Message); }