示例#1
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            await serverConnection.Connect();

            await serverConnection.Request("GetAllProfiles");
        }
示例#2
0
 private async Task SetDefaultProfile()
 {
     var profiles = new ClockProfile[]
     {
         GetDefaultProfile
     };
     await serverConnection.Request("UpdateAllProfiles", JsonConvert.SerializeObject(profiles));
 }
示例#3
0
 public void SaveProfile(ClockProfile profile)
 {
     if (Profile == null)
     {
         currentData.Profiles.Insert(0, profile);
     }
     else
     {
         int index = currentData.Profiles.IndexOf(Profile);
         if (index >= 0 && index < currentData.Profiles.Count)
         {
             currentData.Profiles[index] = profile;
         }
     }
     serverConnection.Request("UpdateAllProfiles", JsonConvert.SerializeObject(currentData.Profiles));
     navigationService.NavigateAsync(nameof(ClockPage));
 }