private void bnConnect_Click(object sender, EventArgs e) { if (client == null) { client = new LoneSeekClient(); client.OnLogin += new LoneSeekEvent(client_OnLogin); client.OnRoomListUpdated += new LoneSeekEvent(client_OnRoomListUpdated); client.OnRoomJoined += new LoneSeekRoomEvent(client_OnRoomJoined); client.OnChatMessage += new LoneSeekChatMessageEvent(client_OnChatMessage); client.OnRoomLeft += new LoneSeekRoomEvent(client_OnRoomLeft); // Only share my avi files. client.FileIndexer.AllowedExtensions.Add("avi"); // Share my southpark folder client.FileIndexer.Add("d:\\media\\"); // Specify incoming port client.IncomingPort = 14447; // Connect to the soulseek stuff client.Connect("sk6.slsknet.org", 2240); // Login as loneseek. client.Username = "******"; client.Password = "******"; // Login now client.Login(); } }
private void bnDisconnect_Click(object sender, EventArgs e) { if (client != null) { client.Disconnect(); client = null; } }
/// <summary> /// Constructs a new ChatRoom object and initializes the name /// of the chat room. /// </summary> /// <param name="client">LoneSeekClient object the room belongs to.</param> /// <param name="name">Name of the chat room.</param> /// <param name="count">Number of users in the chat room.</param> public ChatRoom(LoneSeekClient client, String name, Int32 count) { this.client = client; this.name = name; this.usercount = count; }