async Task ExecuteLoadItemsCommand() { if (IsBusy) { return; } IsBusy = true; try { FeedBacks.Clear(); var feedBacks = await FeedBackStore.GetListAsync(); foreach (var feedBack in feedBacks) { FeedBacks.Add(feedBack); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
void Apply(SavedDraftLessonEvent @event) { Title = @event.Title; Discipline = @event.Discipline; School = @event.School; Classroom = @event.Classroom; AuthorId = @event.AuthorId; Content = @event.Content; Conclusion = @event.Conclusion; LastModifDate = @event.ModificationDate; //FeedBacks.Concat(@event.FeedBacks[EntityState.New]); // Update FeedBacks Collection if (@event.FeedBacks.ContainsKey(EntityStatus.A)) { @event.FeedBacks[EntityStatus.A].ToList() .ForEach(feedback => FeedBacks.Add(feedback)); } if (@event.FeedBacks.ContainsKey(EntityStatus.M)) { @event.FeedBacks[EntityStatus.M].ToList() .ForEach(feedback => { var item = FeedBacks.Single(f => f.Id.Equals(feedback.Id)); item.Feedback = feedback.Feedback; }); } if (@event.FeedBacks.ContainsKey(EntityStatus.C)) { @event.FeedBacks[EntityStatus.C].ToList() .ForEach(feedback => { var item = FeedBacks.Single(f => f.Id.Equals(feedback.Id)); FeedBacks.Remove(item); }); } // Update Tags Collection if (@event.Tags.ContainsKey(EntityStatus.A)) { @event.Tags[EntityStatus.A].ToList() .ForEach(tag => Tags.Add(tag)); } if (@event.Tags.ContainsKey(EntityStatus.C)) { @event.Tags[EntityStatus.C].ToList() .ForEach(tag => { var item = Tags.Single(f => f.LessonTagName.Equals(tag.LessonTagName)); Tags.Remove(item); }); } RecordState = Constants.RECORD_STATE_ACTIVE; }
public override void Execute() { try { var initValue1 = ActionInParameterManager["ActionParameter1"]; var value1 = initValue1.GetValue(); var initValue2 = ActionInParameterManager["ActionParameter2"]; var value2 = initValue2.GetValue(); var calculateType = BasicValueCalculateD2.GetCalculateType(ActionInParameterManager["CalculateType"].GetValueInString()); var value3 = BasicValueCalculateD2.Calculate(calculateType, value1, value2); FeedBacks.Add(new Message { Description = $"参数Value1:[{value1}],Value2:[{value2}],Value3:[{value3}]" }); ActionOutParameterManager["ResultParameter"].SetValue(value3); } catch (Exception ex) { Log.Error($"执行TwoParameterCalculateAction 出错{ex}"); } }