using Aitex.Core.RT.Log; using Aitex.Core.Util; using Aitex.Core.WCF; namespace MECF.Framework.Common.OperationCenter { public class InvokeClient : Singleton { public bool InProcess { get; set; } private IInvokeService _service; public IInvokeService Service { get { if (_service == null) { if (InProcess) { _service = new InvokeService(); } else { _service = new InvokeServiceClient(); } } return _service; } } } public class InvokeServiceClient : ServiceClientWrapper, IInvokeService { public InvokeServiceClient() : base("Client_IInvokeService", "InvokeService") { } public void DoOperation(string operationName, params object[] args) { string argsList = ""; if (args.Length > 0) { foreach (object arg in args) { argsList += (" " + arg.ToString()); } } LOG.WriteLog(eEvent.EV_DEVICE_INFO, "", $"{operationName} was execute,parameter :{string.Join(" ", args)}"); Invoke(svc => { svc.DoOperation(operationName, args); }); } } }