private void PasteAcrossRowsCommand(object obj) { var clipBoard = GetClipboardContent(); if (clipBoard == null) { return; } var split = clipBoard.Trim().Split(new Char[] { ',', ';', '\n' }); var item = obj as ProcessEntry; if (item == null) { foreach (var entry in split) { KillList.Add(new ProcessEntry(entry.Trim())); } return; } var index = KillList.IndexOf(item); if (index == -1) { index = KillList.Count; } for (int i = 1; i <= split.Length; i++) { KillList.Insert(index + i, new ProcessEntry(split[i - 1].Trim())); } }
private void PasteAsNewRowCommand(object obj) { var clipBoard = GetClipboardContent().Trim(); if (clipBoard == null) { return; } var process = new ProcessEntry(clipBoard); var item = obj as ProcessEntry; if (item == null) { KillList.Add(process); return; } var index = KillList.IndexOf(item); if (index != -1) { KillList.Insert(++index, process); } }
public void AddKillList(BaseCharacter t) { KillList.Add(t); IsUpdate = true; }
private void ExtractFromWorkersCommand(object obj) { IsBusy = true; List <string> tempList = new List <string>(); foreach (var w in WorkerList) { foreach (var ct in w.CoinList) { var ext = System.IO.Path.GetExtension(ct.Path); if (ext == ".exe" || ext == ".bat" | ext == ".ps1" || ext == ".py") { tempList.Add(ct.Path); } } } if (tempList.Count == 0) { MessageBox.Show("No .exe or script entries have been found in Workers.", "Nothing found", MessageBoxButton.OK, MessageBoxImage.Information); return; } var allFound = tempList.Distinct().ToList(); tempList.Clear(); Regex regex = new Regex(@"[^\s\\]\w+\.exe($|\W)"); foreach (var path in allFound) { var ext = System.IO.Path.GetExtension(path); if (ext == ".exe") { if (!rawLines) { KillList.Add(new ProcessEntry(System.IO.Path.GetFileName(path))); } else { KillList.Add(new ProcessEntry(path)); } } else { string [] lines = null; if (System.IO.File.Exists(path)) { lines = System.IO.File.ReadAllLines(path); } if (lines == null || lines.Length == 0) { continue; } foreach (var line in lines) { var matches = regex.Matches(line); if (matches == null || matches.Count == 0) { continue; } if (!rawLines) { foreach (var match in matches) { string fileName = match.ToString(); fileName = fileName.Trim(); fileName = Regex.Replace(fileName, @"[\\""']", string.Empty); tempList.Add(fileName); } } else { tempList.Add(line); } } } } var clearList = tempList.Distinct().ToList(); foreach (var entry in clearList) { KillList.Add(new ProcessEntry(entry)); } IsBusy = false; }
public bool TryAdd(ReadOnlySpan <char> logLine) { if (LevelLoad.TryParse(logLine, LogDate, out var ll)) { Current = ll; LoadLevelList.Add(ll); } else if (TestDriveStart.TryParse(logLine, LogDate, out var std)) { Current = std; StartTestDriveList.Add(std); } else if (TestDriveFinish.TryParse(logLine, LogDate, out var ftd)) { Current = ftd; FinishTestDriveList.Add(ftd); } else if (GameStart.TryParse(logLine, LogDate, out var sg)) { Current = sg; StartGameList.Add(sg); } else if (GameFinish.TryParse(logLine, LogDate, out var fg)) { Current = fg; FinishGameList.Add(fg); } else if (GameRound.TryParse(logLine, LogDate, out var rg)) { Current = rg; RoundGameList.Add(rg); } else if (ActiveBattleStart.TryParse(logLine, LogDate, out var sab)) { Current = sab; StartActiveBattleList.Add(sab); } else if (PlayerLoad.TryParse(logLine, LogDate, out var pl)) { Current = pl; PlayerLoadList.Add(pl); } else if (Damage.TryParse(logLine, LogDate, out var dmg)) { Current = dmg; DamageList.Add(dmg); } else if (Killing.TryParse(logLine, LogDate, out var kill)) { Current = kill; KillList.Add(kill); } else if (KillAssist.TryParse(logLine, LogDate, out var ka)) { Current = ka; KillAssistList.Add(ka); } else if (Score.TryParse(logLine, LogDate, out var sc)) { Current = sc; ScoreList.Add(sc); } else if (Decal.TryParse(logLine, LogDate, out var dec)) { Current = dec; DecalList.Add(dec); } else { Current = null; return(false); } //update datetimes var currentDateTime = new DateTime(Current.TimeStamp); if (currentDateTime > Last) { Last = currentDateTime; } if (currentDateTime < First) { First = currentDateTime; } return(true); }