public void RegisterFunction(FactorCalculateService factorCalculateService, string functionName) { lock (callLockObject) { if (RegisteredFunctionList.Any(q => q == functionName)) { return; } luaScriptContext.RegisterFunction(functionName, factorCalculateService, typeof(FactorCalculateService).GetMethod(functionName)); RegisteredFunctionList.Add(functionName); } }
public static FactorCalculateService CreateService() { if (_instance == null) { lock (lockHelper) { if (_instance == null) { _instance = new FactorCalculateService(); } } } return(_instance); }