示例#1
0
        public void AddRow(string careerName)
        {
            try
            {
                string[]      lowerTiers      = Career.GetLowerTiers(careerName);
                List <string> lowerTiersToAdd = new List <string>();

                if (lowerTiers.Length > 0)
                {
                    foreach (string lowerCareer in lowerTiers)
                    {
                        bool contains = false;
                        foreach (CareerRowViewModel row in CareerRows)
                        {
                            if (row.Name == lowerCareer)
                            {
                                contains = true;
                            }
                        }
                        if (!contains)
                        {
                            lowerTiersToAdd.Add(lowerCareer);
                        }
                    }
                    if (lowerTiersToAdd.Count > 0)
                    {
                        if (messageService.YesNoBox("Add lower tier careers?", "Add Lower Tiers"))
                        {
                            foreach (string career in lowerTiersToAdd)
                            {
                                CareerRowViewModel lowerRow = new CareerRowViewModel(Career.GetCareerList().Find(c => c.Name == career), id);
                                lowerRow.RowChanged      += CareerEdit;
                                lowerRow.AdvanceSelection = AdvanceLevel.Complete;
                                CareerRows.Add(lowerRow);
                                RowIDs.Add(id);
                                id++;

                                lowerRow.ManualUpdate(RowAction.Add);
                            }
                        }
                    }
                }

                CareerRowViewModel newDGRow = new CareerRowViewModel(Career.GetCareerList().Find(c => c.Name == careerName), id);
                newDGRow.RowChanged += CareerEdit;
                CareerRows.Add(newDGRow);
                RowIDs.Add(id);
                id++;
            }

            catch (Exception e)
            {
                messageService.ShowNotification(e.Message);
            }
        }
示例#2
0
        public MainWindow()
        {
            InitializeComponent();

            CareerJsonReader.read = true;
            TalentReader.read     = true;

            this.DataContext = new WindowViewModel();

            foreach (Career career in Career.GetCareerList())
            {
                foreach (string talent in career.CareerTalents)
                {
                    if (Talent.TalentList.Find(t => t.Name == Talent.GenericName(talent)) == null)
                    {
                        System.Diagnostics.Debug.WriteLine(talent + " not found");
                    }
                }
            }
        }
示例#3
0
 public virtual void AddCareer(string name, AdvanceLevel advancement = AdvanceLevel.None)
 {
     Careers.Add(new CareerAdvancement(this, Career.GetCareerList().Find(c => c.Name == name), advancement));
 }