示例#1
0
        private SkillSet(ManagementApi api, IEnumerable <SkillSummary> summaries, SkillSetOptions options)
        {
            Options = options ?? new SkillSetOptions();

            foreach (var summary in summaries)
            {
                if (summary.Stage == SkillStage.Development)
                {
                    Development = new SkillSetStage(api, summary, Options);
                    Stage       = SkillStage.Development;
                }
                else
                {
                    Live = new SkillSetStage(api, summary, Options);
                }
            }

            if (Live == null)
            {
                Live = SkillSetStage.Empty();
            }
        }
        public static async Task <IEnumerable <SkillSet> > FromVendor(this ManagementApi api, string vendorId, SkillSetOptions options = null)
        {
            var response = await api.Skills.List(vendorId);

            return(SkillSet.From(api, options, response.Skills));
        }
 public SkillSetStage(ManagementApi api, SkillSummary summary, SkillSetOptions options)
 {
     Summary = summary;
     Options = options;
     Locales = Summary?.NameByLocale?.Keys.OrderBy(l => l, options).Select(l => new SkillSetLocale(api, this, l)).ToArray();
 }
示例#4
0
        public static IEnumerable <SkillSet> From(ManagementApi api, SkillSetOptions options, params SkillSummary[] summaries)
        {
            var skillSetOptions = options ?? new SkillSetOptions();

            return(summaries.GroupBy(s => s.SkillId).Select(g => new SkillSet(api, g, skillSetOptions)));
        }