protected virtual void OnReceive(SniperInfoModel sniperInfo)
 {
     Task.Run(() =>
     {
         EventHandler?.Invoke(this, sniperInfo);
     });
 }
 protected virtual void OnReceive(SniperInfoModel sniperInfo)
 {
     Task.Run(() =>
     {
         if (eventHandler != null)
         {
             eventHandler(this, sniperInfo);
         }
     });
 }
Пример #3
0
 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);
     });
 }
Пример #4
0
 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($"pack://application:,,,/PogoLocationFeeder.GUI;component/Assets/icons/{(int)sniperInfo.Id}.png", UriKind.Absolute)),
             Server  = server,
             Channel = channel
         };
         InsertToList(info);
     });
 }
Пример #5
0
        public void InsertToList(SniperInfoModel info)
        {
            var pokes = GlobalVariables.PokemonsInternal;

            _showLimit = Settings.Default.ShowLimit;
            if (pokes.Count > _showLimit)
            {
                var diff = pokes.Count - _showLimit;
                for (var i = 0; i < diff; i++)
                {
                    pokes.Remove(pokes.Last());
                }
            }
            if (pokes.Count >= _showLimit)
            {
                pokes.Remove(pokes.Last());
            }
            pokes.Insert(0, info);
        }
Пример #6
0
        public void InsertToList(SniperInfoModel info)
        {
            var pokes = GlobalVariables.PokemonsInternal;

            pokes.Insert(0, info);
        }