public Variable sgsGetPropertyByName( Variable key, bool isprop )
{
SGSClassInfo cinfo = GetClassInfo();
SGSPropInfo propinfo;
if( !cinfo.props.TryGetValue( key, out propinfo ) || !propinfo.canRead )
{
if( backingStore != null )
return backingStore.GetSubItem( key, isprop );
return null;
}
object obj;
if( propinfo.info is FieldInfo )
obj = (propinfo.info as FieldInfo).GetValue( this );
else // PropertyInfo
obj = (propinfo.info as PropertyInfo).GetValue( this, null );
return _sgsEngine.ObjVar( obj );
}