public IEnumerable<MethodValue> GetValues(ReflectedInstance value, Type type, MethodInfo methodInfo)
        {
            if (methodInfo.Name == "Beep")
            {
                Note[] melody = new Note[] {
                    new Note(Note.C, 0, 100),
                    new Note(Note.C, 0, 100),
                    new Note(Note.D, 0, 100),
                    new Note(Note.E, 0, 100),
                    new Note(Note.F, 0, 100),
                    new Note(Note.G, 0, 100),
                    new Note(Note.A, 0, 100),
                    new Note(Note.B, 0, 100),
                    new Note(Note.C, 1, 100),
                    new Note(Note.D, 1, 100),
                    new Note(Note.E, 1, 100),
                    new Note(Note.F, 1, 100),
                    new Note(Note.G, 1, 100),
                    new Note(Note.A, 1, 100),
                    new Note(Note.B, 1, 100),
                    new Note(Note.C, 2, 100)
                };

                var parameters = methodInfo.GetParameters();
                foreach (var note in melody)
                {
                    var methodValue = methodInfo.Invoke("Beep", new object[] { note.Frequency, note.Duration });
                    var parameter = new MethodValueParam(parameters[0].Name, parameters[0], note.Frequency);
                    var parameter1 = new MethodValueParam(parameters[1].Name, parameters[1], note.Duration);
                    yield return new MethodValue(methodValue, parameter, parameter1);
                }
            }
        }
 public bool CanRead(ReflectedInstance value, Type type, PropertyInfo property)
 {
     // verify if property is "this[int i]", in real use is: "myList[0]', exclude array objects
     // because if array is multidimensional will happen a error when call
     // "property.GetValue(obj, new object[] { 0, 0 });" the class "PropertyReaderIndexerInArray" fix it.
     var parameters = property.GetIndexParameters();
     //
     return (parameters.Length == 1)
         && (parameters[0].ParameterType == typeof(int));
 }
        public IEnumerable<MethodValue> GetValues(ReflectedInstance value, Type type, MethodInfo method)
        {
            var array = value.Object as Array;
            var keysValues = ReflectionUtils.ArrayToDictionary(array);

            foreach (var keyValue in keysValues)
            {
                var parameter = new MethodValueParam("indices", null, keyValue.Key);
                yield return new MethodValue(keyValue.Value, parameter);
            }
        }
        public IEnumerable<MethodValue> GetValues(ReflectedInstance value, Type type, PropertyInfo property)
        {
            var dictionary = value.Object as IDictionary;
            var parameters = property.GetIndexParameters();

            foreach (var key in dictionary.Keys)
            {
                var parameter = new MethodValueParam(parameters[0].Name, parameters[0], key);
                yield return new MethodValue(dictionary[key], parameter);
            }
        }
        public IEnumerable<MethodValue> GetValues(ReflectedInstance value, Type type, PropertyInfo property)
        {
            //var converted = obj as System.Collections.ICollection;
            //var len = converted.Count;

            var parameters = property.GetIndexParameters();
            var len = 0;
            if (!ReflectionUtils.TryGetPropertyValue<int>(value.Object, "Count", out len))
                if (!ReflectionUtils.TryGetPropertyValue<int>(value.Object, "Length", out len))
                    throw new Exception("It could not find the size of the indexed property '" + property.Name + "' to iterate.");

            for (int i = 0; i < len; i++)
            {
                var propValue = property.GetValue(value.Object, new object[] { i });
                var parameter = new MethodValueParam(parameters[0].Name, parameters[0], i);
                yield return new MethodValue(propValue, parameter);
            }
        }
        public IEnumerable<MethodValue> GetValues(ReflectedInstance value, Type type, PropertyInfo property)
        {
            var converted = value.Object as Son;
            var len = converted.List.Count;
            var parameters = property.GetIndexParameters();

            // this[int index]
            if (parameters.Length == 1 && parameters[0].ParameterType == typeof(int))
            {
                for (int i = 0; i < len; i++)
                {
                    var propValue = property.GetValue(value.Object, new object[] { i });
                    var parameter = new MethodValueParam(parameters[0].Name, parameters[0], i);
                    yield return new MethodValue(propValue, parameter);
                }
            }

            // this[int index, int index2]
            if (parameters.Length == 2 && parameters[0].ParameterType == typeof(int) && parameters[1].ParameterType == typeof(int))
            {
                for (int i = 0; i < len; i++)
                {
                    var propValue = property.GetValue(value.Object, new object[] { i, 0 });
                    var parameter1 = new MethodValueParam(parameters[0].Name, parameters[0], i);
                    var parameter2 = new MethodValueParam(parameters[1].Name, parameters[1], 0);
                    yield return new MethodValue(propValue, parameter1, parameter2);
                }
            }

            // this[string contains]
            if (parameters.Length == 1 && parameters[0].ParameterType == typeof(string))
            {
                for (int i = 0; i < len; i++)
                {
                    var propValue = property.GetValue(value.Object, new object[] { "list " + i });
                    var parameter1 = new MethodValueParam(parameters[0].Name, parameters[0], "list " + i);
                    yield return new MethodValue(propValue, parameter1);
                }
            }
        }
 public bool CanRead(ReflectedInstance value, Type type, MethodInfo method)
 {
     return value.Object is Array && method.Name == "GetValue";
 }
 public bool CanRead(ReflectedInstance value, Type type, PropertyInfo property)
 {
     // verify if property is "this[object key]"
     var parameters = property.GetIndexParameters();
     return (value.Object is IDictionary) && (parameters.Length == 1);
 }
 public bool CanRead(ReflectedInstance value, Type type, MethodInfo methodInfo)
 {
     return value.Object is Son && methodInfo.GetParameters().Length > 0;
 }
 public IEnumerable<MethodValue> GetValues(ReflectedInstance value, Type type, PropertyInfo property)
 {
     var propValue = property.GetValue(value.Object, null);
     yield return new MethodValue(propValue, null);
 }
 public bool CanRead(ReflectedInstance value, Type type, PropertyInfo property)
 {
     return property.GetIndexParameters().Length == 0;
 }
 public IEnumerable<MethodValue> GetValues(ReflectedInstance value, Type type, MethodInfo methodInfo)
 {
     var methodValue = methodInfo.Invoke(value.Object, null);
     yield return new MethodValue(methodValue, null);
 }
 public bool CanRead(ReflectedInstance value, Type type, MethodInfo methodInfo)
 {
     return methodInfo.GetParameters().Length == 0;
 }
 public bool CanRead(ReflectedInstance value, Type type, PropertyInfo property)
 {
     return value.Object is Son && property.GetIndexParameters().Length > 0;
 }