|
@@ -9,18 +9,6 @@ using System.Text;
|
|
|
|
|
|
namespace InABox.Core
|
|
|
{
|
|
|
- namespace Postable
|
|
|
- {
|
|
|
- public class MissingSettingsException : Exception
|
|
|
- {
|
|
|
- public Type PostableType { get; }
|
|
|
-
|
|
|
- public MissingSettingsException(Type postableType) : base($"No PostableSettings for ${postableType}")
|
|
|
- {
|
|
|
- PostableType = postableType;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
public static class PosterUtils
|
|
|
{
|
|
@@ -151,6 +139,17 @@ namespace InABox.Core
|
|
|
return (Activator.CreateInstance(GetEngine<T>()) as IPosterEngine<T>)!;
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Process <paramref name="entities"/> with the currently set <see cref="IPosterEngine{TPostable, TPoster, TSettings}"/>
|
|
|
+ /// for <typeparamref name="T"/>.
|
|
|
+ /// </summary>
|
|
|
+ /// <typeparam name="T">The type of <paramref name="entities"/> that needs to be processed.</typeparam>
|
|
|
+ /// <param name="entities"></param>
|
|
|
+ /// <exception cref="RepostedException">If any of the <paramref name="entities"/> has already been processed. In this case, nothing happens.</exception>
|
|
|
+ /// <exception cref="MissingSettingsException">If the <see cref="PostableSettings"/> for <typeparamref name="T"/> do not exist.</exception>
|
|
|
+ /// <exception cref="PostCancelledException">If the post has been cancelled by the user.</exception>
|
|
|
+ /// <returns><see langword="true"/> if post was successful.</returns>
|
|
|
+ ///
|
|
|
public static bool Process<T>(IEnumerable<T> entities)
|
|
|
where T : Entity, IPostable, IRemotable, IPersistent, new()
|
|
|
{
|