OP.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace Aitex.Core.RT.OperationCenter
  6. {
  7. public class OP
  8. {
  9. public static ICommonOperation InnerOperationManager { set; private get; }
  10. public static void Subscribe<T>(T instance, string keyPrefix = null) where T : class
  11. {
  12. if (InnerOperationManager != null)
  13. InnerOperationManager.Subscribe<T>(instance, keyPrefix);
  14. }
  15. public static void Subscribe(string key, Func<string, object[], bool> op)
  16. {
  17. if (InnerOperationManager != null)
  18. InnerOperationManager.Subscribe(key, op);
  19. }
  20. public static void DoOperation(string operationName, params object[] args)
  21. {
  22. if (InnerOperationManager != null)
  23. InnerOperationManager.DoOperation(operationName, args);
  24. }
  25. public static void Record(string chamberId, string operation)
  26. {
  27. if (InnerOperationManager != null)
  28. InnerOperationManager.Record(chamberId, operation);
  29. }
  30. }
  31. }