public void Load(IReaderWriter readerWriter, string path) { XmlSerializer serializer = new XmlSerializer(typeof(RootDirItem)); using (var reader = readerWriter.GetReader(path)) { var item = (RootDirItem)serializer.Deserialize(reader); this.Name = item.Name; this.Files = item.Files; this.Level = item.Level; this.Directories = item.Directories; } }