Example #1
0
        private void SendEmployeeDataToServer()
        {
            // Create a rendom employee.
            this.employee = RandomGenerator.SerializableEmployee(this.size);

            // Set the data context of the employeee info grid.
            this.dispatcher.Invoke(() => this.employeeInfo.DataContext = this.employee);

            // Send the employee info to the server.
            this.socket.Send(this.SerializeData(this.employee));
        }
 public static SerializableOrganizationViewModel FromOrganizationViewModel(OrganizationViewModel item)
 {
     return(new SerializableOrganizationViewModel
     {
         Name = item.Name,
         Description = item.Description,
         ResourceGroups = item.ResourceGroups.Select(x => x.Model).ToList(),
         Employees = item.Employees.Select(x => SerializableEmployee.FromEmployee(x.Model)).ToList(),
         Categories = new List <CategoryViewModel>(item.Categories)
     });
 }