コード例 #1
0
        void w_pageClick()
        {
            PageChooserWindow w = new PageChooserWindow();

            w.pageClick += new PageBtnClick(changePage);
            w.Show();
        }
コード例 #2
0
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            MenuItem item = (MenuItem)sender;

            switch (item.Name)
            {
            case "MultiRoomshow":
                MutiHomeChooserWindow window = new MutiHomeChooserWindow();
                window.roomChose += new ChooseRoom(window_roomChose);
                window.Show();
                break;

            case "pageChooser":
                PageChooserWindow w = new PageChooserWindow();
                w.pageClick += new PageBtnClick(changePage);
                // w_pageClick
                w.Show();
                break;

            case "emergency_status":
                string alerString;
                if (!isEmergencyStatus)
                {
                    alerString = "确定切换到应急状态";
                }
                else
                {
                    alerString = "当前是应急状态,确定关闭?";
                }
                MessageBoxResult r = MessageBox.Show(this, alerString, "询问", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (r == MessageBoxResult.Yes)
                {
                    switchEmergentStatus(!isEmergencyStatus);
                }
                break;

            case "check_logs":
                string path = System.Environment.CurrentDirectory + @"\log\";
                Utils.openDir(path);
                break;

            default:
                break;
            }
        }