コード例 #1
0
        private async void AddSkill()
        {
            if (!VerifAddSkillFields())
            {
                return;
            }
            AddSkillButtonBindings.IsBusy = true;
            SkillManager skillManager = (SkillManager)dataService.GetSkillManager();
            UserManager  userManager  = (UserManager)dataService.GetUserManager();

            Skill skillToSave = new Skill
            {
                Name        = SkillName,
                Description = SkillDescription
            };

            if (await skillManager.Create(skillToSave))
            {
                Dictionary <string, object> chargeOneSkillParams = new Dictionary <string, object>
                {
                    { "name", skillToSave.Name }
                };
                Skill skillSaved;
                if ((skillSaved = (Skill)(await skillManager.ChargeOneSkill(chargeOneSkillParams))) != null)
                {
                    await userManager.AddSkillToUser(skillSaved.Uuid, AppStaticInfo.Account.Uuid);
                }
                LoadUserSkills();
            }
            AddSkillButtonBindings.IsBusy = false;
        }