public Job(int id, string[] names, Job parent = null) { Id = id; Name = names[0]; Names = names.ToList(); Parent = parent; List<Job> parents = new List<Job>(); if (parent != null) { parents.Add(parent); parents.AddRange(parent.Parents); } Parents = parents; if (JobList.AllJobs != null) { JobList.AllJobs.Add(this); } }
private static string _checkFor(string output, int hexValue, Job job) { if ((hexValue & job.Id) == job.Id) { output += job.Name + ", "; } return output; }
private void _addJob(Grid grid, Job job) { CheckBox box = new CheckBox(); box.Margin = new Thickness(7, 6, 7, 6); box.Content = job == JobList.BardDancer ? Methods.Aggregate(job.Names, ", ") : job.Name; //box.Content = (job == JobList.BardDancer || job == JobList.Kangerou) ? Methods.Aggregate(job.Names, ", ") : job.Name; box.SetValue(Grid.RowProperty, grid.RowDefinitions.Count); box.VerticalAlignment = VerticalAlignment.Center; box.Tag = job; box.Checked += delegate { _update(); }; box.Unchecked += delegate { _update(); }; _boxes.Add(box); grid.RowDefinitions.Add(new RowDefinition()); grid.Children.Add(box); }