Beispiel #1
0
        // 放弃编辑
        void cancel_button_Click(object sender, EventArgs e)
        {
            this.EditAction = "";
            this.ClearEdit();

            if (this.WantFocus != null)
            {
                WantFocusEventArgs e1 = new WantFocusEventArgs();
                e1.Focus = false;   // 不再独占Focus
                this.WantFocus(this, e1);
            }

            if (this.Submited != null)
            {
                SubmitedEventArgs e1 = new SubmitedEventArgs();
                e1.Action = "cancel";  // cancel
                this.Submited(this, e1);
            }
        }
Beispiel #2
0
 void editor_Submited(object sender, SubmitedEventArgs e)
 {
     if (this.MinimizeNewReviewEdtior == true)
     {
         // 创建操作完成后,还是把editor最小化
         if (e.Action == "new")
         {
             CommentControl commentcontrol = (CommentControl)sender;
             commentcontrol.Minimized = "true";
         }
     }
 }
Beispiel #3
0
        // TODO: 最好 redirect 到当前URL。但要注意跳转到接近的link
        void submit_button_Click(object sender, EventArgs e)
        {
            string strError = "";
            string strWarning = "";

            int nRet = DoSubmit(
            out strWarning,
            out strError);
            if (nRet == -1)
                goto ERROR1;

            string strAction = this.EditAction;
            if (String.IsNullOrEmpty(strAction) == true)
                strAction = "change";

            this.EditAction = "";

            if (this.WantFocus != null)
            {
                WantFocusEventArgs e1 = new WantFocusEventArgs();
                e1.Focus = false;   // 不再独占Focus
                this.WantFocus(this, e1);
            }

            if (this.Submited != null)
            {
                SubmitedEventArgs e1 = new SubmitedEventArgs();
                e1.Action = strAction;  // new / change
                this.Submited(this, e1);
            }

            if (String.IsNullOrEmpty(strWarning) == false)
                this.SetDebugInfo("warninginfo", strWarning);
            else
            {
                this.Page.Response.Redirect("./book.aspx?commentrecpath=" + HttpUtility.UrlEncode(this.RecPath) + "#active", true);
            }
            return;
        ERROR1:
            this.SetDebugInfo("errorinfo", strError);
        }