public StackFrame(EvaluationContext context, string methodName, StackFrame caller, StackFrame parent) { MethodName = methodName; Caller = caller; Parent = parent; Values = new ValuesTable(8); }
public ValuesTable Values; //global values for top frame; parameters and local variables for method frame #endregion Fields #region Constructors public StackFrame(EvaluationContext context, ValuesTable globals) { Context = context; Values = globals; if (Values == null) Values = new ValuesTable(100); }
public Context(CurrencyDataSource currencyDataSource, PredefinedDataContainer collectionDataContainer, ValuesTable valuesTable, DateTime startTime) { _predefinedDataContainer = collectionDataContainer; _valuesTable = valuesTable; _currentTime = startTime; _currencyDataSource = currencyDataSource; }
public EvaluationContext(LanguageRuntime runtime) { Runtime = runtime; LanguageCaseSensitive = Runtime.Language.Grammar.CaseSensitive; //Globals = new GlobalValuesTable(100, Symbols, LanguageCaseSensitive); Globals = new ValuesTable(100); CallDispatcher = new DynamicCallDispatcher(this); ThreadId = Thread.CurrentThread.ManagedThreadId; TopFrame = new StackFrame(this, Globals); CurrentFrame = TopFrame; Data = new DataStack(); Data.Init(runtime.Unassigned); //set LastPushedItem to unassigned }
public string GetValue(long modId, string signalName) { lock (_lockObject) { using (DominoDbContext localDbContext = new DominoDbContext(config.GetConnectionString("DefaultConnection"))) { ValuesTable signalRecord = localDbContext.Values.FirstOrDefault(m => m.configID == modId && m.signalName == signalName); if (signalRecord == null) { return(null); } return(signalRecord.value); } } }
public void SaveValue(long modId, string signalName, string value) { try { lock (_lockObject) { using (DominoDbContext localDbContext = new DominoDbContext(config.GetConnectionString("DefaultConnection"))) { bool bCreated = false; List <ValuesTable> signalRecords = localDbContext.Values.Where(m => m.configID == modId && m.signalName == signalName).ToList(); ValuesTable signalRecord; if (signalRecords.Count == 0) //ligne non trouvée { signalRecord = new ValuesTable(); signalRecord.configID = modId; signalRecord.signalName = signalName; bCreated = true; } else { signalRecord = signalRecords.FirstOrDefault(); } signalRecord.dt_update = DateTime.Now; if (signalRecord.value != value) { signalRecord.dt_changed = DateTime.Now; } signalRecord.value = value; if (bCreated) { localDbContext.Values.Add(signalRecord); } else { localDbContext.Values.Update(signalRecord); } localDbContext.SaveChanges(); logger.Debug("update value " + value + " for mod" + modId); } } } catch (Exception ex) { logger.Error(ex, "", null); throw; } }