public void PrintPokemon(SniperInfo sniperInfo, string server, string channel) { Application.Current.Dispatcher.BeginInvoke((Action)delegate () { var info = new SniperInfoModel { Info = sniperInfo, Icon = new BitmapImage(new Uri(Path.Combine(iconPath, $"{(int)sniperInfo.Id}.png"))), Server = server, Channel = channel }; InsertToList(info); }); }
public void InsertToList(SniperInfoModel info) { var pokes = GlobalVariables.PokemonsInternal; ShowLimit = Settings.Default.ShowLimit; if(pokes.Count > ShowLimit) { var diff = pokes.Count - ShowLimit; for(int i = 0; i < diff; i++) { pokes.Remove(pokes.Last()); } } if(pokes.Count >= ShowLimit) pokes.Remove(pokes.Last()); pokes.Insert(0, info); }
public void PrintPokemon(SniperInfo sniperInfo, ChannelInfo channelInfo) { Application.Current.Dispatcher.BeginInvoke((Action) delegate { var info = new SniperInfoModel { Info = sniperInfo, Icon = new BitmapImage( new Uri( $"pack://application:,,,/PogoLocationFeeder.GUI;component/Assets/icons/{(int) sniperInfo.Id}.png", UriKind.Absolute)), Server = channelInfo.server, Channel = channelInfo.channel }; info.Icon.Freeze(); InsertToList(info); RemoveListExtras(); }); }
public void InsertToList(SniperInfoModel info) { var pokes = GlobalVariables.PokemonsInternal; pokes.Insert(0, info); }