protected override void Action_Starting(Core.Dom.Action action) { var rec = new Fault.Action() { name = action.name, type = action.type, models = new List <Fault.Model>() }; foreach (var data in action.allData) { rec.models.Add(new Fault.Model() { name = data.dataModel.name, parameter = data.name ?? "", dataSet = data.selectedData != null ? data.selectedData.name : "", mutations = new List <Fault.Mutation>(), }); } if (rec.models.Count == 0) { rec.models = null; } states.Last().actions.Add(rec); }
private void RecordDataModel(Core.Dom.Action action) { foreach (var item in action.outputData) { GatherMutators(item.instanceName, item.dataModel); } }
private void MutateDataModel(Core.Dom.Action action) { // MutateDataModel should only be called after ParseDataModel System.Diagnostics.Debug.Assert(_iteration > 0); foreach (var item in action.outputData) { ApplyMutation(item); } }
private void RecordDataModel(Core.Dom.Action action) { // ParseDataModel should only be called during iteration 0 System.Diagnostics.Debug.Assert(_context.controlIteration && _context.controlRecordingIteration); foreach (var item in action.outputData) { var instanceName = item.instanceName; GatherMutators(instanceName, item.dataModel); } }
private void Action_Starting(Core.Dom.Action action) { // Is this a supported action? if (!(action.type == ActionType.Output || action.type == ActionType.SetProperty || action.type == ActionType.Call)) { return; } if (!_context.controlIteration) { MutateDataModel(action); } else if (_context.controlIteration && _context.controlRecordingIteration) { RecordDataModel(action); } }
private void Action_Starting(Core.Dom.Action action) { // Is this a supported action? if (!action.outputData.Any()) { return; } if (!_context.controlIteration) { MutateDataModel(action); } else if (_context.controlIteration && _context.controlRecordingIteration) { RecordDataModel(action); } }
private void RecordDataSet(Core.Dom.Action action) { foreach (var item in action.outputData) { var options = item.allData.ToList(); if (options.Count > 0) { // Don't use the instance name here, we only pick the data set // once per state, not each time the state is re-entered. var rec = new DataSetTracker(item.modelName, options); if (!_dataSets.Contains(item.modelName)) { _dataSets.Add(rec); } } } }
private void RecordDataModel(Core.Dom.Action action) { if (action.dataModel != null) { string modelName = GetDataModelName(action); GatherMutators(modelName, action.dataModel); } else if (action.parameters != null) { foreach (ActionParameter param in action.parameters) { if (param.dataModel != null) { string modelName = GetDataModelName(action, param); GatherMutators(modelName, param.dataModel); } } } }
private void RecordDataModel(Core.Dom.Action action) { // ParseDataModel should only be called during iteration 0 System.Diagnostics.Debug.Assert(_context.controlIteration && _context.controlRecordingIteration); if (action.dataModel != null) { string modelName = GetDataModelName(action); GatherMutators(modelName, action.dataModel as DataElementContainer); } else if (action.parameters != null && action.parameters.Count > 0) { foreach (ActionParameter param in action.parameters) { if (param.dataModel != null) { string modelName = GetDataModelName(action, param); GatherMutators(modelName, param.dataModel as DataElementContainer); } } } }
private void MutateDataModel(Core.Dom.Action action) { // MutateDataModel should only be called after ParseDataModel System.Diagnostics.Debug.Assert(_iteration > 0); if (action.dataModel != null) { string modelName = GetDataModelName(action); ApplyMutation(modelName, action.dataModel); } else if (action.parameters != null) { foreach (var param in action.parameters) { if (param.dataModel != null) { string modelName = GetDataModelName(action, param); ApplyMutation(modelName, param.dataModel); } } } }
private void RecordDataSet(Core.Dom.Action action) { if (action.dataSet != null) { DataSetTracker val = new DataSetTracker(); foreach (var item in action.dataSet.Datas) { switch (item.DataType) { case DataType.File: val.options.Add(item); break; case DataType.Files: val.options.AddRange(item.Files.Select(a => new Data() { DataType = DataType.File, FileName = a })); break; case DataType.Fields: val.options.Add(item); break; default: throw new PeachException("Unexpected DataType: " + item.DataType.ToString()); } } if (val.options.Count > 0) { // Need to properly support more than one action that are unnamed string key = GetDataModelName(action); System.Diagnostics.Debug.Assert(!_dataSets.ContainsKey(key)); _dataSets.Add(key, val); } } }
protected virtual void Action_Starting(Core.Dom.Action action) { }
protected virtual void Action_Finished(Core.Dom.Action action) { }