private void PipeCallFunction_OnCallFeedback(PipeCallFunctionFeedbackStruct fb) { if (fb.ID == callID) { var result = new ActionResultModel(); result.ID = actionID; result.Result = new Dictionary <int, object>(); result.Result.Add((int)DialogResultType.ClickButtonValue, fb.FeedbackData.ToString()); //返回数据 ActionTaskResulter.Add(taskID, result); OnEventStateChanged?.Invoke(taskID, actionID, ActionInvokeStateType.Done); } }
private void CallDialog(PipeCallFunctionStruct call) { var data = ObjectConvert.Get <DialogActionParamsModel>(call.Data); Application.Current.Dispatcher.Invoke(() => { var dialog = new DialogWindow(data.Title, data.Content, data.Image, data.Buttons); dialog.OnWindowClosedEvent += (sender, value) => { var feedback = new PipeCallFunctionFeedbackStruct(); feedback.ID = call.ID; feedback.CallFunctionType = call.CallFunctionType; feedback.FeedbackData = value; pipeNet.Send(JsonConvert.SerializeObject(feedback)); }; dialog.Show(); }); }