private void ImportAnnoFromElan(string filename) { AnnoList[] lists = AnnoList.LoadfromElanFile(filename); double maxdur = 0; if (lists != null) { foreach (AnnoList list in lists) { foreach (AnnoListItem it in list) { if (it.Stop > maxdur) { maxdur = it.Stop; } } annoLists.Add(list); addAnnoTier(list); } } updateTimeRange(maxdur); if (annoLists.Count == 1 && maxdur > Properties.Settings.Default.DefaultZoominSeconds && Properties.Settings.Default.DefaultZoominSeconds != 0) { fixTimeRange(Properties.Settings.Default.DefaultZoominSeconds); } }
private void ImportAnnoFromElan(string filename) { int annoListnum = annoLists.Count; bool addemptytiers = false; List <AnnoList> lists = AnnoList.LoadfromElanFile(filename); if (lists.Exists(n => n.Count == 0)) { MessageBoxResult mb = MessageBox.Show("At least one tier is empty, should empty tiers be excluded?", "Attention", MessageBoxButton.YesNo); if (mb == MessageBoxResult.No) { addemptytiers = true; } } double maxdur = 0; if (lists != null) { foreach (AnnoList list in lists) { if (list.Count > 0) { maxdur = list[list.Count - 1].Stop; } if (list.Count > 0 || addemptytiers) { annoLists.Add(list); addAnnoTier(list); } } } updateTimeRange(maxdur); if (annoListnum == 0 && maxdur > Properties.Settings.Default.DefaultZoomInSeconds && Properties.Settings.Default.DefaultZoomInSeconds != 0) { fixTimeRange(Properties.Settings.Default.DefaultZoomInSeconds); } }