Boxes the value for storage in a scope. Languages or consumers of the scope can save this value and use it to get/set the current value in the scope for commonly accessed values. ScopeVariables are case sensitive and will only refer to a single value.
Inheritance: IScopeVariable, IWeakReferencable
Example #1
0
        private ScopeVariable GetStorageSlow(string name)
        {
            if (_overflow == null)
            {
                Interlocked.CompareExchange(ref _overflow, new Dictionary <string, ScopeVariable>(), null);
            }

            lock (_overflow) {
                ScopeVariable res;
                if (!_overflow.TryGetValue(name, out res))
                {
                    _overflow[name] = res = new ScopeVariable();
                }
                return(res);
            }
        }
Example #2
0
        private ScopeVariable GetStorageSlow(string name) {
            if (_overflow == null) {
                Interlocked.CompareExchange(ref _overflow, new Dictionary<string, ScopeVariable>(), null);
            }

            lock (_overflow) {
                ScopeVariable res;
                if (!_overflow.TryGetValue(name, out res)) {
                    _overflow[name] = res = new ScopeVariable();
                }
                return res;
            }
        }
Example #3
0
 internal ScopeVariableIgnoreCase(string casing) {
     _firstCasing = casing;
     _firstVariable = new ScopeVariable();
 }
Example #4
0
 internal ScopeVariableIgnoreCase(string casing)
 {
     _firstCasing   = casing;
     _firstVariable = new ScopeVariable();
 }