public TagItemModel(TagItem tag) { TagName = tag.GetName(); Header = TagName; FullPath = tag.GetFullPath(); Level = tag.GetLevel(); TagParent = tag.GetParent(); TagType = tag.GetTypeOfValue(); switch (TagType) { case "Bool": Value = tag.GetValue().ToString(); Tag = "Images/Bool.png"; break; case "Int": Value = tag.GetValue().ToString(); Tag = "Images/Integer.png"; break; case "Double": Value = tag.GetValue().ToString(); Tag = "Images/Double.png"; break; case "None": Value = ""; Tag = "Images/None.png"; break; } if (!tag.HaveChilds()) { return; } foreach (var item in tag.GetChilds()) { Items.Add(item.Transform()); } }
public static void DeleteTag(TagItem tagForDelete) { var parent = tagForDelete?.GetParent(); parent?.DeleteChild(tagForDelete); }