Пример #1
0
        public void UnsubscribeASAPEvent(string uniqueId)
        {
            executionCallback h = null;

            if (asapHandlers.ContainsKey(uniqueId))
            {
                asapHandlers.Remove(uniqueId, out h);
            }
        }
Пример #2
0
        private void invokeAll()
        {
            executionCallback h = null;

            foreach (KeyValuePair <string, executionCallback> handler in asapHandlers)
            {
                asapHandlers.Remove(handler.Key, out h);
                handler.Value.Invoke();
            }
        }
Пример #3
0
 public void RebuildModules(executionCallback onSuccess = null)
 {
     pm.invokeASAP("ModuleManager.RebuildModules", () => {
         _RebuildModules();
         if (onSuccess != null)
         {
             onSuccess();
         }
     });
 }
Пример #4
0
        /**
         * Executes the specified function when the instance is free. If it's already free executes in moment
         */
        public void invokeASAP(string uniqueId, executionCallback handler)
        {
            executionCallback h = null;

            if (asapHandlers.ContainsKey(uniqueId))
            {
                asapHandlers.Remove(uniqueId, out h);
            }
            asapHandlers.AddOrUpdate(uniqueId, handler, (k, v) => {
                return(v);
            });

            if (!_isBusy)
            {
                invokeAll();
            }
        }