97 lines
1.8 KiB
C#
97 lines
1.8 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using BS.Shared.DataContracts.Feature.AI;
|
|
|
|
namespace BeWo.ViewModel.ListViewModel
|
|
{
|
|
public class AiPromptbausteinTreeListVM : AbstractDCListMapperVM<AiPromptbausteinTreeDC, AiPromptbausteinTreeVM>
|
|
{
|
|
public AiPromptbausteinTreeListVM() : this(null)
|
|
{
|
|
if (BeWoApp.IsInDesignMode)
|
|
{
|
|
InitDesigner();
|
|
}
|
|
}
|
|
|
|
public AiPromptbausteinTreeListVM(IEnumerable<AiPromptbausteinTreeDC> pDataContracts = null, AiPromptbausteinTreeVM aiPromptbausteinTreeVM = null) : base(pDataContracts)
|
|
{
|
|
foreach (var vm in VMList)
|
|
{
|
|
vm.Parent = aiPromptbausteinTreeVM;
|
|
}
|
|
}
|
|
|
|
//public override int AddedCount
|
|
//{
|
|
// get
|
|
// {
|
|
// var base_value = base.AddedCount;
|
|
|
|
// foreach (var vm in VMList)
|
|
// {
|
|
// if (vm.Children is object)
|
|
// base_value += vm.Children.AddedCount;
|
|
// }
|
|
|
|
// return base_value;
|
|
// }
|
|
//}
|
|
|
|
//public override int ChangedCount
|
|
//{
|
|
// get
|
|
// {
|
|
// var base_value = base.ChangedCount;
|
|
|
|
// foreach (var vm in VMList)
|
|
// {
|
|
// if (vm.Children is object)
|
|
// base_value += vm.Children.ChangedCount;
|
|
// }
|
|
|
|
// return base_value;
|
|
// }
|
|
//}
|
|
|
|
//public override int RemovedCount
|
|
//{
|
|
// get
|
|
// {
|
|
// var base_value = base.RemovedCount;
|
|
|
|
// foreach (var vm in VMList)
|
|
// {
|
|
// if(vm.Children is object)
|
|
// base_value += vm.Children.RemovedCount;
|
|
// }
|
|
|
|
// return base_value;
|
|
// }
|
|
//}
|
|
|
|
public bool ContainsDirtyNode()
|
|
{
|
|
if (IsDirty)
|
|
return true;
|
|
|
|
foreach (var vm in VMList)
|
|
{
|
|
if (vm.Children is object && vm.Children.ContainsDirtyNode())
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
#region Designer
|
|
private void InitDesigner()
|
|
{
|
|
var prompts = new PredefinedAiPromptbausteine();
|
|
|
|
VMList.Add(new AiPromptbausteinTreeVM(prompts.Zeiterfassung));
|
|
}
|
|
#endregion
|
|
}
|
|
}
|