コード例 #1
0
ファイル: Addons.cs プロジェクト: RBSystems/Crestron-15
        /// <summary>
        /// Gets all available addons
        /// </summary>
        /// <param name="type"> </param>
        /// <param name="content"> Content provided by the addon. Only considered for plugins and scripts.</param>
        /// <param name="properties"> </param>
        /// <param name="limits"> </param>
        /// <returns>KODIRPC.Addons.GetAddonsResponse</returns>
        public async Task <KODIRPC.Addons.GetAddonsResponse> GetAddons(KODIRPC.Addon.Types?type = null, KODIRPC.Addon.Content?content = null, KODIRPC.Addon.Fields properties = null, KODIRPC.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));
            }
            return(await _client.GetData <KODIRPC.Addons.GetAddonsResponse>("Addons.GetAddons", jArgs));
        }
コード例 #2
0
ファイル: Addons.cs プロジェクト: RBSystems/Crestron-15
        /// <summary>
        /// Gets the details of a specific addon
        /// </summary>
        /// <param name="addonid"> REQUIRED </param>
        /// <param name="properties"> </param>
        /// <returns>KODIRPC.Addons.GetAddonDetailsResponse</returns>
        public async Task <KODIRPC.Addons.GetAddonDetailsResponse> GetAddonDetails(string addonid = null, KODIRPC.Addon.Fields properties = null)
        {
            var jArgs = new JObject();

            if (addonid == null)
            {
                throw new global::System.ArgumentException("Parameter cannot be null addonid");
            }
            else
            {
                var jpropaddonid = JToken.FromObject(addonid, _client.Serializer);
                jArgs.Add(new JProperty("addonid", jpropaddonid));
            }
            if (properties != null)
            {
                var jpropproperties = JToken.FromObject(properties, _client.Serializer);
                jArgs.Add(new JProperty("properties", jpropproperties));
            }
            return(await _client.GetData <KODIRPC.Addons.GetAddonDetailsResponse>("Addons.GetAddonDetails", jArgs));
        }