Esempio n. 1
0
        /// <summary>
        /// List of available client locations. Warning: This command may change or be disabled in the future.
        /// </summary>
        /// <param name="type">Server or client (DVR or remote box)</param>
        /// <param name="clientAddress">Identifies the server or client. 0 for server and mac address(hexstring without colons) for clients</param>
        /// <param name="callback">Defaults to "jsonp"</param>
        /// <param name="wrapper"></param>
        /// <returns>Locations</returns>
        public Locations GetLocations(LocationType type, string clientAddress = "0", string callback = null, string wrapper = null)
        {
            var req = new RestRequest("info/getLocations");

            req.AddParameter("type", type.GetDescription());
            if (!string.IsNullOrWhiteSpace(clientAddress))
            {
                req.AddParameter("clientAddr", clientAddress);
            }
            if (!string.IsNullOrWhiteSpace(callback))
            {
                req.AddParameter("callback", callback);
            }
            if (!string.IsNullOrWhiteSpace(wrapper))
            {
                req.AddParameter("wrapper", wrapper);
            }
            return(Server.MakeRequest <Locations>(req));
        }