public void AddChild <T>(string prefix, T element) where T : IPersistence { using (Persistence.Lookup.Pusher pusher = new Persistence.Lookup.Pusher(this, prefix)) { Add("ClassName", element.GetType()); element.Export(this); } }
public T GetChild <T>(string prefix) where T : class, IPersistence { using (Persistence.Lookup.Pusher pusher = new Persistence.Lookup.Pusher(this, prefix)) { T element = GetObject <T>("ClassName"); if (element == null) { return(null); } using (Persistence.Lookup.WasFoundTest found = new Persistence.Lookup.WasFoundTest(this)) { element.Import(this); if (!WasFound) { return(null); } } return(element); } }