ICommonOperation.cs 955 B

1234567891011121314151617181920212223242526272829
  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 ContainsOperation(string operation);
  15. bool CanDoOperation(string operation, out string reason, params object[] args);
  16. bool AddCheck(string operation, IInterlockChecker checker);
  17. }
  18. public interface IOperation
  19. {
  20. void Subscribe(string key, OperationFunction op);
  21. bool DoOperation(string operationName, out string reason, int time, params object[] args);
  22. }
  23. }