public void TryToReach(MessageEndpoint m) { if (m.Nickname.Trim() == "") { return; } var r = default(RemoteUserInfo); foreach (var k in Remotes) { if (k.EndPoints[0].Nickname == m.Nickname) { r = k; // okay we already have a known endpoint. break; } } if (r == null) { r = new RemoteUserInfo { EndPoints = new [] { m }, Node = treeView1.Nodes.Add(m.Nickname) }; Remotes = Remotes.Concat(r); } }
public static RemoteUserInfo[] Concat(this RemoteUserInfo[] f, RemoteUserInfo v) { if (f == null) return new[] { v }; var a = new RemoteUserInfo[f.Length + 1]; Array.Copy(f, a, f.Length); a[f.Length] = v; return a; }
public static RemoteUserInfo[] Concat(this RemoteUserInfo[] f, RemoteUserInfo v) { if (f == null) { return new[] { v } } ; var a = new RemoteUserInfo[f.Length + 1]; Array.Copy(f, a, f.Length); a[f.Length] = v; return(a); } }
public void TryToReach(MessageEndpoint m) { if (m.Nickname.Trim() == "") return; var r = default(RemoteUserInfo); foreach (var k in Remotes) { if (k.EndPoints[0].Nickname == m.Nickname) { r = k; // okay we already have a known endpoint. break; } } if (r == null) { r = new RemoteUserInfo { EndPoints = new [] { m }, Node = treeView1.Nodes.Add(m.Nickname) }; Remotes = Remotes.Concat(r); } }