public void Freelance_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { switch (e.Action) { case NotifyCollectionChangedAction.Add: Freelancer newFreelancer = e.NewItems[0] as Freelancer; Console.WriteLine($"Has been added new freelancer : {newFreelancer.Name}"); break; case NotifyCollectionChangedAction.Remove: Freelancer oldFreelancer = e.OldItems[0] as Freelancer; Console.WriteLine($"Has been remove freelancer : {oldFreelancer.Name}"); break; } }
static void Main(string[] args) { // create freelancer Freelancer freelancer = new Freelancer() { Name = "Rick", Age = 32, Technology = "C# .NET WinForms/WPF" }; Task task = new Task() { NameTask = "Make Desktop app", NeedTechnology = "C# .NET WinForms/WPF" }; FreeLanceJobs jobs = new FreeLanceJobs(); //Console.WriteLine(freelancer); // output freelancer jobs.RenderAllFreelancer(); }
public void RemoveFreelancer(Freelancer freelancer) { worker.Remove(freelancer); freelancer.isWork = false; }
public void AddFreelancer(Freelancer freelancer) { worker.Add(freelancer); freelancer.isWork = true; }