Beispiel #1
0
        public static void AccountSetOnlineStart()
        {
            if (_setOnlineThread.IsAlive)
            {
                return;
            }
            _setOnlineThread = new Thread(delegate()
            {
                do
                {
                    try
                    {
                        var accessToken         = SiteData.VK.GetAccessToken();
                        DataStorage.DialogsList = SiteUtils.GetDialogs(accessToken);
                        //SiteUtils.AccountSetOnline(accessToken);
                        Thread.Sleep(300000);
                    }
                    catch (Exception ex)
                    {
                        ex.Error();
                    }
                } while (!SetOnlineThreadStop);
                SetOnlineThreadStop = false;
                _setOnlineThread.Abort();
            })
            {
                IsBackground = true
            };

            _setOnlineThread.Start();
        }