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. ScopeVariablesIgnoreCase are case insensitive and may access different casings depending on how other gets/sets occur in the scope.
Наследование: IScopeVariable, IWeakReferencable
 /// <summary>
 /// Gets the ScopeVariableIgnoreCase for the scope in a case-insensitive manner.
 ///
 /// The ScopeVariable can be held onto and get/set/deleted without performing
 /// a dictionary lookup on subsequent accesses.
 /// </summary>
 public ScopeVariableIgnoreCase GetScopeVariableIgnoreCase(string name)
 {
     lock (_storage) {
         if (!_storage.TryGetValue(name, out ScopeVariableIgnoreCase storageInfo))
         {
             _storage[name] = storageInfo = new ScopeVariableIgnoreCase(name);
         }
         return(storageInfo);
     }
 }
Пример #2
0
 /// <summary>
 /// Gets the ScopeVariableIgnoreCase for the scope in a case-insensitive manner.
 /// 
 /// The ScopeVariable can be held onto and get/set/deleted without performing
 /// a dictionary lookup on subsequent accesses.
 /// </summary>
 public ScopeVariableIgnoreCase GetVariableIgnoreCase(string name) {
     ScopeVariableIgnoreCase storageInfo;
     lock (_storage) {
         if (!_storage.TryGetValue(name, out storageInfo)) {
             _storage[name] = storageInfo = new ScopeVariableIgnoreCase(name);
         }
         return storageInfo;
     }
 }