using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for WebAppVersion
/// </summary>
public class WebAppVersion
{
    private class Item
    {
        public string version { get; set; }
        public string boxVersion { get; set; }
    }

	public WebAppVersion()
	{

	}

    private static Item LoadJSON()
    {
        Item item = new Item(); 
        using (StreamReader r = new StreamReader((AppDomain.CurrentDomain.BaseDirectory + "\\package.json")))
        {
            string json = r.ReadToEnd();
            item = JsonConvert.DeserializeObject<Item>(json);
        }
        return item; 
    }

    public static string GetBoxVersion()
    {
        Item item = new Item();
        item = LoadJSON();

        return item.boxVersion; 
    }

    public static string GetWebAppVersion(){
        Item item = new Item();
        item = LoadJSON();

        return item.version; 
    }
}