Esempio n. 1
0
        public void SetGlobal(string variableName, Runtime.Object value)
        {
            Runtime.Object oldValue = null;
            if (patch == null || !patch.TryGetGlobal(variableName, out oldValue))
            {
                _globalVariables.TryGetValue(variableName, out oldValue);
            }

            if (patch != null)
            {
                patch.SetGlobal(variableName, value);
            }
            else
            {
                _globalVariables [variableName] = value;
            }
        }
Esempio n. 2
0
        public void SetGlobal(string variableName, Runtime.Object value)
        {
            Runtime.Object oldValue = null;
            if (patch == null || !patch.TryGetGlobal(variableName, out oldValue))
            {
                _globalVariables.TryGetValue(variableName, out oldValue);
            }

            ListValue.RetainListOriginsForAssignment(oldValue, value);

            if (patch != null)
            {
                patch.SetGlobal(variableName, value);
            }
            else
            {
                _globalVariables [variableName] = value;
            }

            if (variableChangedEvent != null && !value.Equals(oldValue))
            {
                if (batchObservingVariableChanges)
                {
                    if (patch != null)
                    {
                        patch.AddChangedVariable(variableName);
                    }
                    else if (_changedVariablesForBatchObs != null)
                    {
                        _changedVariablesForBatchObs.Add(variableName);
                    }
                }
                else
                {
                    variableChangedEvent(variableName, value);
                }
            }
        }