Ejemplo n.º 1
0
        private void Parser_OnNewData(object a1, string a2)
        {
            if (a2 == null)
            {
                return;
            }

            var    aa  = a2.ToCharArray();
            string res = null;

            for (int i = 32; i < aa.Length; i++)
            {
                if (aa[i] == 'p')
                {
                    break;
                }
                res += aa[i];
            }

            if (previous == null)
            {
                previous = res;
            }

            if ((float.Parse(res) - float.Parse(previous)) != 0)
            {
                Differ.Items.Add((float.Parse(res) - float.Parse(previous)).ToString());
                Differ.ScrollIntoView((float.Parse(res) - float.Parse(previous)).ToString());
            }

            if (Math.Abs(float.Parse(res) - float.Parse(previous)) > float.Parse(Dif.Text))
            {
                SystemSounds.Asterisk.Play();
                PopupNotifier popup = new PopupNotifier();
                popup.Image        = Properties.Resources.icon;
                popup.BodyColor    = System.Drawing.Color.Black;
                popup.ContentColor = System.Drawing.Color.White;
                popup.TitleColor   = System.Drawing.Color.White;
                popup.TitleText    = "Steam Marketplace Price Observer";
                popup.ContentText  = "\n\nPrice changed: " + (float.Parse(res) - float.Parse(previous)).ToString();
                popup.Popup();
                previous = res;
            }
            Res.Items.Add(res);
            Res.ScrollIntoView(res);
        }