public override void OnActivate() { modList.Clear(); items.Clear(); string[] mods = ModLoader.FindMods(); foreach (string mod in mods) { UIModItem modItem = new UIModItem(mod); modList.Add(modItem); items.Add(modItem); } }
public override void OnActivate() { Main.clrInput(); modListAll.Clear(); items.Clear(); TmodFile[] mods = ModLoader.FindMods(); foreach (TmodFile mod in mods) { UIModItem modItem = new UIModItem(mod); modListAll.Add(modItem); items.Add(modItem); } FilterList(); }
internal void Populate() { Task.Factory .StartNew(ModOrganizer.FindMods, _cts.Token) .ContinueWith(task => { var mods = task.Result; foreach (var mod in mods) { UIModItem modItem = new UIModItem(mod); modItem.Activate(); items.Add(modItem); } needToRemoveLoading = true; updateNeeded = true; loading = false; }, _cts.Token, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()); }
internal void Populate() { if (SynchronizationContext.Current == null) { SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); } Task.Factory .StartNew(ModLoader.FindMods) .ContinueWith(task => { var mods = task.Result; foreach (TmodFile mod in mods) { UIModItem modItem = new UIModItem(mod); items.Add(modItem); } needToRemoveLoading = true; updateNeeded = true; }, TaskScheduler.FromCurrentSynchronizationContext()); }
internal void Populate() { loading = true; if (SynchronizationContext.Current == null) { SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); } Task.Factory .StartNew(ModLoader.FindMods) .ContinueWith(task => { var mods = task.Result; foreach (TmodFile mod in mods) { UIModItem modItem = new UIModItem(mod); modListAll.Add(modItem); items.Add(modItem); } FilterList(); loading = false; }, TaskScheduler.FromCurrentSynchronizationContext()); }