Esempio n. 1
0
        private void ViewCurrentADCData_Click(object sender, RoutedEventArgs e)
        {
            ShowAdcDataset window = new ShowAdcDataset();

            window.AdcDataset = adcDataset;
            window.Show();
        }
Esempio n. 2
0
        private void ViewOldADCData_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter     = "ADS Binary File(*.ads)|*.ads";
            openFileDialog.DefaultExt = ".ads"; // Default file extension
            string strDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\AdcDataset\";

            if (!Directory.Exists(strDir))
            {
                Directory.CreateDirectory(strDir);
            }

            openFileDialog.InitialDirectory = strDir;
            if (openFileDialog.ShowDialog() == true)//注意,此处一定要手动引入System.Window.Forms空间,否则你如果使用默认的DialogResult会发现没有OK属性
            {
                ShowAdcDataset window = new ShowAdcDataset();
                window.AdcDataset = AdcDataset.ReadFrom(openFileDialog.FileName);
                window.Show();
            }
        }