using System.Collections.Concurrent; namespace OpenTap.Addin { public class FileGlobalsContext { ConcurrentDictionary map = new ConcurrentDictionary(); public VariableContext GetFileGlobals(TestPlan plan) { string path = plan.VisualPath; if (!map.ContainsKey(path)) { var runtimeVariablePool = new ConcurrentDictionary(); foreach (var data in plan.Variables) { RuntimeVariable runTime = data.ToRuntime(); if (runTime == null) continue; runtimeVariablePool[runTime.Name] = runTime; } map[path] = new VariableContext(runtimeVariablePool); } return map[path]; } } }