Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
 public void RemoveFreelancer(Freelancer freelancer)
 {
     worker.Remove(freelancer);
     freelancer.isWork = false;
 }
Exemplo n.º 4
0
 public void AddFreelancer(Freelancer freelancer)
 {
     worker.Add(freelancer);
     freelancer.isWork = true;
 }