JD2022-TU1/main/tools/framework/JD.Application.TeaBox/View/Actions/SaveActionHandler.cs

25 lines
804 B
C#

using JD.Collections.Extensions;
using TeaBox;
using TeaBox.Actions;
using TeaBox.Bootstrap;
using TeaBox.ObjectModel;
namespace JD.Application.View.Actions
{
class SaveActionHandler : DefaultSaveActionHandler
{
public override void Execute(ActionExecutionContext context)
{
ForceCommitPropertyGrid();
var documentView = global::TeaBox.ObjectModel.Application.Main.Views.SelectedItem as IDocumentView;
if (documentView != null)
{
if (CheckoutActionHandler.MakeWritableSelectedDocument())
{
documentView.Documents.ForEach(document => global::TeaBox.ObjectModel.Application.Main.Documents.Save(document, SaveContext.Default));
}
}
}
}
}