Files
wg_cpso/CPSO/Commands/0081_Step/CReplaceStep.cs

43 lines
1.3 KiB
C#
Raw Permalink Normal View History

2026-03-25 18:20:24 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CPSO;
using CaeModel;
using CaeMesh;
using CaeGlobals;
namespace CPSO.Commands
{
[Serializable]
class CReplaceStep : PreprocessCommand
{
// Variables
private string _oldStepName;
private Step _newStep;
// Constructor
public CReplaceStep(string oldStepName, Step newStep)
: base("Edit step")
{
_oldStepName = oldStepName;
_newStep = newStep.DeepClone();
}
// Methods
public override bool Execute(Controller receiver)
{
receiver.ReplaceStep(_oldStepName, _newStep.DeepClone());
return true;
}
public override string GetCommandString()
{
return base.GetCommandString() + _oldStepName + ", " + _newStep.ToString();
}
}
}