コード例 #1
0
        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();
            }
        }
コード例 #2
0
        public void Add(IStashEntry stash)
        {
            if (stash == null)
            {
                return;
            }

            Add(stash.GetPaths());
        }
コード例 #3
0
ファイル: StashCommand.cs プロジェクト: akobr/texo.ui
        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()));
        }
コード例 #4
0
ファイル: StashCommand.cs プロジェクト: akobr/texo.ui
        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()));
        }