コード例 #1
0
        /// <summary>
        /// Retrieve the current profile
        /// </summary>
        public async Task <Profile> GetCurrentProfile(XBMCRPC.Profiles.Fields.Profile properties = null)
        {
            var jArgs = new JObject();

            if (properties != null)
            {
                var jpropproperties = JToken.FromObject(properties, _client.Serializer);
                jArgs.Add(new JProperty("properties", jpropproperties));
            }
            return(await _client.GetData <Profile>("Profiles.GetCurrentProfile", jArgs));
        }
コード例 #2
0
        /// <summary>
        /// Retrieve all profiles
        /// </summary>
        public async Task <GetProfilesResponse> GetProfiles(XBMCRPC.Profiles.Fields.Profile properties = null, Limits limits = null, Sort sort = null)
        {
            var jArgs = new JObject();

            if (properties != null)
            {
                var jpropproperties = JToken.FromObject(properties, _client.Serializer);
                jArgs.Add(new JProperty("properties", jpropproperties));
            }
            if (limits != null)
            {
                var jproplimits = JToken.FromObject(limits, _client.Serializer);
                jArgs.Add(new JProperty("limits", jproplimits));
            }
            if (sort != null)
            {
                var jpropsort = JToken.FromObject(sort, _client.Serializer);
                jArgs.Add(new JProperty("sort", jpropsort));
            }
            return(await _client.GetData <GetProfilesResponse>("Profiles.GetProfiles", jArgs));
        }