コード例 #1
0
ファイル: ruleItemEmail.cs プロジェクト: randomdude/Lavalamp
        public override void evaluate()
        {
            bool thisState = pinInfo["checkNow"].value.asBoolean();

            if ((lastState != thisState) && (thisState == true))
            {
                imapChecker mychecker = new imapChecker(options);
                if (mychecker.newMail != pinInfo["newEmail"].value.asBoolean())
                {
                    onRequestNewTimelineEvent(new timelineEventArgs(new pinDataTrigger(mychecker.newMail, this, pinInfo["newEmail"])));
                    onRequestNewTimelineEvent(new timelineEventArgs(new pinDataString(mychecker.mailSubject,this,pinInfo["newEmailTitle"])));
                }
            }
            lastState = thisState;
        }
コード例 #2
0
        private void btnTest_Click(object sender, EventArgs e)
        {
            if (!this.validateControls())
                return;

            try
            {
                imapChecker myChecker = new imapChecker(this.options);
                if (myChecker.newMail)
                    MessageBox.Show("Able to connect to mail server OK (detected new mail).");
                else
                    MessageBox.Show("Able to connect to mail server OK (detected no new mail).");
                this.hasBeenTested = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable to connect to mail server! The problem reported was '" + ex.Message + "'.");
                this.hasBeenTested = false;
            }
        }