IronRuby.Runtime.RubyInstanceData.GetInstanceVariableNames C# (CSharp) Method

GetInstanceVariableNames() private method

private GetInstanceVariableNames ( ) : string[]
return string[]
        internal string/*!*/[]/*!*/ GetInstanceVariableNames() {
            if (_instanceVars == null) {
                return ArrayUtils.EmptyStrings;
            }
            lock (_instanceVars) {
                string[] result = new string[_instanceVars.Count];
                _instanceVars.Keys.CopyTo(result, 0);
                return result;
            }
        }

Usage Example

Esempio n. 1
0
 [Emitted] //RubyTypeBuilder
 public static void SerializeObject(RubyInstanceData instanceData, RubyClass/*!*/ immediateClass, SerializationInfo/*!*/ info) {
     info.AddValue(RubyUtils.SerializationInfoClassKey, immediateClass, typeof(RubyClass));
     if (instanceData != null) {
         string[] instanceNames = instanceData.GetInstanceVariableNames();
         foreach (string name in instanceNames) {
             object value;
             if (!instanceData.TryGetInstanceVariable(name, out value)) {
                 value = null;
             }
             info.AddValue(name, value, typeof(object));
         }
     }
 }