예제 #1
0
 public void showMessage(MaskInfo maskInfo)
 {
     if (maskInfo == null)
     {
         notifyHandler.ShowBalloonTip(10000, "마스크 알림 시작", "웰킵스 모니터링중", ToolTipIcon.Info);
         return;
     }
     if (ballonClickHandler != null)
     {
         notifyHandler.BalloonTipClicked -= ballonClickHandler;
     }
     ballonClickHandler = onMessageClicked;
     notifyHandler.BalloonTipClicked += ballonClickHandler;
     lastMaskInfo = maskInfo;
     notifyHandler.ShowBalloonTip(10000, "마스크 알림", maskInfo.TITLE, ToolTipIcon.Info);
 }
예제 #2
0
        private void MonitorMask_WELL1() // URL :
        {
            showMessage(null);
            while (true)
            {
                if (MANAGER_OFF)
                {
                    break;
                }
                string   html     = GetRequest("http://www.welkeepsmall.com/shop/shopbrand.html?type=X&xcode=023");
                Document doc      = NSoupClient.Parse(html);
                Elements elements = doc.Select(".box");

                foreach (var element in elements)
                {
                    Element detailInfo = element.Select(".info").First;
                    var     soldout    = detailInfo.Select(".soldout");
                    if (soldout == null || soldout.IsEmpty)
                    {
                        MaskInfo maskInfo = new MaskInfo();
                        maskInfo.URL   = "http://www.welkeepsmall.com" + element.Select("a").Attr("href");
                        maskInfo.TITLE = detailInfo.Select(".dsc").Text;
                        showMessage(maskInfo);
                        continue;
                    }
                    if (!soldout.Text.Contains("OUT"))
                    {
                        MaskInfo maskInfo = new MaskInfo();
                        maskInfo.URL   = "http://www.welkeepsmall.com" + element.Select("a").Attr("href");
                        maskInfo.TITLE = detailInfo.Select(".dsc").Text;
                        showMessage(maskInfo);
                    }
                }

                Thread.Sleep(2000);
            }
        }