public void MergeUserList(UserList other) { foreach (var dateTime in other.Users) { if (Users.ContainsKey(dateTime.Key)) { Users[dateTime.Key] = dateTime.Value; } } }
public MainWindow() { InitializeComponent(); upload.DoWork += new DoWorkEventHandler(upload_DoWork); upload.RunWorkerCompleted += new RunWorkerCompletedEventHandler(upload_RunWorkerCompleted); download.DoWork += new DoWorkEventHandler(download_DoWork); download.RunWorkerCompleted += new RunWorkerCompletedEventHandler(download_RunWorkerCompleted); downloadDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\CWRUShare\\"; // Get the c:\ directory. users = new UserList(); //users.AddUser("192.168.1.1"); fileList = new FileList(); fileList.PopulateFileList(downloadDirectory); thisAddress = (Dns.GetHostEntry(Dns.GetHostName())).AddressList[0]; foreach (IPAddress address in Dns.GetHostEntry(Dns.GetHostName()).AddressList) { if (address.AddressFamily == AddressFamily.InterNetwork) { thisAddress = address; break; } } ConnectionManager.Listen(new SendOrPostCallback(Listener)); ConnectionManager.SetUserList(users); ConnectionManager.SetThisFileList(fileList); }
public static void SetUserList(UserList reference) { userList = reference; }