protected virtual void OnValidateEnd(ValidateEndEventArgs e) { if (ValidateEndEvent != null) { ValidateEndEvent(this, e); } }
void endValidate(object sender, ValidateEndEventArgs e) { Debug.WriteLine("ValidateEnd"); SetpbTaskStyle(ProgressBarStyle.Continuous); SetpbTaskMarquee(0); if (e.isError) { MessageBox.Show(MsgERR.ERR_RUN + "\n" + Msg.DEF_RESTART); } }
private void startValidation(Boolean isGetJson) { Uri destURI = new Uri(strDestURL); Debug.WriteLine("enter patch method"); JObject sendJson = FileHashFilter.getJson(strDestPath); sendJson.Add(new JProperty("_patch_ver", strDestVer)); sendJson.Add(new JProperty("_patch_method", "PATCH")); sendJson.Add(new JProperty("_patch_error", isFileError)); string jsonData = new JObject(sendJson).ToString(); Debug.WriteLine("sending json : " + jsonData); byte[] jsonByte = Encoding.Default.GetBytes(jsonData); Dictionary <string, string> postData = new Dictionary <string, string>(); if (isGetJson) { postData.Add("Method", "JSON"); } else { postData.Add("Method", "UPDATE"); } st = new StreamModule(); st.setEncoding(Encoding.UTF8); webRequest = HttpWebRequest.Create(destURI) as HttpWebRequest; webRequest.CookieContainer = cookieContainer; webResponse = st.sendData(webRequest, jsonData, postData, Encoding.UTF8); ValidateEndEventArgs vEe = new ValidateEndEventArgs(false, ""); OnValidateEnd(vEe); if (st.result().Equals(StreamModule.FILE)) { if (!isFilePatched) { isFilePatched = true; patchDownload(); } else { if (webResponse != null) { webResponse.Close(); } StringBuilder sbError = new StringBuilder(); sbError.AppendLine(MsgERR.ERR_COMPLETE); sbError.AppendLine(MsgERR.ERR_RETASK); WorkCompletedEventArgs wCe = new WorkCompletedEventArgs(false, sbError.ToString());//(PatchManager.JSON_COMPLETE, ""); OnWorkCompleted(wCe); } } else if (st.result().Equals(StreamModule.JSON)) { st.receiveData(webResponse); measureResponseData(); } }