Пример #1
0
        private async void Button_SaveProfile_Click(object sender, EventArgs e)
        {
            if (OldProfile != null)
            {
                await Profiles.ReplaceAsync(OldProfile, NewProfile);
            }
            else
            {
                if (Profiles.All(profile => profile.Name != NewProfile.Name))
                {
                    await Profiles.AddAsync(NewProfile);
                }
            }

            await Profiles.SaveAsync();

            Close();
        }