chr
2026-04-05 fe750b791d5b517cc4e9bc8e99a9a75139a0cfba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Xml.Serialization;
 
namespace OpenTap.Plugins.BasicSteps
{
    
    /// <summary> An element representing a row in a sweep loop. This has a bunch of dynamically added elements.</summary>
    public class SweepRow
    {
        /// <summary> Gets or sets if the row is enabled.</summary>
        [Display("Enabled", "Marks if this row should be included during the sweep.")]
        public bool Enabled { get; set; } = true;
        
        /// <summary> The sweep step owning this row. This is needed to figure out which properties the object has. </summary>
        [Browsable(false), XmlIgnore]
        public SweepParameterStep Loop { get; set; }
        
        /// <summary> Dictionary for storing dynamic property values. </summary>
        public Dictionary<string, object> Values = new Dictionary<string, object>();
 
        internal string GetIterationString() => string
            .Join(", ", 
                Values.OrderBy(x => x.Key).Select(x => $"{x.Key} = {x.Value}"));
 
        /// <summary> Create a sweep row instance. </summary>
        public SweepRow()
        {
            
        }
        
        /// <summary> Create a sweep row instance with a step. </summary>
        public SweepRow(SweepParameterStep loop)
        {
            this.Loop = loop;
        }
    }
}