예제 #1
0
        private async Task <List <GithubSimulationDataURL> > GetSimulationDataFromGithub()
        {
            var files = await _Client.Repository.Content.GetArchive(GITHUB_REPO_OWNER, _RepoName, ArchiveFormat.Zipball, "refs/heads/" + _BranchName);


            List <GithubSimulationDataURL> githubList = new List <GithubSimulationDataURL>();

            using (MemoryStream memoryStream = new MemoryStream(files))
            {
                using (var zipInputStream = new ZipInputStream(memoryStream))
                {
                    ZipEntry zipEntry;
                    while ((zipEntry = zipInputStream.GetNextEntry()) != null)
                    {
                        if (zipEntry.Name.Contains("Engine") && zipEntry.IsFile)
                        {
                            var          simulationName = AssetMatrixStaticFunction.ExtractStringFromPath(zipEntry.Name);
                            StreamReader reader         = new StreamReader(zipInputStream);
                            var          read           = reader.ReadToEnd();
                            githubList.Add(new GithubSimulationDataURL(read, simulationName));
                        }
                    }
                }
            }

            return(githubList);
        }
예제 #2
0
        private List <String> GetAllCharactersFromGithubText(string value)
        {
            List <String> returnedString = new List <string>();

            string returnValue = value;

            string[] stringArray = returnValue.Split('\n');
            foreach (string s in stringArray)
            {
                if (s.Length > 0)
                {
                    returnedString.Add(AssetMatrixStaticFunction.ExtractStringFromPath(s));
                }
            }
            return(returnedString);
        }