private void LoadStage() { string texoDataFolder = PathExtensions.GetAndCreateDataDirectoryPath(FileManagerConstants.STORAGE_DIRECTORY_NAME); string filePath = texoDataFolder.CombinePathWith(FileManagerConstants.STORAGE_STAGE_FILE_NAME); if (!File.Exists(filePath)) { return; } using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read)) { IStashEntry stage = serialisation.DeserializeFromStream <StashEntry>(file); if (stage == null) { return; } lobby = stage.GetLobby() ?? string.Empty; var pathsBuilder = ImmutableSortedSet.CreateBuilder(new InsensitiveFullPathComparer()); pathsBuilder.UnionWith(stage.GetPaths()); paths = pathsBuilder.ToImmutable(); } }
public void Add(IStashEntry stash) { if (stash == null) { return; } Add(stash.GetPaths()); }
private static Item BuildStashOverviewItem(IStashEntry stash, int index) { MarkdownBuilder builder = new MarkdownBuilder(); builder.Header(GetStashHeader(stash, index)); builder.Bullet(); builder.Italic(GetStashLobbyTitle(stash)); builder.WritePathOverview(stash.GetPaths(), stash.GetLobby()); return(Item.AsMarkdown(builder.ToString())); }
private static Item BuildStashDetailItem(IStashEntry stash, int index) { MarkdownBuilder builder = new MarkdownBuilder(); builder.Header(GetStashHeader(stash, index)); builder.Italic(GetStashLobbyTitle(stash)); builder.WriteLine(); builder.WritePathLists(stash.GetPaths(), stash.GetLobby()); return(Item.AsMarkdown(builder.ToString())); }