43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
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();
|
|
}
|
|
}
|
|
}
|