private void Parsing_Start(CParsingParameters parsingParams) { if (m_parser == null) { // refresh regex and replacements FilenameParser.reLoadExpressions(); m_parser = new OnlineParsing(this); m_parser.Start(parsingParams); } }
private void ImportWizard_OnFinishedSeriesID(UserInputResults inputResults, UserFinishedRequestedAction requestAction) { ParsingWizardSeriesIDPage.UserFinishedEditing -= new UserFinishedEditingDelegate(ImportWizard_OnFinishedSeriesID); ParsingWizardHost.RemoveDetailsPanel(ParsingWizardSeriesIDPage); if (requestAction == UserFinishedRequestedAction.Next) { m_parser = new OnlineParsing(this); // and give it to the wizard ParsingWizardHost.Init(); // now show generic progress details (remove seriesIDPage) ParsingWizardHost.RemoveDetailsPanel(ParsingWizardSeriesIDPage); ParsingWizardHost.ShowDetailsPanel(ParsingWizardProgress); ParsingWizardProgress.Init(); ParsingWizardHost.SetButtonState(ImportWizard.WizardButton.Prev, false); ParsingWizardHost.SetButtonState(ImportWizard.WizardButton.Next, false); ParsingWizardHost.ImportFinished += new EventHandler(ImportWizard_OnFinished); // only now do we set up the parser itself and fire it off ImportWizardParseParams.m_userInputResult = inputResults; // this will be requested by the the parsing engine at the appropriate time ImportWizardParseParams.UserEpisodeMatcher = ParsingWizardEpIDPage; ImportWizardParseParams.m_files = ParsingWizardParsingPage.allFoundFiles; // else they will be marked as removed ParsingWizardEpIDPage.UserFinishedEditing += new UserFinishedEditingDelegate(ImportWizard_OnFinishedEditingEpisodes); // finally fire it off m_timingStart = DateTime.Now; m_parser.Start(ImportWizardParseParams); } else if (requestAction == UserFinishedRequestedAction.Prev) { // unregister events ParsingWizardSeriesIDPage.UserFinishedEditing -= new UserFinishedEditingDelegate(ImportWizard_OnFinishedSeriesID); ParsingWizardSeriesIDPage.SeriesGridPopulated -= new ImportPanelSeriesID.SeriesGridPopulatedDelegate(ImportWizard_OnSeriesGridPopulated); // remove existing panel and show previous one ParsingWizardHost.SetButtonState(ImportWizard.WizardButton.Prev, false); ParsingWizardHost.ShowDetailsPanel(ParsingWizardParsingPage); ParsingWizardHost.RemoveDetailsPanel(ParsingWizardSeriesIDPage); ParsingWizardParsingPage.Init(); ParsingWizardSeriesIDPage.ClearResults(); } else if (requestAction == UserFinishedRequestedAction.Cancel) { } }