Exemple #1
0
        public void AnonymousVSLambda()
        {
            //5.1.5 匿名方法和Lambda表达式
            JustDo += delegate(object sender, EventArgs e)
            {
                Console.WriteLine("您好,我的读者,希望您能喜欢本书!");
            };
            JustDo += (x, y) => Console.WriteLine("....");

            //不使用花括号时,默认会将方法体的执行结果作为返回值;而使用了花括号,尽管
            //方法体的语句只有一条,仍然需要使用return明确地返回执行结果
            Predicate <int> pre  = x => x == 3;
            Predicate <int> pre2 = x => { return(x == 3); };
        }
Exemple #2
0
    private void AnalysisXML(string postxml)
    {
        string signature = this.Page.Request.QueryString["signature"].ToString();
        string timestamp = this.Page.Request.QueryString["timestamp"].ToString();
        string nonce     = this.Page.Request.QueryString["nonce"].ToString();
        //string check = CheckSignature(false);
        bool       bCheck = ulwxMsgXML.CheckSignature(signature, timestamp, nonce, FsToken);
        string     xml    = "";
        ulwxMsgXML wxMsg  = new ulwxMsgXML(postxml);

        if (!bCheck)
        {
            xml = wxMsg.GetFormatText("非法请求");
        }
        else
        {
            string msg = "未定义回复内容";
            switch (wxMsg.MsgType)
            {
            case "event":
            {
                xml = Doit.DoEvent(wxMsg.Event, wxMsg.EventKey, wxMsg.UserID);
                break;
            }

            case "text":
            {
                xml = Doit.DoText(wxMsg.Content, wxMsg.UserID);
                break;
            }

            default:
            {
                xml = msg;
                break;
            }
            }
            xml = wxMsg.GetFormatText(xml);
        }
        Response.Write(xml);
    }
 public Task UpdateAsync(Doit dbOwner, Doit owner)
 {
     throw new NotImplementedException();
 }
 public Task DeleteAsync(Doit owner)
 {
     throw new NotImplementedException();
 }