Exemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            myPW       = ConfigurationManager.AppSettings["myPW"];
            myUsername = ConfigurationManager.AppSettings["myUsername"];
            int intervall = 10000;

            Int32.TryParse(ConfigurationManager.AppSettings["intervall"], out intervall);
            trackBar1.Value            = intervall;
            timer_autorefresh.Interval = intervall;

            if (ConfigurationManager.AppSettings["logViews"] == "1")
            {
                logViews = true;
            }
            else
            {
                logViews = false;
            }

            if (ConfigurationManager.AppSettings["notifyViews"] == "1")
            {
                notifyViews = true;
            }
            else
            {
                notifyViews = false;
            }
            checkBox_LogViews.Checked    = logViews;
            checkBox_NotifyViews.Checked = notifyViews;

            if (System.IO.File.Exists("state.xml"))
            {
                XmlSerializer xs = new XmlSerializer(typeof(accountdata));
                accountdata   referenceaccountdata = new accountdata();
                using (var sr = new StreamReader("state.xml"))
                {
                    referenceaccountdata = (accountdata)xs.Deserialize(sr);
                }
                referencepatdataList = referenceaccountdata.patterns;
                referenceheaderdata  = referenceaccountdata.header;

                showdata(referenceheaderdata, referencepatdataList);
            }

            timer_autorefresh.Enabled = true;
            button_Timer_Toggle.Text  = "Stop Tracking";
            listView1.Items.Clear();
            refresh();
        }
Exemplo n.º 2
0
        public bool Compareheaders(headerdata newheader, headerdata oldheader)
        {
            bool changeshappened = false;

            // Änderungen prüfen und ggf. flag setzen
            if (!newheader.sells.Equals(oldheader.sells))
            {
                addNotificationToQueue(Timestamp(), "Accountweit", "totalsells", oldheader.sells, newheader.sells, "Verkäufe: " + oldheader.sells + " -> " + newheader.sells);
                changeshappened = true;
            }
            if (!newheader.balance.Equals(oldheader.balance))

            {
                addNotificationToQueue(Timestamp(), "Accountweit", "balance", oldheader.balance, newheader.balance, "Kontostand: " + oldheader.balance + " -> " + newheader.balance);
                changeshappened = true;
            }

            if (!newheader.followers.Equals(oldheader.followers))
            {
                addNotificationToQueue(Timestamp(), "Accountweit", "followers", oldheader.followers, newheader.followers, "Follower:" + oldheader.followers + " -> " + newheader.followers);
                changeshappened = true;
            }

            if (!newheader.unreadmessages.Equals(oldheader.unreadmessages))
            {
                addNotificationToQueue(Timestamp(), "Accountweit", "unreadmessages", oldheader.unreadmessages, newheader.unreadmessages, "ungelesene Benachrichtigungen: " + oldheader.unreadmessages + " -> " + newheader.unreadmessages);
                changeshappened = true;
            }

            if (!newheader.comments.Equals(oldheader.comments))
            {
                addNotificationToQueue(Timestamp(), "Accountweit", "comments", oldheader.comments, newheader.comments, "Kommentare: " + oldheader.comments + " -> " + newheader.comments);
                changeshappened = true;
            }


            return(changeshappened);
        }
Exemplo n.º 3
0
        private void showdata(headerdata head, List <patterndata> patterns)
        {
            //populate DataGridView...
            DG1.Rows.Clear();
            foreach (patterndata pat in patterns)
            {
                DG1.Rows.Add(
                    pat.number,
                    pat.name,
                    pat.views,
                    pat.sells,
                    pat.wishlists,
                    pat.ratings,
                    pat.score);
            }

            //Display Accountwide data
            textBox_headerdata.Clear();
            textBox_headerdata.AppendText("Kontostand: " + head.balance + "\r\n");
            textBox_headerdata.AppendText("Follower: " + head.followers + "\r\n");
            textBox_headerdata.AppendText("Verkäufe: " + head.sells + "\r\n");
            textBox_headerdata.AppendText("Ungelesene Nachrichten: " + head.unreadmessages + "\r\n");
            textBox_headerdata.AppendText("Kommentare: " + head.comments);
        }
Exemplo n.º 4
0
 public accountdata(headerdata header, List <patterndata> patterns)
 {
     this.header   = header;
     this.patterns = patterns;
 }