public NewEvent(User passedUser) { calendar = Utils.ReadEventsSerialFile(); allUsers = Utils.ReadUsersSerialFile(); user = passedUser; InitializeComponent(); SetListBoxItems(); DatePickerEventDate.SelectedDate = DateTime.Today; ButtonCancel.Click += new RoutedEventHandler(CancelBtn_Click); ButtonSave.Click += new RoutedEventHandler(SaveBtn_Click); }
public static UsersList ReadUsersSerialFile() { if (File.Exists(usersFile)) { IFormatter userFormatter = new BinaryFormatter(); Stream userStream = new FileStream(usersFile, FileMode.Open, FileAccess.Read); UsersList users = (UsersList)userFormatter.Deserialize(userStream); userStream.Close(); return(users); } else { return(new UsersList()); } }
public Appointment(string name, string description, DateTime date, string[] start, string[] end, User owner, UsersList participants) { this.name = name; this.description = description; this.date = date; this.start = start; this.end = end; this.owner = owner; this.participants = participants; }
public Login() { InitializeComponent(); buttonAccept.Click += new RoutedEventHandler(AcceptBtn_Click); users = Utils.ReadUsersSerialFile(); }