Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class Form1 : Form
- {
- static AutoResetEvent autoResetEvent = new AutoResetEvent(false);
- public Form1()
- {
- InitializeComponent();
- Task task = Task.Factory.StartNew(() =>
- {
- button1_Click();
- });
- autoResetEvent.WaitOne();
- if (excelValues != null)
- {
- string dayOne = excelValues.workoutOfTheDay[0].name;
- MessageBox.Show(dayOne);
- }
- else
- {
- MessageBox.Show("No excel values");
- }
- }
- public event EventHandler FileCreated;
- public string FileName { get; set; }
- public day excelValues { get; set; }
- private void button1_Click(object sender, EventArgs e)
- {
- OpenFileDialog filepath = new OpenFileDialog();
- string FileNameOld = string.Empty;
- if (filepath.ShowDialog() == DialogResult.OK)
- {
- FileNameOld = filepath.FileName;
- //MessageBox.Show(FileName);
- this.FileName = FileNameOld;
- // MessageBox.Show(FileName);
- excelParser.Program newclass = new excelParser.Program();
- this.excelValues = newclass.ExcelExecute(FileName);
- autoResetEvent.Set();
- // var numberOfLines = excelValues.workoutOfTheDay.Count;
- }
- else
- {
- MessageBox.Show("You need to select a file");
- }
- }
- private void webBrowser1_DocumentCompleted(object sender,
- WebBrowserDocumentCompletedEventArgs e)
- {
- }
- }
Add Comment
Please, Sign In to add comment