public void CreateChildNode() { if (Child != null) { throw new Exception("Doh already has a child Doh. (Sekai.Doh.CreateChildNode)"); } Child = new Doh(); }
// ---------------- Constructors ---------------- ---------------- // public DohEdit() { ViewItem = new Doh(); InitializeComponent(); DataContext = this; AddSomeData(); }
public void InsertNode(bool GoesBeforeThis, Doh ToInsert) { if (GoesBeforeThis) { ToInsert.Parent = Parent; ToInsert.Child = this; ToInsert.Parent.Child = ToInsert; Parent = ToInsert; } else { ToInsert.Child = Child; ToInsert.Parent = this; ToInsert.Child.Parent = ToInsert; Child = ToInsert; } }
private void MenuItemLoad_Click(object sender, RoutedEventArgs e) { OpenFileDialog ofd = new OpenFileDialog { InitialDirectory = $"{Database.DPath}\\{ViewItem.ClassType}" }; if (ofd.ShowDialog() == true) { string[] FilePath = ofd.FileName.Split('\\'); string str = FilePath[FilePath.Length - 1]; if (str.Contains(".bin")) { str = str.Replace(".bin", string.Empty); str = str.Substring(3); } Doh newDoh = new Doh { Name = str }; new DohEdit(newDoh.DeserializeFile()).Show(); } }
public DohEdit(Doh DoneHundo) { ViewItem = DoneHundo; InitializeComponent(); DataContext = this; }