public void SaveMiniature(Mini miniature) { var dir = miniature.GetDirectoryName(WorkingDirectory); if (Directory.Exists(miniature.OldDirectory) && !Directory.Exists(dir)) { Directory.Move(miniature.OldDirectory, dir); } else { EnsureDirectory(dir); } miniature.Saved = true; miniature.OldDirectory = dir; var file = miniature.GetFileName(WorkingDirectory); File.WriteAllText(file, JsonConvert.SerializeObject(miniature)); ShowSearch(); }