Exemplo n.º 1
0
        private String GetObjectFields(object obj)
        {
            StringBuilder sb = new StringBuilder();

            if (obj is Dictionary <String, object> )
            {
                Dictionary <String, object> d = (Dictionary <String, object>)obj;
                foreach (String s in d.Keys)
                {
                    object v = d[s];
                    sb.AppendLine(s + ":" + (v == null ? "null" : v.ToString()));
                }
                return(sb.ToString());
            }

            BitMobile.ValueStack.IEvaluator evaluator = CurrentBreakpoint.Locals["$"].Value as BitMobile.ValueStack.IEvaluator;

            System.Reflection.PropertyInfo[] pis = obj.GetType().GetProperties(BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public);
            foreach (PropertyInfo pi in pis)
            {
                object v = evaluator.Evaluate("." + pi.Name, obj);
                sb.AppendLine(pi.Name + ":" + (v == null ? "null" : v.ToString()));
            }

            return(sb.ToString());
        }
Exemplo n.º 2
0
        //-------------------------------------------------COMMANDS-------------------------------------------------------

        private object EvaluateExpression(String[] parameters)
        {
            String[] arr  = parameters[0].Split('.');
            var      root = CurrentBreakpoint.Locals[arr[0]];

            if (root == null)
            {
                return(null);
            }
            object rootValue = root.Value;

            if (arr.Length == 1)
            {
                return(rootValue);
            }

            BitMobile.ValueStack.IEvaluator evaluator = CurrentBreakpoint.Locals["$"].Value as BitMobile.ValueStack.IEvaluator;

            return(evaluator.Evaluate(parameters[0], rootValue));
        }