public SArray(Array array) { Values = new ISItem[array.Length]; for (var i = 0; i < array.Length; i++) { Values[i] = SConvert.ToSettings(array.GetValue(i)); } }
// Set the property value by index. public override bool TrySetIndex(SetIndexBinder binder, object[] indexes, object value) { if (typeof(long).IsAssignableFrom(indexes[0].GetType())) { Values[(long)indexes[0]] = SConvert.ToSettings(value); return(true); } return(false); }
// Get the property value by index. public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result) { if (typeof(long).IsAssignableFrom(indexes[0].GetType())) { result = SConvert.ToObject(Values[(long)indexes[0]]); return(true); } result = null; return(false); }
public bool SetMember(string name, object value) { if (value == null && _properties.ContainsKey(name)) { _properties.Remove(name); } else { _properties[name] = SConvert.ToSettings(value); } return(true); }
public bool GetMember(string name, out object result) { // if the property doesn't exist, return null if (!_properties.ContainsKey(name)) { result = null; return(true); } var value = _properties[name]; result = SConvert.ToObject(value); return(true); }