Files
wg_cpso/CPSO/Commands/0062_Section/CReplaceSection.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 CReplaceSection : PreprocessCommand
{
// Variables
private string _oldSectionName;
private Section _newSection;
// Constructor
public CReplaceSection(string oldSectionName, Section newSection)
: base("Edit section")
{
_oldSectionName = oldSectionName;
_newSection = newSection.DeepClone();
}
// Methods
public override bool Execute(Controller receiver)
{
receiver.ReplaceSection(_oldSectionName, _newSection.DeepClone());
return true;
}
public override string GetCommandString()
{
return base.GetCommandString() + _oldSectionName + ", " + _newSection.ToString();
}
}
}