Beispiel #1
0
        public static void TrackAction(TrackActivity action, string comment = null)
        {
            StaticInstance.ThreadPool.QueueWorkItem(delegate
            {
                try
                {
                    var client = new RestClient(StatsUrl);

                    var request = new RestRequest("trackAction", Method.GET);
                    request.AddHeader("Accept", "application/xml");

                    request.AddParameter("id", getUniqueID());
                    request.AddParameter("version", GetVersionString());
                    request.AddParameter("action", action.ToString());
                    if (!string.IsNullOrEmpty(comment))
                    {
                        request.AddParameter("comment", comment);
                    }

                    var response = client.Execute <SimpleResponse <string> >(request);

                    if (response.Data.Value == "ok")
                    {
                        //good
                    }
                }
                catch
                {
                    //sorry
                }
            }, true, WorkItemPriority.Lowest);
        }