Exemplo n.º 1
0
        private void EnsureGridSizeFileExists()
        {
            IWebsiteState ws = Services.Get <IWebsiteState>();

            if (File.Exists(ws.IconGridSizePath))
            {
                string json = File.ReadAllText(ws.IconGridSizePath);
                ws.ActiveIconGridSize = JsonConvert.DeserializeObject <GridSize>(json);
            }
            else
            {
                // set automatically saves to file
                ws.ActiveIconGridSize = GridSize.BuildDefault();
            }
        }