Example #1
0
        private void LoadStashes()
        {
            string texoDataFolder = PathExtensions.GetAndCreateDataDirectoryPath(FileManagerConstants.STORAGE_DIRECTORY_NAME);
            string filePath       = texoDataFolder.CombinePathWith(FileManagerConstants.STORAGE_STASHES_FILE_NAME);

            if (!File.Exists(filePath))
            {
                return;
            }

            using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
            {
                foreach (StashEntry loadedEntry in serialisation.DeserializeFromStream <List <StashEntry> >(file))
                {
                    if (!string.IsNullOrEmpty(loadedEntry.Name))
                    {
                        if (nameMap.ContainsKey(loadedEntry.Name))
                        {
                            continue;
                        }

                        nameMap[loadedEntry.Name] = stashes.Count;
                    }

                    stashes.Add(loadedEntry);
                }
            }
        }
Example #2
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();
            }
        }
Example #3
0
        private void LoadStageProjects()
        {
            string texoDataFolder = PathExtensions.GetAndCreateDataDirectoryPath(NugetManagerConstants.STORAGE_DIRECTORY_NAME);
            string filePath       = texoDataFolder.CombinePathWith(NugetManagerConstants.STORAGE_STAGE_PROJECTS_FILE_NAME);

            if (!File.Exists(filePath))
            {
                return;
            }

            using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
            {
                IEnumerable <string> projectPaths = serialisation.DeserializeFromStream <List <string> >(file);

                foreach (string projectPath in projectPaths)
                {
                    AddOrUpdate(projectPath);
                }
            }
        }