コード例 #1
0
        private async void next()
        {
            if (_groupList.Count <= 0 && _productList.Count <= 0)
            {
                return;
            }

            await Task.Delay(5000);

            PostProValue++;

            if (_productList.Count > 0)
            {
                var itemd    = _productList.Dequeue();
                var firstpro = itemd.ProductUrl;

                var urls = firstpro.TrimEnd('/').Split('/');
                var rid  = urls[urls.Length - 1];
                currentPid      = itemd.Id;
                itemd.ProValue  = 10;
                CurrentPostInfo = string.Format("当前推送小组为:{0},商品为:{1}", currentGroupItem.Name, itemd.ProductName);
                var postView = WebEnginner.CreateInstance("postReqg");

                postView.NavigationStarting -= postView_OnNavigationStarting;
                postView.LoadCompleted      -= postView_OnLoadCompleted;

                postView.NavigationStarting += postView_OnNavigationStarting;
                postView.LoadCompleted      += postView_OnLoadCompleted;
                postView.Navigate(new Uri(string.Format("https://m.facebook.com/sharer.php?m=group&group_target=0&u&id&ids&sid={0}&usedialogwithselector=1&_rdr", rid)));
            }
            else
            {
                currentGroupItem = _groupList.Dequeue();

                ProductEntities.ToList().ForEach(item => _productList.Enqueue(item));

                var itemd    = _productList.Dequeue();
                var firstpro = itemd.ProductUrl;

                var urls = firstpro.TrimEnd('/').Split('/');
                var rid  = urls[urls.Length - 1];
                currentPid      = itemd.Id;
                itemd.ProValue  = 10;
                CurrentPostInfo = string.Format("当前推送小组为:{0},商品为:{1}", currentGroupItem.Name, itemd.ProductName);
                var postView = WebEnginner.CreateInstance("postReqg");

                postView.NavigationStarting -= postView_OnNavigationStarting;
                postView.LoadCompleted      -= postView_OnLoadCompleted;

                postView.NavigationStarting += postView_OnNavigationStarting;
                postView.LoadCompleted      += postView_OnLoadCompleted;
                postView.Navigate(new Uri(string.Format("https://m.facebook.com/sharer.php?m=group&group_target=0&u&id&ids&sid={0}&usedialogwithselector=1&_rdr", rid)));
            }
        }