46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace BeWoPlanerMobil.Util
|
|
{
|
|
public class TextbausteinDisplayItem
|
|
{
|
|
public string Name { get; set; }
|
|
|
|
public long Oid { get; }
|
|
|
|
public long? ParentOid { get; set; }
|
|
|
|
public bool IsParent => Children.Any();
|
|
|
|
public string Text { get; set; }
|
|
|
|
public List<TextbausteinDisplayItem> Children { get; set; } = new List<TextbausteinDisplayItem>();
|
|
|
|
public bool IsExpanded { get; set; }
|
|
|
|
public TextbausteinDisplayItem(string name, string text, long? parentOid, long oid, bool isExpanded)
|
|
{
|
|
Name = name;
|
|
Text = text;
|
|
Oid = oid;
|
|
IsExpanded = isExpanded;
|
|
ParentOid = parentOid;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"{Name}; Text: {Text}";
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
if(obj is TextbausteinDisplayItem y)
|
|
{
|
|
return Oid.Equals(y.Oid);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
} |