Exemplo n.º 1
0
        private void StartLesson(LessonStatus status)
        {
            var path = FileHelper.BasePath +
                       $@"{status.LessonName}\Images\{status.LessonSlide.ToString()}.png";

            if (File.Exists(path))
            {
                Action action = new Action(() =>
                {
                    lblStatus.Visible = false;
                    picSlide.Image    = Image.FromFile(path);
                });
                BeginInvoke(action);
            }
        }
Exemplo n.º 2
0
        public static async void UpdateStatus(LessonStatus status)
        {
            if (status != null)
            {
                if (status.AccessToken == null || String.IsNullOrWhiteSpace(status.AccessToken))
                {
                    status.AccessToken = ACCESS_TOKEN;
                }
                using (var client = new HttpClient())
                {
                    client.BaseAddress = new Uri(BASE_ADDRESS);

                    using (var req = new HttpRequestMessage(HttpMethod.Post, "api/StatusApi/Update"))
                    {
                        req.Content = new StringContent(JsonConvert.SerializeObject(status), Encoding.UTF8, "application/json");
                        await client.SendAsync(req);
                    }
                }
            }
        }
 static LessonStatusHelper()
 {
     _lessonStatus = new LessonStatus();
 }
Exemplo n.º 4
0
 public StatusEventArgs(LessonStatus status)
 {
     Status = status;
 }