Esempio n. 1
0
        public override ExtendedValue Evaluate(LiveStackFrame frame)
        {
            ExtendedValue result;
            if (Target.Value is ObjectMirror || Target.Value is StructMirror)
            {
                Value value = EvalMember.Evaluate(frame.Thread, Target.Value, m_memberName);
                if (value != null)
                    result = new ExtendedValue(value);
                else if (Target.Value is ObjectMirror)
                    throw new Exception(string.Format("Couldn't find a field or property for {0}.{1}", ((ObjectMirror) Target.Value).Type.FullName, m_memberName));
                else
                    throw new Exception(string.Format("Couldn't find a field or property for {0}.{1}", ((StructMirror) Target.Value).Type.FullName, m_memberName));
            }
            else
            {
                throw new Exception("Member access target should be an object, struct, or type name, not a " + Target.Value.GetType());
            }

            return result;
        }
Esempio n. 2
0
 private object DoGetPrimitive(ExtendedValue value)
 {
     if (value.Value is PrimitiveValue)
     {
         var pv = (PrimitiveValue) value.Value;
         return pv.Value;
     }
     else if (value.Value is StringMirror)
     {
         var sv = (StringMirror) value.Value;
         return sv.Value;
     }
     else
     {
         throw new Exception("Expected a PrimitiveValue or StringMirror not " + value.Value.GetType());
     }
 }