aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Services/TimelineMemberOperationUserException.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-11-04 21:02:12 +0800
committer杨宇千 <crupest@outlook.com>2019-11-04 21:02:12 +0800
commitedfc86d84da81fcabc00bb27e875f26038bf94f7 (patch)
tree3adcbc9e73cf98d6ee2ae0566ad0578b351edb5e /Timeline/Services/TimelineMemberOperationUserException.cs
parent640b80e501ef7f6240afdd968de4b23cd57f2ae1 (diff)
downloadtimeline-edfc86d84da81fcabc00bb27e875f26038bf94f7.tar.gz
timeline-edfc86d84da81fcabc00bb27e875f26038bf94f7.tar.bz2
timeline-edfc86d84da81fcabc00bb27e875f26038bf94f7.zip
Complete designing timeline service though there may be many bugs in the design.
Diffstat (limited to 'Timeline/Services/TimelineMemberOperationUserException.cs')
-rw-r--r--Timeline/Services/TimelineMemberOperationUserException.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/Timeline/Services/TimelineMemberOperationUserException.cs b/Timeline/Services/TimelineMemberOperationUserException.cs
new file mode 100644
index 00000000..998f1a6e
--- /dev/null
+++ b/Timeline/Services/TimelineMemberOperationUserException.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Globalization;
+
+namespace Timeline.Services
+{
+ [Serializable]
+ public class TimelineMemberOperationUserException : Exception
+ {
+ public TimelineMemberOperationUserException() : base(Resources.Services.Exception.TimelineMemberOperationException) { }
+ public TimelineMemberOperationUserException(string message) : base(message) { }
+ public TimelineMemberOperationUserException(string message, Exception inner) : base(message, inner) { }
+ protected TimelineMemberOperationUserException(
+ System.Runtime.Serialization.SerializationInfo info,
+ System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
+
+ public TimelineMemberOperationUserException(int index, string username, Exception inner) : base(MakeIndexMessage(index), inner) { Index = index; Username = username; }
+
+ private static string MakeIndexMessage(int index) => string.Format(CultureInfo.CurrentCulture,
+ Resources.Services.Exception.TimelineMemberOperationExceptionIndex, index);
+
+ /// <summary>
+ /// The index of the member on which the operation failed.
+ /// </summary>
+ public int? Index { get; set; }
+
+ public string? Username { get; set; }
+ }
+}