private void Load_Click(object sender, RoutedEventArgs e) { OpenFileDialog fd = new OpenFileDialog(); fd.Title = "Open JSON"; fd.Filter = "JSON File (*.json)|*.JSON"; if (fd.ShowDialog() == false) { return; } SaveFileDialog fe = new SaveFileDialog(); fe.ValidateNames = false; fe.CheckFileExists = false; fe.CheckPathExists = false; fe.FileName = "Save Here"; fe.Title = "Save video"; if (fe.ShowDialog() == false) { return; } List <ClipModel> tempj = JsonConvert.DeserializeObject <List <ClipModel> >(File.ReadAllText(fd.FileName)); if (tempj == null) { MessageBox.Show("The file you're trying to open is empty."); return; } foreach (var clip in tempj) { if (clip.clips.First().broadcaster.name != "") { FetchClips fc = new FetchClips(); AllocConsole(); fc.Fetch(TextClientID.Password, tempj.First().clips.First().broadcaster.name, Path.GetDirectoryName(fe.FileName), fd.FileName); } } }
private void Fetch_Click(object sender, RoutedEventArgs e) { SaveFileDialog fe = new SaveFileDialog(); fe.ValidateNames = false; fe.CheckFileExists = false; fe.CheckPathExists = false; fe.FileName = "Save Here"; fe.Title = "Save video"; if (fe.ShowDialog() == false) { return; } FetchClips fc = new FetchClips(); AllocConsole(); fc.Fetch(TextClientID.Password, TextTwitchName.Text, Path.GetDirectoryName(fe.FileName)); }