SGScript.Variable.GetSubItem C# (CSharp) Method

GetSubItem() public method

public GetSubItem ( Variable key, bool isprop ) : Variable
key Variable
isprop bool
return Variable
        public Variable GetSubItem( Variable key, bool isprop )
        {
            return ctx.GetIndex( this, key, isprop );
        }

Same methods

Variable::GetSubItem ( string key, bool isprop ) : Variable

Usage Example

Esempio n. 1
0
        // callback implementation helpers
        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));
        }