コード例 #1
0
ファイル: Operation1.xaml.cs プロジェクト: nauhtnn/sQz
        private void Main_Loaded(object sender, RoutedEventArgs e)
        {
            Window w = Window.GetWindow(this);

            w.WindowStyle = WindowStyle.None;
            w.WindowState = WindowState.Maximized;
            w.ResizeMode  = ResizeMode.NoResize;
            w.Closing    += W_Closing;
            w.FontSize    = 13;

            WPopup.nwIns(w);

            spMain.Background = Theme.s._[(int)BrushId.BG];

            LoadTxt();
        }
コード例 #2
0
ファイル: ExamPage.xaml.cs プロジェクト: nauhtnn/sQz
        private void Main_Loaded(object sender, RoutedEventArgs e)
        {
            Window w = Window.GetWindow(this);

            w.WindowStyle = WindowStyle.None;
            w.WindowState = WindowState.Maximized;
            w.ResizeMode  = ResizeMode.NoResize;
            w.Closing    += W_Closing;
            w.FontSize    = 16;

            double mrg = FontSize / 2;

            qiWh = 3 * mrg;
            qMrg = new Thickness(mrg, mrg, 0, mrg);
            qaWh = (svwrQSh.Width - SystemParameters.ScrollWidth) / 2 - mrg - mrg - qiWh;

            InitLeftPanel();
            InitQuestPanel();

            bBtnBusy = false;

            txtWelcome.Text = mNee.ToString();

            LoadTxt();

            WPopup.nwIns(w);
            WPopup.s.CbNOK = WPCollapse;

            int m = -1, s = -1;

            if (mNee.eStt < NeeStt.Submitting)
            {
                string t = Utils.ReadAllLines("Duration.txt")[0];
                if (t != null)
                {
                    string[] vt = t.Split('\t');
                    if (vt.Length == 2)
                    {
                        int.TryParse(vt[0], out m);
                        int.TryParse(vt[1], out s);
                    }
                    if (-1 < m && -1 < s)
                    {
                        dtRemn = mNee.kDtDuration = new TimeSpan(0, m, s);
                    }
                }
            }
            if (m < 0 || s < 0)
            {
                dtRemn = mNee.kDtDuration;
            }
            txtRTime.Text = "" + dtRemn.Minutes + " : " + dtRemn.Seconds;
            kLogIntvl     = new TimeSpan(0, 0, 30);

            System.Text.StringBuilder msg = new System.Text.StringBuilder();
            msg.Append(mNee.tId + " (" + mNee.tName + ")");
            if (mNee.kDtDuration.Minutes == 30)
            {
                msg.Append(Txt.s._[(int)TxI.EXAMING_MSG_1]);
            }
            else
            {
                msg.AppendFormat(Txt.s._[(int)TxI.EXAMING_MSG_2],
                                 mNee.kDtDuration.Minutes, mNee.kDtDuration.Seconds);
            }
            WPopup.s.CbOK  = WPopup.s.CbNOK = ShowQuestion;
            spMain.Opacity = 0.5;
            WPopup.s.ShowDialog(msg.ToString());
            spMain.Opacity = 1;
            if (mNee.eStt < NeeStt.Examing)
            {
                mNee.eStt = NeeStt.Examing;
            }
            else if (mNee.eStt == NeeStt.Submitting)
            {
                Submit();
            }
        }