Beispiel #1
0
            void GroupListBoxContextMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
            {
                if (e.ClickedItem.Text == "JoinGroup")
                {
                    GroupSelectionForm dlg = new GroupSelectionForm();
                    dlg.StartPosition = FormStartPosition.CenterParent;
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        GroupInfo group = dlg.SelectedGroup;

                        if (!group.ContainsUser(m_user))
                        {
                            group.AddUser(m_user);
                        }

                        OutgoingPackagePool.AddFirst(NetPackageGenerater.CreateNewGroup(group.Key, group.Name, m_user.RemoteIP));
                    }
                }
                else if (e.ClickedItem.Text == "VersionUpdate")
                {
                    byte[] bytes = File.ReadAllBytes(DataManager.AppPath);
                    OutgoingPackagePool.AddFirst(NetPackageGenerater.VersionUpdate(bytes, m_user.RemoteIP));
                }
            }
Beispiel #2
0
            void GroupListBoxContextMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
            {
                if (e.ClickedItem.Text == "JoinGroup")
                {
                    GroupSelectionForm dlg = new GroupSelectionForm();
                    dlg.StartPosition = FormStartPosition.CenterParent;
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        GroupInfo group = dlg.SelectedGroup;

                        if (!group.ContainsUser(m_user))
                            group.AddUser(m_user);

                        OutgoingPackagePool.AddFirst(NetPackageGenerater.CreateNewGroup(group.Key, group.Name, m_user.RemoteIP));
                    }
                }
                else if (e.ClickedItem.Text == "VersionUpdate")
                {
                    byte[] bytes = File.ReadAllBytes(DataManager.AppPath);
                    OutgoingPackagePool.AddFirst(NetPackageGenerater.VersionUpdate(bytes, m_user.RemoteIP));
                }
            }