コード例 #1
0
        //-------------<Resend history request>--------------------
        private void Resend_Click(object sender, RoutedEventArgs e)
        {
            if (requestHistory.SelectedIndex == -1 || !serverRunning)
            {
                return;
            }
            string path = clientSend_ + requestHistory.SelectedValue.ToString();

            if (!System.IO.File.Exists(path))
            {
                requestHistory.Items.Remove(requestHistory.SelectedValue.ToString());
                ws = new WarningRes();
                ws.Show();
                return;
            }
            ++pendingRequest_;
            sendFile(requestHistory.SelectedValue.ToString(), "testing");
        }
コード例 #2
0
        //----------<Open history request log>------------
        private void OpenHis_Click(object sender, RoutedEventArgs e)
        {
            if (ResultList.SelectedIndex == -1)
            {
                return;
            }
            string res = ResultList.SelectedValue.ToString();

            if (!System.IO.File.Exists(res))
            {
                ResultList.Items.Remove(ResultList.SelectedItem);
                wr = new WarningRes();
                wr.Show();
                return;
            }
            string content = System.IO.File.ReadAllText(res);

            anResult = new AnalysisResult();
            anResult.resultView.Text = content;
            anResult.Show();
        }
コード例 #3
0
        //--------------<Delete the history request log>------------
        private void DeleteHis_Click(object sender, RoutedEventArgs e)
        {
            string path = ResultList.SelectedValue.ToString();

            if (!System.IO.File.Exists(path))
            {
                ResultList.Items.Remove(ResultList.SelectedItem);
                wr = new WarningRes();
                wr.Show();
                return;
            }
            else
            {
                dw = new DeleteConfirm(this);
                dw.ShowDialog();
                if (del)
                {
                    System.IO.File.Delete(path);
                    ResultList.Items.Remove(ResultList.SelectedItem);
                }
            }
        }
コード例 #4
0
        //--------------------<Delete history test log from GUI and folder>------------
        private void DeleteRes_Click(object sender, RoutedEventArgs e)
        {
            if (TestHistory.SelectedIndex == -1)
            {
                return;
            }
            string path = clientSave_ + TestHistory.SelectedValue.ToString();

            if (!System.IO.File.Exists(path))
            {
                TestHistory.Items.Remove(TestHistory.SelectedItem);
                ws = new WarningRes();
                ws.Show();
                return;
            }
            dw = new DeleteConfirm(this);
            dw.ShowDialog();
            if (del)
            {
                System.IO.File.Delete(path);
                TestHistory.Items.Remove(TestHistory.SelectedItem);
            }
        }
コード例 #5
0
        //---------------------<View history test log>-------------------------
        private void ViewText_Click(object sender, RoutedEventArgs e)
        {
            if (TestHistory.SelectedIndex == -1)
            {
                return;
            }
            string path = clientSave_ + TestHistory.SelectedValue.ToString();

            if (!System.IO.File.Exists(path))
            {
                TestHistory.Items.Remove(TestHistory.SelectedValue.ToString());
                ws = new WarningRes();
                ws.Show();
                return;
            }
            textWin = new TextView();
            System.IO.StreamReader sr = new System.IO.StreamReader(path);
            string lines = sr.ReadToEnd();

            sr.Close();
            textWin.TextViewer.Text = lines;
            textWin.Show();
        }
コード例 #6
0
        //-------------<View history request>--------------------
        private void requestHistory_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (requestHistory.SelectedIndex == -1)
            {
                return;
            }
            string path = clientSend_ + requestHistory.SelectedValue.ToString();

            if (!System.IO.File.Exists(path))
            {
                requestHistory.Items.Remove(requestHistory.SelectedValue.ToString());
                ws = new WarningRes();
                ws.Show();
                return;
            }
            textWin = new TextView();
            System.IO.StreamReader sr = new System.IO.StreamReader(path);
            string lines = sr.ReadToEnd();

            sr.Close();
            textWin.TextViewer.Text = lines;
            textWin.Show();
        }