public PrimaryClueInfo(string name, bool primary, PrimaryClueInfo parent) { _Name = name; _Parent = parent; if (primary) { _Clues = new ObservableCollection <PrimaryClueInfo>(); } else { _Clues = null; } _IsSelected = false; _IsExpanded = false; }
public ObservableCollection <PrimaryClueInfo> GetPrimaryClueInfo() { ObservableCollection <PrimaryClueInfo> primaryClues = new ObservableCollection <PrimaryClueInfo>(); foreach (string primaryFragment in ClueTree.Keys) { PrimaryClueInfo newPrimaryClue = new PrimaryClueInfo(primaryFragment, true, null); primaryClues.Add(newPrimaryClue); foreach (string clue in ClueTree[primaryFragment].GetAllClues()) { if (clue != primaryFragment) // GetAllClues() can return just self if that's all it has (i.e. the fragment has no branches, i.e. the primary fragments themselves) { newPrimaryClue.Clues.Add(new PrimaryClueInfo(clue, false, newPrimaryClue)); } } } return(primaryClues); }