void JobCompleted(object sender, RunWorkerCompletedEventArgs args) { SetCurrentFile(null, null); var err = (string)args.Result; if (err != null) { Ui.ShowLine(err, Severity.Error); } ReportSummary("checked"); for (int ix = 1; ix < Data.tiModels.Count; ++ix) { TabInfo.Model tiModel = Data.tiModels[ix]; if (tiModel.Data.Index < 0) { if (tiModel.SetIndex(0)) { Data.RaisePropertyChanged(null); } } } if (newTabInfoIx > 0) { Data.tiModels[newTabInfoIx].SetIndex(newTabInfoFmtIx); Data.CurrentTabNumber = newTabInfoIx; } Data.ProgressCounter = null; ++Data.JobCounter; }
void Job(object sender, DoWorkEventArgs jobArgs) { jobArgs.Result = (string)null; newTabInfoIx = newTabInfoFmtIx = -1; try { foreach (FormatBase.Model parsing in CheckRoot(isTwoPass:true)) { if (parsing != null) { TabInfo.Model tiModel = GetTabInfoModel(parsing.Data.FullName); if (tiModel != null) { if (newTabInfoIx < 0 || parsing is LogFormat.Model || parsing is LogEacFormat.Model) { newTabInfoIx = tiModel.Data.TabPosition; newTabInfoFmtIx = tiModel.Data.Count; } tiModel.Add(parsing); } } } } catch (Exception ex) when(ex is IOException || ex is ArgumentException) { jobArgs.Result = ex.Message; } }
public void GetLast() { TabInfo.Model tiModel = Data.tiModels[Data.CurrentTabNumber]; if (tiModel.SetIndex(tiModel.Data.Count - 1)) { Data.RaisePropertyChanged(null); } }
public void ShowContents() { TabInfo.Model tiModel = Data.tiModels[Data.CurrentTabNumber]; FormatBase fmt = tiModel.GetFormatBase(); if (Object.ReferenceEquals(fmt, Data.BaseFormat)) { Data.BaseFormat = null; } Data.BaseFormat = fmt; }
public void GetNextBySeverity(Severity badness) { TabInfo.Model tiModel = Data.tiModels[Data.CurrentTabNumber]; for (int ix = tiModel.Data.Index; ++ix < tiModel.Data.Count;) { if (tiModel.Data.GetMaxSeverity(ix) >= badness) { if (tiModel.SetIndex(ix)) { Data.RaisePropertyChanged(null); } break; } } }
public void GetNextRepair() { TabInfo.Model tiModel = Data.tiModels[Data.CurrentTabNumber]; for (int ix = tiModel.Data.Index; ++ix < tiModel.Data.Count;) { if (tiModel.Data.GetIsRepairable(ix)) { if (tiModel.SetIndex(ix)) { Data.RaisePropertyChanged(null); } break; } } }
public Model(IDiagsUi ui) { Ui = ui; _data = new DiagsPresenter(this); foreach (string heading in Ui.GetHeadings()) { Data.tiModels.Add(new TabInfo.Model(heading, Data.tiModels.Count)); } Data.TabAif = GetTabInfoData("aif"); Data.TabApe = GetTabInfoData("ape"); Data.TabAsf = GetTabInfoData("asf"); Data.TabAvi = GetTabInfoData("avi"); Data.TabCue = GetTabInfoData("cue"); tabFlacModel = GetTabInfoModel("flac"); Data.TabFlac = tabFlacModel.Data; Data.TabFlv = GetTabInfoData("flv"); Data.TabGif = GetTabInfoData("gif"); Data.TabIco = GetTabInfoData("ico"); Data.TabJpg = GetTabInfoData("jpg"); Data.TabLogEac = GetTabInfoData("log (EAC)"); Data.TabLogXld = GetTabInfoData("log (XLD)"); Data.TabM3u = GetTabInfoData("m3u"); Data.TabM3u8 = GetTabInfoData("m3u8"); Data.TabM4a = GetTabInfoData("m4a"); Data.TabMd5 = GetTabInfoData("md5"); Data.TabMkv = GetTabInfoData("mkv"); Data.TabMov = GetTabInfoData("mov"); Data.TabMpg = GetTabInfoData("mpg"); Data.TabMp3 = GetTabInfoData("mp3"); Data.TabMp4 = GetTabInfoData("mp4"); Data.TabOgg = GetTabInfoData("ogg"); Data.TabPng = GetTabInfoData("png"); Data.TabSha1 = GetTabInfoData("sha1"); Data.TabSha1x = GetTabInfoData("sha1x"); Data.TabSha256 = GetTabInfoData("sha256"); Data.TabWav = GetTabInfoData("wav"); base.Data.MessageSend += Ui.ShowLine; base.Data.PropertyChanged += Data.NotifyPropertyChanged; }