示例#1
0
        public ServerGroupPanel()
        {
            this.Orientation = Orientation.Vertical;

            sgb = new ServerGroupButton();
            this.Children.Add(sgb);

            slb = new ServerListBox();
            this.Children.Add(slb);

            this.VerticalAlignment = System.Windows.VerticalAlignment.Bottom;
        }
        private void BtnAddServerMenu_Click(object sender, RoutedEventArgs e)
        {
            Window_AddServerMenu wms = new Window_AddServerMenu();
            Point pt = this.PointToScreen(new Point(0, 0));

            wms.Left = pt.X;
            wms.Top  = pt.Y;
            if (wms.ShowDialog() == true)
            {
                string server_menu_name = wms.textBox_name.Text;

                if (ServerInfo.AddServerGroup(server_menu_name) != 0)
                {
                    return;
                }

                ServerGroupButton smbtn = new ServerGroupButton(server_menu_name);
                ServerGroupPanel.current.Children.Add(smbtn);
                ServerGroupPanel.SubPanel.Children.Add(smbtn.child);
            }
        }