Files
BeWoPlaner/BeWo/Core/SupportConceptGoalTreeItem.cs

103 lines
3.2 KiB
C#
Raw Normal View History

using BeWo.ViewModel;
2016-06-27 01:45:38 +02:00
using BS.Shared;
using BS.Shared.DataContracts.ClientPartials;
using System.ComponentModel;
using System.Diagnostics;
2016-06-27 01:45:38 +02:00
namespace BeWo.Core
{
#pragma warning disable CS0108 // Rethrow to preserve stack details
[DebuggerDisplay("{GoalEntryVM.Abbreviation}: {GoalEntryVM.Description}")]
2016-06-27 01:45:38 +02:00
public class SupportConceptGoalTreeItem : SupportConceptGoalDC
{
private ValueListEntryVM _GoalEntryVM;
private BindingList<SupportConceptGoalTreeItem> _Children;
private bool _ShowNotice;
2016-06-27 01:45:38 +02:00
public SupportConceptGoalTreeItem() { }
2016-06-27 01:45:38 +02:00
public ValueListEntryVM GoalEntryVM
{
get => _GoalEntryVM;
set => _GoalEntryVM = value;
2016-06-27 01:45:38 +02:00
}
//CB Das ist doch genau falsch herum?
public bool IsGoal => GoalEntryVM != null ?
GoalEntryVM.Type.Equals(ValueListEntryType.SupportConceptGoalType) || GoalEntryVM.Type.Equals(ValueListEntryType.SupportConceptIndividualGoalType) :
GoalEntryDC.Type.Equals(ValueListEntryType.SupportConceptGoalType) || GoalEntryDC.Type.Equals(ValueListEntryType.SupportConceptIndividualGoalType);
2016-06-27 01:45:38 +02:00
2020-11-10 02:25:15 +01:00
public bool IsZiel
{
get
{
return IsOfType(ValueListEntryType.SupportConceptGoalCategoryType);
}
}
public bool IsIndZiel
{
get
{
return IsOfType(ValueListEntryType.SupportConceptIndividualGoalCategoryType);
}
}
public bool IsMassnahme
{
get
{
2020-11-10 02:25:15 +01:00
return IsOfType(ValueListEntryType.SupportConceptGoalType);
}
2020-11-10 02:25:15 +01:00
}
public bool IsIndMassnahme
{
get
{
return IsOfType(ValueListEntryType.SupportConceptIndividualGoalType);
}
}
2020-11-10 02:25:15 +01:00
public bool IsOfType(ValueListEntryType t)
{
2020-11-10 02:25:15 +01:00
if (GoalEntryVM != null)
{
return GoalEntryVM.Type == t;
}
else if (GoalEntryDC != null)
{
return GoalEntryDC.Type == t;
}
2020-11-10 02:25:15 +01:00
return false;
}
//public bool IsGoal => GoalEntryVM != null ?
// GoalEntryVM.Type.Equals(ValueListEntryType.SupportConceptGoalType) || GoalEntryVM.Type.Equals(ValueListEntryType.SupportConceptIndividualGoalType) :
// GoalEntryDC.Type.Equals(ValueListEntryType.SupportConceptGoalType) || GoalEntryDC.Type.Equals(ValueListEntryType.SupportConceptIndividualGoalType);
public bool ShowNotice
2016-06-27 01:45:38 +02:00
{
get => _ShowNotice;
2016-06-27 01:45:38 +02:00
set
{
_ShowNotice = value;
RaisePropertyChanged(nameof(ShowNotice));
2016-06-27 01:45:38 +02:00
}
}
public bool IsHidden { get; set; }
public BindingList<SupportConceptGoalTreeItem> Items
2016-06-27 01:45:38 +02:00
{
get => _Children ?? (_Children = new BindingList<SupportConceptGoalTreeItem>());
set => _Children = value;
2016-06-27 01:45:38 +02:00
}
public ValueListEntryType GoalType => GoalEntryDC?.Type ?? GoalEntryVM.Type;
}
#pragma warning restore CS0108 // Rethrow to preserve stack details
2016-06-27 01:45:38 +02:00
}