private void Button_Click(object sender, RoutedEventArgs e) { List <LogInfo> lis = (from LogInfo a in cloginfos.SelectedItems select a).ToList(); foreach (var l in lis) { AvailableLogs.Remove(l); } }
public async Task LogAll() { saveLogData(); Logger lgr = new Logger(); List <LogInfo> loglist = await lgr.LogGeocachesAsync(AvailableLogs.ToList()); foreach (var l in loglist) { AvailableLogs.Remove(l); } }
private void Button_Click_3(object sender, RoutedEventArgs e) { if (cloginfos.SelectedIndex < cloginfos.Items.Count - 1) { int index = cloginfos.SelectedIndex; LogInfo l = AvailableLogs[index]; AvailableLogs.RemoveAt(index); AvailableLogs.Insert(index + 1, l); SelectedLog = l; } }
public async Task LogSelected() { if (cloginfos.SelectedItems.Count > 0) { saveLogData(); Logger lgr = new Logger(); List <LogInfo> loglist = await lgr.LogGeocachesAsync((from LogInfo a in cloginfos.SelectedItems select a).ToList()); foreach (var l in loglist) { AvailableLogs.Remove(l); } } }
private void InitLogUploaderUI() { AvailableLogs.ClearEx(); var directory = new DirectoryInfo(App.LogDir); var logfiles = directory.GetFiles(@"modmanagerlog*.txt").OrderByDescending(f => f.LastWriteTime).ToList(); AvailableLogs.Add(new LogItem("Select an application log") { Selectable = false }); AvailableLogs.AddRange(logfiles.Select(x => new LogItem(x.FullName))); SelectedLog = AvailableLogs.FirstOrDefault(); var targets = mainwindow.InstallationTargets.Where(x => x.Selectable); DiagnosticTargets.Add(new GameTarget(Mod.MEGame.Unknown, "Select a game target to generate diagnostics for", false)); DiagnosticTargets.AddRange(targets); SelectedDiagnosticTarget = DiagnosticTargets.FirstOrDefault(); //if (LogSelector_ComboBox.Items.Count > 0) //{ // LogSelector_ComboBox.SelectedIndex = 0; //} }
public LogWindow(List <GeocacheVisitsItem> gcList) : this() { if (gcList != null) { foreach (var gc in gcList) { LogInfo li = (from a in AvailableLogs where a.GeocacheCode == gc.Code select a).FirstOrDefault(); if (li == null) { li = new LogInfo(); li.GeocacheCode = gc.Code; li.LogText = gc.Comment; li.LogType = Utils.DataAccess.GetLogType(2); li.VisitDate = gc.LogDate; li.AddToFavorites = false; li.TrackableDrop = false; li.TrackableRetrieve = ""; AvailableLogs.Add(li); } } } }