protected ApplicationPanel(MainForm parent) { _parent = parent; ClientAPI = new ClientAPI(); FichierAPI = new FichierAPI(); GroupeAPI = new GroupeAPI(); InvitationAPI = new InvitationAPI(); }
private async Task SyncFiles() { var files = await FichierAPI.GetFilesFromGroup(ActiveGroup.id_groupe); if (files == null) { return; } FileListView.Invoke((MethodInvoker) delegate { FileListView.Items.Clear(); foreach (var file in files) { string[] rows = { file.id_fichier.ToString(), file.nom }; FileListView.Items.Add(new ListViewItem(rows)); } }); }
public MainForm() { InitializeComponent(); _homePanel = new HomePanel(this); _groupPanel = new GroupPanel(this); _connectionPanel = new ConnectionPanel(this); _notificationsPanel = new NotificationsPanel(this); CurrentPanel = Panel.Connection; UDPClient.Connect("localhost", UDP_PORT); FichierAPI = new FichierAPI(); GroupeAPI = new GroupeAPI(); InvitationAPI = new InvitationAPI(); LAST_TIME_SYNC_FILES = DateTime.Now; LAST_TIME_SYNC_CLIENTS = DateTime.Now; LAST_TIME_SYNC_GROUPS = DateTime.Now; LAST_TIME_SYNC_NOTIFS = DateTime.Now; Task.Run(PeriodicSynchronization); }