예제 #1
0
        /// <summary>
        /// Returns all of the properties for a given <see cref="RemoteDescriptor"/>.
        /// </summary>
        /// <param name="remote"></param>
        /// <param name="serializer"></param>
        /// <returns></returns>
        internal static IEnumerable <JProperty> InterfaceToProperties(RemoteDescriptor remote, JsonSerializer serializer)
        {
            Contract.Requires <ArgumentNullException>(serializer != null);

            foreach (var property in GetRemoteProperties(remote.Type))
            {
                yield return(new JProperty(property.Name,
                                           JTokenFromObject(property.GetValue(remote.Target), serializer)));
            }
        }
예제 #2
0
        /// <summary>
        /// Returns all of the properties for a given <see cref="RemoteDescriptor"/>.
        /// </summary>
        /// <param name="remote"></param>
        /// <param name="serializer"></param>
        /// <returns></returns>
        internal static IEnumerable<JProperty> InterfaceToProperties(RemoteDescriptor remote, JsonSerializer serializer)
        {
            Contract.Requires<ArgumentNullException>(serializer != null);

            foreach (var property in GetRemoteProperties(remote.Type))
                yield return new JProperty(property.Name,
                    JTokenFromObject(property.GetValue(remote.Target), serializer));
        }