void AddToCompletedSet(Transform toAdd) { Set.Remove(toAdd); CompletedSet.Add(toAdd); Cell taScript = toAdd.GetComponent <Cell>(); for (int i = taScript.AllAdjacents.Count - 1; i >= 0; --i) { Transform adjToNext = taScript.AllAdjacents[i]; Cell atScript = adjToNext.GetComponent <Cell>(); atScript.Adjacents.Remove(toAdd); taScript.Adjacents.Remove(adjToNext); } }
private async void FinishedSet() { await navigationService.PopToRootAsync().ContinueWith((antecedent) => { if (IsFinished) { CompletedSet completedSet = new CompletedSet() { Duration = ActiveSet.MaxTime - TimeLeft, SetID = ActiveSet.SetID, Time = FormatTime(DateTime.Now), UserID = dataService.LoggedInUser.UserID }; dataService.SendCompletedSet(completedSet); } }); }
public async Task AddCompletedSet(CompletedSet completedSet, string baseUrl) { using (var client = new HttpClient()) { client.BaseAddress = new Uri(baseUrl + "completedset"); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes(string.Format("{0}:{1}", "user", "123456")))); var myContent = JsonConvert.SerializeObject(completedSet); var buffer = System.Text.Encoding.UTF8.GetBytes(myContent); var byteContent = new ByteArrayContent(buffer); byteContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); var test = JsonConvert.SerializeObject(completedSet); StringContent postBody = new StringContent(test, Encoding.UTF8, "application/json"); var result = await client.PostAsync("", postBody); string resultContent = result.Content.ReadAsStringAsync().Result; } }
public async Task AddCompletedSet(CompletedSet completedSet, string baseUrl) { CompletedSets.Add(completedSet); await Task.Delay(1); }
public async Task SendCompletedSet(CompletedSet set) { await completedSetRepository.AddCompletedSet(set, ApiUrl.BASEURL); }
public Task SendCompletedSet(CompletedSet set) { throw new NotImplementedException(); }
public Task AddCompletedSet(CompletedSet completedSet, string baseUrl) { throw new NotImplementedException(); }