Beispiel #1
0
        //2.20 upgraded to uniform c#8 syntax
        public async Task <List <string> > ReadLinesAsync(ContentURI uri,
                                                          string fullURIPath, int rowIndex = -1)
        {
            List <string> lines = new List <string>();

            if (await URIAbsoluteExists(uri, fullURIPath) == false)
            {
                return(lines);
            }
            PLATFORM_TYPES ePlatform = uri.URIDataManager.PlatformType;

            if (Path.IsPathRooted(fullURIPath))
            {
                FileIO fileIO = new FileIO();
                lines = await fileIO.ReadLinesAsync(fullURIPath, rowIndex);
            }
            else
            {
                //176 starting using dataurl prop on localhost
                if (ePlatform == PLATFORM_TYPES.webserver)
                {
                    WebServerFileIO wsfileIO = new WebServerFileIO();
                    lines = await wsfileIO.ReadLinesAsync(fullURIPath, rowIndex);
                }
                else if (ePlatform == PLATFORM_TYPES.azure)
                {
                    AzureIOAsync azureIO = new AzureIOAsync(uri);
                    lines = await azureIO.ReadLinesAsync(fullURIPath, rowIndex);
                }
            }
            return(lines);
        }