Пример #1
0
        public object Get(Agent pAgent, uint varId)
        {
            IVariable variable = null;

            if (this.m_variables.TryGetValue(varId, out variable))
            {
                Property property = variable.GetProperty();
                if (property != null)
                {
                    string refName = property.GetRefName();
                    if (!string.IsNullOrEmpty(refName))
                    {
                        return(this.Get(pAgent, property.GetRefNameId()));
                    }
                }
                return(variable.GetValue(pAgent));
            }
            CMemberBase cMemberBase = pAgent.FindMember(varId);

            if (cMemberBase != null)
            {
                return(cMemberBase.Get(pAgent));
            }
            return(null);
        }
Пример #2
0
        public object Get(Agent pAgent, uint varId)
        {
            if (!this.m_variables.ContainsKey(varId))
            {
                //possible static property
                CMemberBase pMember = pAgent.FindMember(varId);

                if (pMember != null)
                {
                    object pAddr = pMember.Get(pAgent);

                    return(pAddr);
                }

                Debug.Check(false, "a compatible property is not found");
            }
            else
            {
                //par
                IVariable pVar = this.m_variables[varId];

                {
                    Property refPropety = pVar.GetProperty();
                    if (refPropety != null)
                    {
                        string refName = refPropety.GetRefName();
                        if (!string.IsNullOrEmpty(refName))
                        {
                            return(this.Get(pAgent, refPropety.GetRefNameId()));
                        }
                    }

                    return(pVar.GetValue(pAgent));
                }
            }

            return(null);
        }
Пример #3
0
        public object Get(Agent pAgent, uint varId)
        {
            IVariable variable = null;

            if (!this.m_variables.TryGetValue(varId, out variable))
            {
                CMemberBase base2 = pAgent.FindMember(varId);
                if (base2 != null)
                {
                    return(base2.Get(pAgent));
                }
            }
            else
            {
                Property property = variable.GetProperty();
                if ((property != null) && !string.IsNullOrEmpty(property.GetRefName()))
                {
                    return(this.Get(pAgent, property.GetRefNameId()));
                }
                return(variable.GetValue(pAgent));
            }
            return(null);
        }