123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using Aitex.Core.RT.Log;
- using Aitex.Core.Util;
- using Aitex.Core.WCF;
- namespace MECF.Framework.Common.OperationCenter
- {
- public class InvokeClient : Singleton<InvokeClient>
- {
- 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>, 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); });
- }
- }
- }
|