コード例 #1
0
 public CompAddEmployee(CompHome home, EmployeeList employees) : this()
 {
     empList     = employees;
     compHome    = home;
     DataContext = this;
     RoleComboBox.SelectedIndex = 0;
 }
コード例 #2
0
        public CompHome(EmployeeList emps) : this()
        {
            empList = emps;

            // Set event handler for Employee type radio button
            this.EmployeeTypeRadioButtons.SelectionChanged += new SelectionChangedEventHandler(EmployeeTypeRadioButtons_SelectionChanged);

            // Select the first employee type radio button
            this.EmployeeTypeRadioButtons.SelectedIndex = 0;
            RefreshEmployeeList();
        }
コード例 #3
0
        public CompHome(EmployeeList emps) : this()
        {
            empList = emps;

            // Select the All radio button
            this.EmployeeTypeRadioButtons.SelectedIndex = 0;

            // Set event handler for radio button changes
            this.EmployeeTypeRadioButtons.SelectionChanged += new SelectionChangedEventHandler(EmployeeTypeRadioButtons_SelectionChanged);

            // Fill the Employees data grid
            dgEmps.ItemsSource = empList;
        }
コード例 #4
0
        // Load EmployeeList from a binary file
        private static EmployeeList LoadEmployees(string dataFile = DataFile)
        {
            EmployeeList emps = null;

            try
            {
                using (Stream fStream = File.OpenRead(dataFile))
                {
                    emps = (EmployeeList)binFormat.Deserialize(fStream);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }

            return(emps);
        }
コード例 #5
0
        // Either load EmployeeList from file or create an initial EmployeeList
        static public EmployeeList GetEmployees()
        {
            EmployeeList emps = null;

            // Load data if file found, otherwise use initial dummy set of Employees
            if (File.Exists(DataFile))
            {
                return(LoadEmployees());
            }
            else
            {
                // Get initial employees and save to file
                emps = InitialEmployees();
                emps.SaveEmployees();
            }

            return(emps);
        }
コード例 #6
0
        private void Awake()
        {
            contentHub            = ContentHub.Instance;
            NotificationManager   = NotificationManager.Instance;
            EmployeeToGuiMap      = new Dictionary <EmployeeData, GameObject>();
            this.specialEmployees = contentHub.GetEmployeeLists();
            factoryObject         = new EmployeeFactory();

            if (GameSettings.NewGame)
            {
                InitDefaultState();
            }
            else
            {
                LoadState();
            }

            bank              = contentHub.bank;
            dayChangedAction += DayChanged;
            GameTimeDayTickEvent.AddListener(dayChangedAction);
        }