コード例 #1
0
        public GetAddonsResponse GetAddons(XBMCRPC.Addon.Types type = 0, XBMCRPC.Addon.Content content = 0, XBMCRPC.Addon.Fields properties = null, XBMCRPC.List.Limits limits = null)
        {
            var jArgs = new JObject();

            if (type != null)
            {
                var jproptype = JToken.FromObject(type, _client.Serializer);
                jArgs.Add(new JProperty("type", jproptype));
            }
            if (content != null)
            {
                var jpropcontent = JToken.FromObject(content, _client.Serializer);
                jArgs.Add(new JProperty("content", jpropcontent));
            }
            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));
            }
            var jRet = _client.GetData <GetAddonsResponse>("Addons.GetAddons", jArgs);

            return(jRet);
        }
コード例 #2
0
        /// <summary>
        /// Gets all available addons
        /// </summary>
        public async Task <XBMCRPC.Addons.GetAddonsResponse> GetAddons(bool enabled, XBMCRPC.Addon.Types type = 0, XBMCRPC.Addon.Content content = 0, XBMCRPC.Addon.Fields properties = null, XBMCRPC.List.Limits limits = null)
        {
            var jArgs = new JObject();

            if (type != null)
            {
                var jproptype = JToken.FromObject(type, _client.Serializer);
                jArgs.Add(new JProperty("type", jproptype));
            }
            if (content != null)
            {
                var jpropcontent = JToken.FromObject(content, _client.Serializer);
                jArgs.Add(new JProperty("content", jpropcontent));
            }
            if (enabled != null)
            {
                var jpropenabled = JToken.FromObject(enabled, _client.Serializer);
                jArgs.Add(new JProperty("enabled", jpropenabled));
            }
            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));
            }
            return(await _client.GetData <XBMCRPC.Addons.GetAddonsResponse>("Addons.GetAddons", jArgs));
        }