Projektdateien hinzufügen.

This commit is contained in:
mr_sc
2026-08-19 19:27:41 +02:00
parent 0889f1f6c7
commit 7fe54c0785
32 changed files with 2406 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
using System;
namespace FileInterface.Scheduler
{
public sealed class CustomFunctionCallResult
{
public bool Success { get; set; }
public string Message { get; set; }
public static CustomFunctionCallResult Ok(string message)
{
return new CustomFunctionCallResult { Success = true, Message = message ?? "OK" };
}
public static CustomFunctionCallResult Fail(string message)
{
return new CustomFunctionCallResult { Success = false, Message = message ?? "CustomFunction failed" };
}
}
public interface ICustomFunctionInvoker
{
CustomFunctionCallResult Invoke(string customFunctionName, string[] inArgs);
}
/// <summary>
/// Lets the existing FileInterface IMS code remain untouched. Wire the current
/// IMS CustomFunction call into this delegate in Program.cs / service startup.
/// </summary>
public sealed class DelegateCustomFunctionInvoker : ICustomFunctionInvoker
{
private readonly Func<string, string[], CustomFunctionCallResult> _handler;
public DelegateCustomFunctionInvoker(Func<string, string[], CustomFunctionCallResult> handler)
{
if (handler == null) throw new ArgumentNullException("handler");
_handler = handler;
}
public CustomFunctionCallResult Invoke(string customFunctionName, string[] inArgs)
{
return _handler(customFunctionName, inArgs);
}
}
}