public void RemoveChild(IChildTalkerTile _child) { if (_child != null) { _child.Parent = null; _ = Children.Remove(_child); _ = XmlChildren.Remove(_child.Xml); } }
public void AddChild(IChildTalkerTile _child) { if (_child != null) { _child.Parent = this; Children.Add(_child); if (_child.Xml != null) { XmlChildren.Add(_child.Xml); } } }
public void AddSingleItem(IChildTalkerTile ctTileToAdd) { if (ViewParents.Count > 0) { ViewParents.Peek().AddChild(ctTileToAdd); } else { _rootChildren.Add(ctTileToAdd); _xmlWrapper.Children.Add(ctTileToAdd.Xml); } PhraseButton ui = new PhraseButton(); ui.SetItem(ctTileToAdd); ui.SetParent(this); _ = items.Children.Add(ui); SaveToXml(_profilePath); }
public Phrases() { InitializeComponent(); if (!Directory.Exists(App.StartupPath + "/Properties")) { _ = Directory.CreateDirectory(App.StartupPath + "/Properties"); } if (!File.Exists(_profilePath)) { File.Copy(App.StartupPath + "/Properties/BlankPhraseLayout.xml", _profilePath); } this.LoadFromXml(_profilePath); _backItem = new ChildTalkerBackButton("Back", App.StartupPath + "/Resources/back.png", this, false); Scan.GoBackHold += GoBackHold_DeleteItem; _deletionTimer.Elapsed += DeletionTimerElapsed; }