Esempio n. 1
0
        internal static async Task<Report> GenerateFromString(string savedReportString)
        {
            Report newReport = new Report();
            int count = 0;
            string[] reportComponents = savedReportString.Split(new String[] { ":~:" }, StringSplitOptions.None);
            newReport.setImage(await ApplicationData.Current.LocalFolder.GetFileAsync(reportComponents[count++]));

            string logit = reportComponents[count++];
            string latit = reportComponents[count++];
            newReport.setGeolocation(logit, latit);

            int noTags = Int32.Parse(reportComponents[count++]);

            try
            {
                List<string> tags = new List<string>();
                for (int i = 0; i < noTags; i++)
                {
                    tags.Add(reportComponents[count++]);
                }
                newReport.setTags(tags);
                newReport.setDescription(reportComponents[count]);
            }
            catch (NullReferenceException) { Debug.WriteLine("Reached end of input String"); }

            return newReport;
        }