//---------------------------------------------------------------------- void RefreshProcListByCom(string com) { byte[] data = null; switch (com) { case "Connect": data = Encoding.Default.GetBytes("Connect:"); break; case "Kill": data = Encoding.Default.GetBytes($"Kill:{ProcIndex.Id}"); break; case "Run": data = Encoding.Default.GetBytes($"Run:{RunTask}"); break; case "Refresh": data = Encoding.Default.GetBytes("Refresh:"); break; } socket.Send(data); var answer = new byte[8192]; var length = socket.Receive(answer); if (length != 0) { var mStream = new MemoryStream(); var binFormatter = new BinaryFormatter(); mStream.Write(answer, 0, length); mStream.Position = 0; var tempCol = binFormatter.Deserialize(mStream) as List <ProcItem>; Dispatcher.Invoke(() => { ProcessList.Clear(); foreach (var item in tempCol) { var proc = new ProcItem(); proc.Id = item.Id; proc.Name = item.Name; ProcessList.Add(proc); } }); } }
private void DispatcherTimer_Tick(object sender, EventArgs e) { ProcessList.Clear(); try { asdasd(); } catch (Exception) { } }
void ProfileSwitch(object sender) { string newProfile = sender.ToString(); SaveSettings(false); var newGameData = Settings.data.Games[newProfile]; if (newGameData.Name != gameData.Name) { if (string.IsNullOrWhiteSpace(newGameData.Path)) { var dialog = new VistaFolderBrowserDialog { Description = $"Select userdata folder for {newGameData.Name}", UseDescriptionForTitle = true }; if (dialog.ShowDialog(this) == true) { newGameData.Path = dialog.SelectedPath; } } if (!string.IsNullOrWhiteSpace(newGameData.Path)) // check if paths in category exist here { TabScene.StopThread(); TabChara1.StopThread(); TabChara2.StopThread(); TabOutfit1.StopThread(); TabOutfit2.StopThread(); Settings.data.LastProfile = newProfile; SaveSettings(false); gameData = newGameData; ProcessList.Clear(); gameData.SceneList.ForEach((y) => ProcessList.Add(y.Name)); var scene = gameData.SceneList[gameData.SavedScene]; currentTarget = scene.Name; WindowTitle.Value = $"{defaultTitle} - {gameData.Name} - {currentTarget}"; PartialReplaceEnabled.Value = scene.PartialReplaceEnabled; SpecialLoadEnabled.Value = scene.SpecialLoadEnabled; TabScene.SetGame(gameData, gameData.Category.Scene); TabChara1.SetGame(gameData, gameData.Category.Chara1); TabChara2.SetGame(gameData, gameData.Category.Chara2); TabOutfit1.SetGame(gameData, gameData.Category.Outfit1); TabOutfit2.SetGame(gameData, gameData.Category.Outfit2); ImageMultiplier.Value = SelectedTab.ImageMultiplier; SavedTab.Value = gameData.Tab != -1 ? gameData.Tab : 0; } } }
public static void Clear() { ProcessList.Clear(); EngineType = EngineType.Native; ProcessIndex = -1; }
private void UpdateProcessListWithNewItems(List <ProcessInListDisplay> newItems) { ProcessList.Clear(); ProcessList.AddRange(newItems); ApplyFilters(); }