Inheritance: System.EventArgs
Esempio n. 1
0
 private void OnVarAccess(VarAccessEventArgs args)
 {
     if (VarAccess != null)
     {
         VarAccess(args);
     }
 }
Esempio n. 2
0
        public void Declare(string name, T value)
        {
            VarAccessEventArgs eventArgs = new VarAccessEventArgs();

            OnVarAccess(eventArgs);

            variables[VarNameToInstancedName(name, eventArgs)] = value;
        }
Esempio n. 3
0
        private string VarNameToInstancedName(string name, VarAccessEventArgs args)
        {
            for (int i = 0; i < args.Instances.Count; i++)
            {
                name += RepeatedSuffix + args.Instances[i].ToString();
            }

            return(name);
        }
Esempio n. 4
0
        public DictionaryKeyValueObserver <string, T> GetRange(string name)
        {
            VarAccessEventArgs eventArgs = new VarAccessEventArgs();

            OnVarAccess(eventArgs);

            string instancedName = VarNameToInstancedName(name, eventArgs) + RepeatedSuffix;

            return(new DictionaryKeyValueObserver <string, T>(variables, (kv) => kv.Key.StartsWith(instancedName)));
        }
Esempio n. 5
0
        public T GetDeclared(string name)
        {
            VarAccessEventArgs eventArgs = new VarAccessEventArgs();

            OnVarAccess(eventArgs);

            if (eventArgs.IsInstanced)
            {
                string instancedName = VarNameToInstancedName(name, eventArgs);

                for (string stepName = instancedName; stepName.IndexOf(RepeatedSuffix) >= 0; stepName = stepName.Substring(0, stepName.LastIndexOf(RepeatedSuffix)))
                {
                    if (variables.ContainsKey(stepName))
                    {
                        return(variables[stepName]);
                    }
                }
            }

            return(variables[name]);
        }