IronRuby.Runtime.RubyInstanceData.GetInstanceVariables C# (CSharp) Метод

GetInstanceVariables() приватный Метод

Gets the instance variables dictionary, initializing it if it was null. Only use this if you want to set something into the dictionary, otherwise just use the _instanceVars field
private GetInstanceVariables ( ) : object>.Dictionary
Результат object>.Dictionary
        private Dictionary<string, object>/*!*/ GetInstanceVariables() {
            if (_instanceVars == null) {
                var newValue = new Dictionary<string, object>();
                if (Interlocked.CompareExchange(ref _instanceVars, newValue, null) == null) {
                    return newValue;
                }
            }
            return _instanceVars;
        }

Usage Example

Пример #1
0
 internal void CopyInstanceVariablesTo(RubyInstanceData /*!*/ dup)
 {
     if (_instanceVars == null)
     {
         return;
     }
     lock (_instanceVars) {
         Dictionary <string, object> dupVars = dup.GetInstanceVariables();
         foreach (var var in _instanceVars)
         {
             dupVars.Add(var.Key, var.Value);
         }
     }
 }
All Usage Examples Of IronRuby.Runtime.RubyInstanceData::GetInstanceVariables