Esempio n. 1
0
 private void ChartAddCommentsBtn_Click(object sender, RoutedEventArgs e)
 {
     //add comments
     Comment cm = new Comment();
     cm.CommentsText = comments;//if any
     bool? dres = cm.ShowDialog();
     if (dres == true)
         comments = cm.CommentsText;
     else
         comments = "";
 }
Esempio n. 2
0
        private void AnOpenFileBtn_Click(object sender, RoutedEventArgs e)
        {
            string ext = "";
            bool? DialogResult;
            Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog();
            ofd.Filter = "PXE files (*.pxe)|*.pxe|Binary files (*.pbn)|*.pbn|All files (*.*)|*.*";
            ofd.FilterIndex = 1;
            ofd.InitialDirectory = "C:\\Pipe Data";
            pxedata = new float[0];
            DialogResult = ofd.ShowDialog();
            if (DialogResult == true)
            {
                AnFileName = ofd.FileName;
                AnChart.Titles.Clear();
                AnChart.Titles.Add(AnFileName);
                FileSubs fs = new FileSubs();
                ext = System.IO.Path.GetExtension(AnFileName);
                //========================
                AnSaveFileBtn.IsEnabled = true;
                AnShowToolTipChk.IsEnabled = true;
                AnRestoreScaleBtn.IsEnabled = true;
                AnAddCommentBtn.IsEnabled = true;
                //==============================
                if (ext == ".pxe")
                {
                    pxa = new PxeAccess();
                    showPXE(AnFileName);
                    pxa = null;
                }

                else if (ext == ".pbn")
                {

                    ShowBinary(AnFileName);

                }
                else if (ext == ".txt")
                {
                    System.Diagnostics.Process.Start(AnFileName);
                }

                comments = fs.ReadComment(AnFileName + ".txt");
                if (comments != "")
                {
                    Comment cm = new Comment();
                    cm.CommentsText = comments;
                    cm.ShowDialog();
                }
            }
            else
                AnFileName = "";
        }
Esempio n. 3
0
 private void AnAddCommentBtn_Click(object sender, RoutedEventArgs e)
 {
     //add comments and save it
     string CommentFileName;
     Comment cm = new Comment();
     cm.CommentsText = comments;//if any
     bool? dres = cm.ShowDialog();
     if (dres == true)
         comments = cm.CommentsText;
     if (AnFileName != "")
     {
         CommentFileName = AnFileName + ".txt";
         FileSubs fs = new FileSubs();
         fs.SaveComment(comments, CommentFileName);
     }
     else
         comments = "";
 }