ICommonOperation.cs 1.0 KB

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using MECF.Framework.Common.OperationCenter;
  6. namespace Aitex.Core.RT.OperationCenter
  7. {
  8. public delegate bool OperationFunction(out string reason, int time, params object[] param);
  9. public interface ICommonOperation
  10. {
  11. void Subscribe<T>(T instance, string keyPrefix = null) where T : class;
  12. void Subscribe(string key, Func<string, object[], bool> op);
  13. bool DoOperation(string operationName, params object[] args);
  14. bool DoOperation(string operationName,out string reason, params object[] args);
  15. bool ContainsOperation(string operation);
  16. bool CanDoOperation(string operation, out string reason, params object[] args);
  17. bool AddCheck(string operation, IInterlockChecker checker);
  18. }
  19. public interface IOperation
  20. {
  21. void Subscribe(string key, OperationFunction op);
  22. bool DoOperation(string operationName, out string reason, int time, params object[] args);
  23. }
  24. }