void gridControl1_CellClick(FlowChart flowChart, PK.Grid.Def.ColumnDef <FlowChart> column) { if (column.HeaderText == "Undo") { blnRestoring = true; nPanel1.SetFlatModeJSON(JSONUtil.Serialize(flowChart)); blnRestoring = false; } }
internal String GetFlatModelJSON() { FlowChart chart = new FlowChart { FlatModels = new List <FlatModel>() }; NComponents.ForEach(x => { chart.FlatModels.Add(x.GetFlatModel()); }); return(JSONUtil.Serialize <FlowChart>(chart)); }
/// <summary> /// 监听Http请求 /// </summary> private void httpRequestHandle() { while (true) { HttpListenerContext context = httpListener.GetContext(); Thread threadsub = new Thread(new ParameterizedThreadStart((requestContext) => { HttpListenerContext httpListenerContext = (HttpListenerContext)requestContext; string message = getHttpParameters(httpListenerContext.Request); if (pramaterLoggerPrint) { LoggerHelper.WriteLog("入参:" + message); } OutputDTO outputDTO = new OutputDTO(); //调用业务处理类处理业务请求 RequestHandler requesthandler = new RequestHandler(); try { outputDTO = requesthandler.BusinessHandler(message); } catch (Exception e) { outputDTO = new OutputDTO(); outputDTO.code = PublicValue.ResultCode.Erroe; outputDTO.msg = "【调取插件异常】"; LoggerHelper.WriteLog("调取插件异常", e); } //返回调用结果 string rtnMsg = JSONUtil.Serialize <OutputDTO>(outputDTO); if (pramaterLoggerPrint) { LoggerHelper.WriteLog("出参:" + rtnMsg); } outputStreamToClient(httpListenerContext, rtnMsg); })); threadsub.Start(context); } }