| | |
| | | using CommunityToolkit.Mvvm.ComponentModel; |
| | | using NationalInstruments.TestStand.Interop.API; |
| | | using System.Collections.ObjectModel; |
| | | using System.Runtime.InteropServices; |
| | | |
| | | namespace Plugin.SeqEditor.Entity |
| | | { |
| | | public partial class StepUI : ObservableObject |
| | | { |
| | | public Step step { get; private set; } |
| | | |
| | | public StepUI(Step step) |
| | | ~StepUI() |
| | | { |
| | | if (step != null) |
| | | { |
| | | Marshal.ReleaseComObject(step); |
| | | } |
| | | } |
| | | |
| | | public Step step { get; private set; } |
| | | public Sequence sequence { get; private set; } |
| | | |
| | | public event EventHandler<string> SettingChanged; |
| | | |
| | | public int IndexInSequence { |
| | | get { |
| | | return sequence.GetStepIndex(Name, StepGroup); |
| | | } |
| | | } |
| | | |
| | | public StepUI(Step step, Sequence sequence) |
| | | { |
| | | this.step = step; |
| | | this.sequence = sequence; |
| | | } |
| | | |
| | | public void UpdatePropertyChanged(string name) |
| | | { |
| | | OnPropertyChanged(name); |
| | | } |
| | | |
| | | protected new void OnPropertyChanged(string name) |
| | | { |
| | | base.OnPropertyChanged(name); |
| | | SettingChanged?.Invoke(this, name); |
| | | } |
| | | |
| | | public string Name |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public StepGroups? StepGroup |
| | | public StepGroups StepGroup |
| | | { |
| | | get |
| | | { |
| | | return step?.StepGroup; |
| | | return step.StepGroup; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | [ObservableProperty] |
| | | public ObservableCollection<StepUI> children = new(); |
| | | |
| | | public override string ToString() |
| | | { |
| | | return Name; |
| | | } |
| | | } |
| | | } |