private void Run_Click(object sender, EventArgs e)
        {
            if ((_sendData.ApiKey == null) || (_sendData.RegistrationId == null) ||
                (_sendData.ApiKey.Length == 0) || (_sendData.RegistrationId.Length == 0))
            {
                MessageBox.Show("Please set API Secret Key and Device RegID before starting.");
                return;
            }

            MessageBox.Show("Started Running");

            OutlookRead oRead = new OutlookRead();
            string      data  = oRead.ReadOutlookData();

            bool response = _sendData.Send(data);

            if (!response)
            {
                restoreToolStripMenuItem.PerformClick();
            }
            else
            {
                _lastcachedString = data;
                DataSentTimes++;
            }

            StatusText.Visible = true;
            StatusText.Text    = "Data sent to GCM  :  " + DataSentTimes.ToString() + "  times";

            timerSend.Interval = interval * 60 * 60 * 1000;    //Interval should be in milliseconds (hours to milli conversion)
            timerSend.Enabled  = true;
            timerSend.Start();
        }
Пример #2
0
        //Timer Functions

        void timerSend_Tick(object sender, EventArgs e)
        {
            OutlookRead oRead = new OutlookRead();
            string      data  = oRead.ReadOutlookData();

            if (_lastcachedString != data)
            {
                string response = _sendData.Send(data);
                _lastcachedString = data;
            }
        }
Пример #3
0
        //Timer Functions

        void timerSend_Tick(object sender, EventArgs e)
        {
            OutlookRead oRead = new OutlookRead();
            string      data  = oRead.ReadOutlookData();

            if (_lastcachedString != data)
            {
                string response = _sendData.Send(data);
                _lastcachedString = data;

                DataSentTimes++;
                StatusText.Visible = true;
                StatusText.Text    = "Data sent to GCM  :  " + DataSentTimes.ToString() + "  times";
            }
        }
Пример #4
0
        private void Run_Click(object sender, EventArgs e)
        {
            if ((_sendData.ApiKey == null) || (_sendData.RegistrationId == null) ||
                (_sendData.ApiKey.Length == 0) || (_sendData.RegistrationId.Length == 0))
            {
                MessageBox.Show("Please set API Secret Key and Device RegID before starting.");
                return;
            }

            MessageBox.Show("Started Running");

            OutlookRead oRead = new OutlookRead();
            string      data  = oRead.ReadOutlookData();

            string response = _sendData.Send(data);

            _lastcachedString = data;

            timerSend.Interval = interval * 1000;
            timerSend.Enabled  = true;
        }